| 157 | } |
| 158 | |
| 159 | export async function listConfigurationProfiles( |
| 160 | client: AppConfigClient, |
| 161 | applicationId: string, |
| 162 | maxResults?: number | null, |
| 163 | nextToken?: string | null |
| 164 | ) { |
| 165 | const response = await client.send( |
| 166 | new ListConfigurationProfilesCommand({ |
| 167 | ApplicationId: applicationId, |
| 168 | ...(maxResults ? { MaxResults: maxResults } : {}), |
| 169 | ...(nextToken ? { NextToken: nextToken } : {}), |
| 170 | }) |
| 171 | ) |
| 172 | |
| 173 | const configurationProfiles = (response.Items ?? []).map((item) => ({ |
| 174 | applicationId: item.ApplicationId ?? '', |
| 175 | id: item.Id ?? '', |
| 176 | name: item.Name ?? '', |
| 177 | description: null, |
| 178 | locationUri: item.LocationUri ?? null, |
| 179 | retrievalRoleArn: null, |
| 180 | type: item.Type ?? null, |
| 181 | validatorTypes: item.ValidatorTypes ?? [], |
| 182 | })) |
| 183 | |
| 184 | return { |
| 185 | configurationProfiles, |
| 186 | nextToken: response.NextToken ?? null, |
| 187 | count: configurationProfiles.length, |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | export async function createConfigurationProfile( |
| 192 | client: AppConfigClient, |