getType method

Future<GetTypeResponse> getType({
  1. required String apiId,
  2. required TypeDefinitionFormat format,
  3. required String typeName,
})

Retrieves a Type object.

May throw BadRequestException. May throw ConcurrentModificationException. May throw NotFoundException. May throw UnauthorizedException. May throw InternalFailureException.

Parameter apiId : The API ID.

Parameter format : The type format: SDL or JSON.

Parameter typeName : The type name.

Implementation

Future<GetTypeResponse> getType({
  required String apiId,
  required TypeDefinitionFormat format,
  required String typeName,
}) async {
  ArgumentError.checkNotNull(apiId, 'apiId');
  ArgumentError.checkNotNull(format, 'format');
  ArgumentError.checkNotNull(typeName, 'typeName');
  _s.validateStringLength(
    'typeName',
    typeName,
    1,
    65536,
    isRequired: true,
  );
  final $query = <String, List<String>>{
    'format': [format.toValue()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/v1/apis/${Uri.encodeComponent(apiId)}/types/${Uri.encodeComponent(typeName)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetTypeResponse.fromJson(response);
}