createGraphqlApi method
- required AuthenticationType authenticationType,
- required String name,
- List<
AdditionalAuthenticationProvider> ? additionalAuthenticationProviders, - LogConfig? logConfig,
- OpenIDConnectConfig? openIDConnectConfig,
- Map<
String, String> ? tags, - UserPoolConfig? userPoolConfig,
- bool? xrayEnabled,
Creates a GraphqlApi
object.
May throw BadRequestException. May throw LimitExceededException. May throw ConcurrentModificationException. May throw UnauthorizedException. May throw InternalFailureException. May throw ApiLimitExceededException.
Parameter authenticationType
:
The authentication type: API key, AWS IAM, OIDC, or Amazon Cognito user
pools.
Parameter name
:
A user-supplied name for the GraphqlApi
.
Parameter additionalAuthenticationProviders
:
A list of additional authentication providers for the
GraphqlApi
API.
Parameter logConfig
:
The Amazon CloudWatch Logs configuration.
Parameter openIDConnectConfig
:
The OpenID Connect configuration.
Parameter tags
:
A TagMap
object.
Parameter userPoolConfig
:
The Amazon Cognito user pool configuration.
Parameter xrayEnabled
:
A flag indicating whether to enable X-Ray tracing for the
GraphqlApi
.
Implementation
Future<CreateGraphqlApiResponse> createGraphqlApi({
required AuthenticationType authenticationType,
required String name,
List<AdditionalAuthenticationProvider>? additionalAuthenticationProviders,
LogConfig? logConfig,
OpenIDConnectConfig? openIDConnectConfig,
Map<String, String>? tags,
UserPoolConfig? userPoolConfig,
bool? xrayEnabled,
}) async {
ArgumentError.checkNotNull(authenticationType, 'authenticationType');
ArgumentError.checkNotNull(name, 'name');
final $payload = <String, dynamic>{
'authenticationType': authenticationType.toValue(),
'name': name,
if (additionalAuthenticationProviders != null)
'additionalAuthenticationProviders': additionalAuthenticationProviders,
if (logConfig != null) 'logConfig': logConfig,
if (openIDConnectConfig != null)
'openIDConnectConfig': openIDConnectConfig,
if (tags != null) 'tags': tags,
if (userPoolConfig != null) 'userPoolConfig': userPoolConfig,
if (xrayEnabled != null) 'xrayEnabled': xrayEnabled,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v1/apis',
exceptionFnMap: _exceptionFns,
);
return CreateGraphqlApiResponse.fromJson(response);
}