use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::param::{Params, ServiceParams};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AdditionalAuthenticationProvider {
#[serde(rename = "authenticationType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_type: Option<String>,
#[serde(rename = "openIDConnectConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub open_id_connect_config: Option<OpenIDConnectConfig>,
#[serde(rename = "userPoolConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_pool_config: Option<CognitoUserPoolConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ApiKey {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "expires")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expires: Option<i64>,
#[serde(rename = "id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AuthorizationConfig {
#[serde(rename = "authorizationType")]
pub authorization_type: String,
#[serde(rename = "awsIamConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_iam_config: Option<AwsIamConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AwsIamConfig {
#[serde(rename = "signingRegion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub signing_region: Option<String>,
#[serde(rename = "signingServiceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub signing_service_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CognitoUserPoolConfig {
#[serde(rename = "appIdClientRegex")]
#[serde(skip_serializing_if = "Option::is_none")]
pub app_id_client_regex: Option<String>,
#[serde(rename = "awsRegion")]
pub aws_region: String,
#[serde(rename = "userPoolId")]
pub user_pool_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateApiKeyRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "expires")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expires: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateApiKeyResponse {
#[serde(rename = "apiKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub api_key: Option<ApiKey>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateDataSourceRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "dynamodbConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dynamodb_config: Option<DynamodbDataSourceConfig>,
#[serde(rename = "elasticsearchConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub elasticsearch_config: Option<ElasticsearchDataSourceConfig>,
#[serde(rename = "httpConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub http_config: Option<HttpDataSourceConfig>,
#[serde(rename = "lambdaConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lambda_config: Option<LambdaDataSourceConfig>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "relationalDatabaseConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database_config: Option<RelationalDatabaseDataSourceConfig>,
#[serde(rename = "serviceRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_role_arn: Option<String>,
#[serde(rename = "type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateDataSourceResponse {
#[serde(rename = "dataSource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_source: Option<DataSource>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateFunctionRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "dataSourceName")]
pub data_source_name: String,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "functionVersion")]
pub function_version: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "requestMappingTemplate")]
pub request_mapping_template: String,
#[serde(rename = "responseMappingTemplate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub response_mapping_template: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateFunctionResponse {
#[serde(rename = "functionConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_configuration: Option<FunctionConfiguration>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateGraphqlApiRequest {
#[serde(rename = "additionalAuthenticationProviders")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_authentication_providers: Option<Vec<AdditionalAuthenticationProvider>>,
#[serde(rename = "authenticationType")]
pub authentication_type: String,
#[serde(rename = "logConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_config: Option<LogConfig>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "openIDConnectConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub open_id_connect_config: Option<OpenIDConnectConfig>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "userPoolConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_pool_config: Option<UserPoolConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateGraphqlApiResponse {
#[serde(rename = "graphqlApi")]
#[serde(skip_serializing_if = "Option::is_none")]
pub graphql_api: Option<GraphqlApi>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateResolverRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "dataSourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_source_name: Option<String>,
#[serde(rename = "fieldName")]
pub field_name: String,
#[serde(rename = "kind")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
#[serde(rename = "pipelineConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pipeline_config: Option<PipelineConfig>,
#[serde(rename = "requestMappingTemplate")]
pub request_mapping_template: String,
#[serde(rename = "responseMappingTemplate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub response_mapping_template: Option<String>,
#[serde(rename = "typeName")]
pub type_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateResolverResponse {
#[serde(rename = "resolver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resolver: Option<Resolver>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateTypeRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "definition")]
pub definition: String,
#[serde(rename = "format")]
pub format: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateTypeResponse {
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<Type>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DataSource {
#[serde(rename = "dataSourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_source_arn: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "dynamodbConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dynamodb_config: Option<DynamodbDataSourceConfig>,
#[serde(rename = "elasticsearchConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub elasticsearch_config: Option<ElasticsearchDataSourceConfig>,
#[serde(rename = "httpConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub http_config: Option<HttpDataSourceConfig>,
#[serde(rename = "lambdaConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lambda_config: Option<LambdaDataSourceConfig>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "relationalDatabaseConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database_config: Option<RelationalDatabaseDataSourceConfig>,
#[serde(rename = "serviceRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_role_arn: Option<String>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteApiKeyRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteApiKeyResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteDataSourceRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteDataSourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteFunctionRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "functionId")]
pub function_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteFunctionResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteGraphqlApiRequest {
#[serde(rename = "apiId")]
pub api_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteGraphqlApiResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteResolverRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "fieldName")]
pub field_name: String,
#[serde(rename = "typeName")]
pub type_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteResolverResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteTypeRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "typeName")]
pub type_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteTypeResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DynamodbDataSourceConfig {
#[serde(rename = "awsRegion")]
pub aws_region: String,
#[serde(rename = "tableName")]
pub table_name: String,
#[serde(rename = "useCallerCredentials")]
#[serde(skip_serializing_if = "Option::is_none")]
pub use_caller_credentials: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ElasticsearchDataSourceConfig {
#[serde(rename = "awsRegion")]
pub aws_region: String,
#[serde(rename = "endpoint")]
pub endpoint: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct FunctionConfiguration {
#[serde(rename = "dataSourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_source_name: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "functionArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_arn: Option<String>,
#[serde(rename = "functionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_id: Option<String>,
#[serde(rename = "functionVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_version: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "requestMappingTemplate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub request_mapping_template: Option<String>,
#[serde(rename = "responseMappingTemplate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub response_mapping_template: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDataSourceRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDataSourceResponse {
#[serde(rename = "dataSource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_source: Option<DataSource>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetFunctionRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "functionId")]
pub function_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetFunctionResponse {
#[serde(rename = "functionConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_configuration: Option<FunctionConfiguration>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetGraphqlApiRequest {
#[serde(rename = "apiId")]
pub api_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetGraphqlApiResponse {
#[serde(rename = "graphqlApi")]
#[serde(skip_serializing_if = "Option::is_none")]
pub graphql_api: Option<GraphqlApi>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetIntrospectionSchemaRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "format")]
pub format: String,
#[serde(rename = "includeDirectives")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_directives: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct GetIntrospectionSchemaResponse {
pub schema: Option<bytes::Bytes>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetResolverRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "fieldName")]
pub field_name: String,
#[serde(rename = "typeName")]
pub type_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetResolverResponse {
#[serde(rename = "resolver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resolver: Option<Resolver>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetSchemaCreationStatusRequest {
#[serde(rename = "apiId")]
pub api_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetSchemaCreationStatusResponse {
#[serde(rename = "details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub details: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetTypeRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "format")]
pub format: String,
#[serde(rename = "typeName")]
pub type_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetTypeResponse {
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<Type>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GraphqlApi {
#[serde(rename = "additionalAuthenticationProviders")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_authentication_providers: Option<Vec<AdditionalAuthenticationProvider>>,
#[serde(rename = "apiId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub api_id: Option<String>,
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "authenticationType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_type: Option<String>,
#[serde(rename = "logConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_config: Option<LogConfig>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "openIDConnectConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub open_id_connect_config: Option<OpenIDConnectConfig>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "uris")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uris: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "userPoolConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_pool_config: Option<UserPoolConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HttpDataSourceConfig {
#[serde(rename = "authorizationConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization_config: Option<AuthorizationConfig>,
#[serde(rename = "endpoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LambdaDataSourceConfig {
#[serde(rename = "lambdaFunctionArn")]
pub lambda_function_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListApiKeysRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListApiKeysResponse {
#[serde(rename = "apiKeys")]
#[serde(skip_serializing_if = "Option::is_none")]
pub api_keys: Option<Vec<ApiKey>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListDataSourcesRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListDataSourcesResponse {
#[serde(rename = "dataSources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_sources: Option<Vec<DataSource>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListFunctionsRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListFunctionsResponse {
#[serde(rename = "functions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub functions: Option<Vec<FunctionConfiguration>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListGraphqlApisRequest {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListGraphqlApisResponse {
#[serde(rename = "graphqlApis")]
#[serde(skip_serializing_if = "Option::is_none")]
pub graphql_apis: Option<Vec<GraphqlApi>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListResolversByFunctionRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "functionId")]
pub function_id: String,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListResolversByFunctionResponse {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "resolvers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resolvers: Option<Vec<Resolver>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListResolversRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "typeName")]
pub type_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListResolversResponse {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "resolvers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resolvers: Option<Vec<Resolver>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsForResourceRequest {
#[serde(rename = "resourceArn")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsForResourceResponse {
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTypesRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "format")]
pub format: String,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTypesResponse {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "types")]
#[serde(skip_serializing_if = "Option::is_none")]
pub types: Option<Vec<Type>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LogConfig {
#[serde(rename = "cloudWatchLogsRoleArn")]
pub cloud_watch_logs_role_arn: String,
#[serde(rename = "fieldLogLevel")]
pub field_log_level: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct OpenIDConnectConfig {
#[serde(rename = "authTTL")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auth_ttl: Option<i64>,
#[serde(rename = "clientId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_id: Option<String>,
#[serde(rename = "iatTTL")]
#[serde(skip_serializing_if = "Option::is_none")]
pub iat_ttl: Option<i64>,
#[serde(rename = "issuer")]
pub issuer: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PipelineConfig {
#[serde(rename = "functions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub functions: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RdsHttpEndpointConfig {
#[serde(rename = "awsRegion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_region: Option<String>,
#[serde(rename = "awsSecretStoreArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_secret_store_arn: Option<String>,
#[serde(rename = "databaseName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub database_name: Option<String>,
#[serde(rename = "dbClusterIdentifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub db_cluster_identifier: Option<String>,
#[serde(rename = "schema")]
#[serde(skip_serializing_if = "Option::is_none")]
pub schema: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RelationalDatabaseDataSourceConfig {
#[serde(rename = "rdsHttpEndpointConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rds_http_endpoint_config: Option<RdsHttpEndpointConfig>,
#[serde(rename = "relationalDatabaseSourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database_source_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Resolver {
#[serde(rename = "dataSourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_source_name: Option<String>,
#[serde(rename = "fieldName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub field_name: Option<String>,
#[serde(rename = "kind")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
#[serde(rename = "pipelineConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pipeline_config: Option<PipelineConfig>,
#[serde(rename = "requestMappingTemplate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub request_mapping_template: Option<String>,
#[serde(rename = "resolverArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resolver_arn: Option<String>,
#[serde(rename = "responseMappingTemplate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub response_mapping_template: Option<String>,
#[serde(rename = "typeName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartSchemaCreationRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "definition")]
#[serde(
deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
default
)]
pub definition: bytes::Bytes,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StartSchemaCreationResponse {
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TagResourceRequest {
#[serde(rename = "resourceArn")]
pub resource_arn: String,
#[serde(rename = "tags")]
pub tags: ::std::collections::HashMap<String, String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TagResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Type {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "definition")]
#[serde(skip_serializing_if = "Option::is_none")]
pub definition: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "format")]
#[serde(skip_serializing_if = "Option::is_none")]
pub format: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UntagResourceRequest {
#[serde(rename = "resourceArn")]
pub resource_arn: String,
#[serde(rename = "tagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UntagResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateApiKeyRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "expires")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expires: Option<i64>,
#[serde(rename = "id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateApiKeyResponse {
#[serde(rename = "apiKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub api_key: Option<ApiKey>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateDataSourceRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "dynamodbConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dynamodb_config: Option<DynamodbDataSourceConfig>,
#[serde(rename = "elasticsearchConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub elasticsearch_config: Option<ElasticsearchDataSourceConfig>,
#[serde(rename = "httpConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub http_config: Option<HttpDataSourceConfig>,
#[serde(rename = "lambdaConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lambda_config: Option<LambdaDataSourceConfig>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "relationalDatabaseConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database_config: Option<RelationalDatabaseDataSourceConfig>,
#[serde(rename = "serviceRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_role_arn: Option<String>,
#[serde(rename = "type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateDataSourceResponse {
#[serde(rename = "dataSource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_source: Option<DataSource>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateFunctionRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "dataSourceName")]
pub data_source_name: String,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "functionId")]
pub function_id: String,
#[serde(rename = "functionVersion")]
pub function_version: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "requestMappingTemplate")]
pub request_mapping_template: String,
#[serde(rename = "responseMappingTemplate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub response_mapping_template: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateFunctionResponse {
#[serde(rename = "functionConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_configuration: Option<FunctionConfiguration>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateGraphqlApiRequest {
#[serde(rename = "additionalAuthenticationProviders")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_authentication_providers: Option<Vec<AdditionalAuthenticationProvider>>,
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "authenticationType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_type: Option<String>,
#[serde(rename = "logConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_config: Option<LogConfig>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "openIDConnectConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub open_id_connect_config: Option<OpenIDConnectConfig>,
#[serde(rename = "userPoolConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_pool_config: Option<UserPoolConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateGraphqlApiResponse {
#[serde(rename = "graphqlApi")]
#[serde(skip_serializing_if = "Option::is_none")]
pub graphql_api: Option<GraphqlApi>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateResolverRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "dataSourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_source_name: Option<String>,
#[serde(rename = "fieldName")]
pub field_name: String,
#[serde(rename = "kind")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
#[serde(rename = "pipelineConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pipeline_config: Option<PipelineConfig>,
#[serde(rename = "requestMappingTemplate")]
pub request_mapping_template: String,
#[serde(rename = "responseMappingTemplate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub response_mapping_template: Option<String>,
#[serde(rename = "typeName")]
pub type_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateResolverResponse {
#[serde(rename = "resolver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resolver: Option<Resolver>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateTypeRequest {
#[serde(rename = "apiId")]
pub api_id: String,
#[serde(rename = "definition")]
#[serde(skip_serializing_if = "Option::is_none")]
pub definition: Option<String>,
#[serde(rename = "format")]
pub format: String,
#[serde(rename = "typeName")]
pub type_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateTypeResponse {
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<Type>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct UserPoolConfig {
#[serde(rename = "appIdClientRegex")]
#[serde(skip_serializing_if = "Option::is_none")]
pub app_id_client_regex: Option<String>,
#[serde(rename = "awsRegion")]
pub aws_region: String,
#[serde(rename = "defaultAction")]
pub default_action: String,
#[serde(rename = "userPoolId")]
pub user_pool_id: String,
}
#[derive(Debug, PartialEq)]
pub enum CreateApiKeyError {
ApiKeyLimitExceeded(String),
ApiKeyValidityOutOfBounds(String),
BadRequest(String),
InternalFailure(String),
LimitExceeded(String),
NotFound(String),
Unauthorized(String),
}
impl CreateApiKeyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateApiKeyError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ApiKeyLimitExceededException" => {
return RusotoError::Service(CreateApiKeyError::ApiKeyLimitExceeded(err.msg))
}
"ApiKeyValidityOutOfBoundsException" => {
return RusotoError::Service(CreateApiKeyError::ApiKeyValidityOutOfBounds(
err.msg,
))
}
"BadRequestException" => {
return RusotoError::Service(CreateApiKeyError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(CreateApiKeyError::InternalFailure(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateApiKeyError::LimitExceeded(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(CreateApiKeyError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(CreateApiKeyError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateApiKeyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateApiKeyError {
fn description(&self) -> &str {
match *self {
CreateApiKeyError::ApiKeyLimitExceeded(ref cause) => cause,
CreateApiKeyError::ApiKeyValidityOutOfBounds(ref cause) => cause,
CreateApiKeyError::BadRequest(ref cause) => cause,
CreateApiKeyError::InternalFailure(ref cause) => cause,
CreateApiKeyError::LimitExceeded(ref cause) => cause,
CreateApiKeyError::NotFound(ref cause) => cause,
CreateApiKeyError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateDataSourceError {
BadRequest(String),
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl CreateDataSourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateDataSourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateDataSourceError::BadRequest(err.msg))
}
"ConcurrentModificationException" => {
return RusotoError::Service(CreateDataSourceError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(CreateDataSourceError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(CreateDataSourceError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(CreateDataSourceError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateDataSourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateDataSourceError {
fn description(&self) -> &str {
match *self {
CreateDataSourceError::BadRequest(ref cause) => cause,
CreateDataSourceError::ConcurrentModification(ref cause) => cause,
CreateDataSourceError::InternalFailure(ref cause) => cause,
CreateDataSourceError::NotFound(ref cause) => cause,
CreateDataSourceError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateFunctionError {
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl CreateFunctionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateFunctionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(CreateFunctionError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(CreateFunctionError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(CreateFunctionError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(CreateFunctionError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateFunctionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateFunctionError {
fn description(&self) -> &str {
match *self {
CreateFunctionError::ConcurrentModification(ref cause) => cause,
CreateFunctionError::InternalFailure(ref cause) => cause,
CreateFunctionError::NotFound(ref cause) => cause,
CreateFunctionError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateGraphqlApiError {
ApiLimitExceeded(String),
BadRequest(String),
ConcurrentModification(String),
InternalFailure(String),
LimitExceeded(String),
Unauthorized(String),
}
impl CreateGraphqlApiError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateGraphqlApiError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ApiLimitExceededException" => {
return RusotoError::Service(CreateGraphqlApiError::ApiLimitExceeded(err.msg))
}
"BadRequestException" => {
return RusotoError::Service(CreateGraphqlApiError::BadRequest(err.msg))
}
"ConcurrentModificationException" => {
return RusotoError::Service(CreateGraphqlApiError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(CreateGraphqlApiError::InternalFailure(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateGraphqlApiError::LimitExceeded(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(CreateGraphqlApiError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateGraphqlApiError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateGraphqlApiError {
fn description(&self) -> &str {
match *self {
CreateGraphqlApiError::ApiLimitExceeded(ref cause) => cause,
CreateGraphqlApiError::BadRequest(ref cause) => cause,
CreateGraphqlApiError::ConcurrentModification(ref cause) => cause,
CreateGraphqlApiError::InternalFailure(ref cause) => cause,
CreateGraphqlApiError::LimitExceeded(ref cause) => cause,
CreateGraphqlApiError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateResolverError {
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl CreateResolverError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateResolverError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(CreateResolverError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(CreateResolverError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(CreateResolverError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(CreateResolverError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateResolverError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateResolverError {
fn description(&self) -> &str {
match *self {
CreateResolverError::ConcurrentModification(ref cause) => cause,
CreateResolverError::InternalFailure(ref cause) => cause,
CreateResolverError::NotFound(ref cause) => cause,
CreateResolverError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateTypeError {
BadRequest(String),
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl CreateTypeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateTypeError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateTypeError::BadRequest(err.msg))
}
"ConcurrentModificationException" => {
return RusotoError::Service(CreateTypeError::ConcurrentModification(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(CreateTypeError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(CreateTypeError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(CreateTypeError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateTypeError {
fn description(&self) -> &str {
match *self {
CreateTypeError::BadRequest(ref cause) => cause,
CreateTypeError::ConcurrentModification(ref cause) => cause,
CreateTypeError::InternalFailure(ref cause) => cause,
CreateTypeError::NotFound(ref cause) => cause,
CreateTypeError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteApiKeyError {
BadRequest(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl DeleteApiKeyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteApiKeyError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteApiKeyError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(DeleteApiKeyError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteApiKeyError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(DeleteApiKeyError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteApiKeyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteApiKeyError {
fn description(&self) -> &str {
match *self {
DeleteApiKeyError::BadRequest(ref cause) => cause,
DeleteApiKeyError::InternalFailure(ref cause) => cause,
DeleteApiKeyError::NotFound(ref cause) => cause,
DeleteApiKeyError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteDataSourceError {
BadRequest(String),
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl DeleteDataSourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDataSourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteDataSourceError::BadRequest(err.msg))
}
"ConcurrentModificationException" => {
return RusotoError::Service(DeleteDataSourceError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(DeleteDataSourceError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteDataSourceError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(DeleteDataSourceError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteDataSourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDataSourceError {
fn description(&self) -> &str {
match *self {
DeleteDataSourceError::BadRequest(ref cause) => cause,
DeleteDataSourceError::ConcurrentModification(ref cause) => cause,
DeleteDataSourceError::InternalFailure(ref cause) => cause,
DeleteDataSourceError::NotFound(ref cause) => cause,
DeleteDataSourceError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteFunctionError {
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl DeleteFunctionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteFunctionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(DeleteFunctionError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(DeleteFunctionError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteFunctionError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(DeleteFunctionError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteFunctionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteFunctionError {
fn description(&self) -> &str {
match *self {
DeleteFunctionError::ConcurrentModification(ref cause) => cause,
DeleteFunctionError::InternalFailure(ref cause) => cause,
DeleteFunctionError::NotFound(ref cause) => cause,
DeleteFunctionError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteGraphqlApiError {
AccessDenied(String),
BadRequest(String),
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl DeleteGraphqlApiError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteGraphqlApiError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DeleteGraphqlApiError::AccessDenied(err.msg))
}
"BadRequestException" => {
return RusotoError::Service(DeleteGraphqlApiError::BadRequest(err.msg))
}
"ConcurrentModificationException" => {
return RusotoError::Service(DeleteGraphqlApiError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(DeleteGraphqlApiError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteGraphqlApiError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(DeleteGraphqlApiError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteGraphqlApiError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteGraphqlApiError {
fn description(&self) -> &str {
match *self {
DeleteGraphqlApiError::AccessDenied(ref cause) => cause,
DeleteGraphqlApiError::BadRequest(ref cause) => cause,
DeleteGraphqlApiError::ConcurrentModification(ref cause) => cause,
DeleteGraphqlApiError::InternalFailure(ref cause) => cause,
DeleteGraphqlApiError::NotFound(ref cause) => cause,
DeleteGraphqlApiError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteResolverError {
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl DeleteResolverError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteResolverError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(DeleteResolverError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(DeleteResolverError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteResolverError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(DeleteResolverError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteResolverError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteResolverError {
fn description(&self) -> &str {
match *self {
DeleteResolverError::ConcurrentModification(ref cause) => cause,
DeleteResolverError::InternalFailure(ref cause) => cause,
DeleteResolverError::NotFound(ref cause) => cause,
DeleteResolverError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteTypeError {
BadRequest(String),
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl DeleteTypeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteTypeError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteTypeError::BadRequest(err.msg))
}
"ConcurrentModificationException" => {
return RusotoError::Service(DeleteTypeError::ConcurrentModification(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(DeleteTypeError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteTypeError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(DeleteTypeError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteTypeError {
fn description(&self) -> &str {
match *self {
DeleteTypeError::BadRequest(ref cause) => cause,
DeleteTypeError::ConcurrentModification(ref cause) => cause,
DeleteTypeError::InternalFailure(ref cause) => cause,
DeleteTypeError::NotFound(ref cause) => cause,
DeleteTypeError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDataSourceError {
BadRequest(String),
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl GetDataSourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDataSourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetDataSourceError::BadRequest(err.msg))
}
"ConcurrentModificationException" => {
return RusotoError::Service(GetDataSourceError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(GetDataSourceError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(GetDataSourceError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(GetDataSourceError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetDataSourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDataSourceError {
fn description(&self) -> &str {
match *self {
GetDataSourceError::BadRequest(ref cause) => cause,
GetDataSourceError::ConcurrentModification(ref cause) => cause,
GetDataSourceError::InternalFailure(ref cause) => cause,
GetDataSourceError::NotFound(ref cause) => cause,
GetDataSourceError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFunctionError {
ConcurrentModification(String),
NotFound(String),
Unauthorized(String),
}
impl GetFunctionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetFunctionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(GetFunctionError::ConcurrentModification(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(GetFunctionError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(GetFunctionError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetFunctionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFunctionError {
fn description(&self) -> &str {
match *self {
GetFunctionError::ConcurrentModification(ref cause) => cause,
GetFunctionError::NotFound(ref cause) => cause,
GetFunctionError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetGraphqlApiError {
AccessDenied(String),
BadRequest(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl GetGraphqlApiError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetGraphqlApiError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(GetGraphqlApiError::AccessDenied(err.msg))
}
"BadRequestException" => {
return RusotoError::Service(GetGraphqlApiError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(GetGraphqlApiError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(GetGraphqlApiError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(GetGraphqlApiError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetGraphqlApiError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetGraphqlApiError {
fn description(&self) -> &str {
match *self {
GetGraphqlApiError::AccessDenied(ref cause) => cause,
GetGraphqlApiError::BadRequest(ref cause) => cause,
GetGraphqlApiError::InternalFailure(ref cause) => cause,
GetGraphqlApiError::NotFound(ref cause) => cause,
GetGraphqlApiError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetIntrospectionSchemaError {
GraphQLSchema(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl GetIntrospectionSchemaError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetIntrospectionSchemaError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"GraphQLSchemaException" => {
return RusotoError::Service(GetIntrospectionSchemaError::GraphQLSchema(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(GetIntrospectionSchemaError::InternalFailure(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(GetIntrospectionSchemaError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(GetIntrospectionSchemaError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetIntrospectionSchemaError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetIntrospectionSchemaError {
fn description(&self) -> &str {
match *self {
GetIntrospectionSchemaError::GraphQLSchema(ref cause) => cause,
GetIntrospectionSchemaError::InternalFailure(ref cause) => cause,
GetIntrospectionSchemaError::NotFound(ref cause) => cause,
GetIntrospectionSchemaError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetResolverError {
ConcurrentModification(String),
NotFound(String),
Unauthorized(String),
}
impl GetResolverError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetResolverError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(GetResolverError::ConcurrentModification(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(GetResolverError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(GetResolverError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetResolverError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetResolverError {
fn description(&self) -> &str {
match *self {
GetResolverError::ConcurrentModification(ref cause) => cause,
GetResolverError::NotFound(ref cause) => cause,
GetResolverError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetSchemaCreationStatusError {
BadRequest(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl GetSchemaCreationStatusError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetSchemaCreationStatusError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetSchemaCreationStatusError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(GetSchemaCreationStatusError::InternalFailure(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(GetSchemaCreationStatusError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(GetSchemaCreationStatusError::Unauthorized(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetSchemaCreationStatusError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetSchemaCreationStatusError {
fn description(&self) -> &str {
match *self {
GetSchemaCreationStatusError::BadRequest(ref cause) => cause,
GetSchemaCreationStatusError::InternalFailure(ref cause) => cause,
GetSchemaCreationStatusError::NotFound(ref cause) => cause,
GetSchemaCreationStatusError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetTypeError {
BadRequest(String),
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl GetTypeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetTypeError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetTypeError::BadRequest(err.msg))
}
"ConcurrentModificationException" => {
return RusotoError::Service(GetTypeError::ConcurrentModification(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(GetTypeError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(GetTypeError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(GetTypeError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetTypeError {
fn description(&self) -> &str {
match *self {
GetTypeError::BadRequest(ref cause) => cause,
GetTypeError::ConcurrentModification(ref cause) => cause,
GetTypeError::InternalFailure(ref cause) => cause,
GetTypeError::NotFound(ref cause) => cause,
GetTypeError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListApiKeysError {
BadRequest(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl ListApiKeysError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListApiKeysError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListApiKeysError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(ListApiKeysError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(ListApiKeysError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(ListApiKeysError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListApiKeysError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListApiKeysError {
fn description(&self) -> &str {
match *self {
ListApiKeysError::BadRequest(ref cause) => cause,
ListApiKeysError::InternalFailure(ref cause) => cause,
ListApiKeysError::NotFound(ref cause) => cause,
ListApiKeysError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListDataSourcesError {
BadRequest(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl ListDataSourcesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDataSourcesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListDataSourcesError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(ListDataSourcesError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(ListDataSourcesError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(ListDataSourcesError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListDataSourcesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDataSourcesError {
fn description(&self) -> &str {
match *self {
ListDataSourcesError::BadRequest(ref cause) => cause,
ListDataSourcesError::InternalFailure(ref cause) => cause,
ListDataSourcesError::NotFound(ref cause) => cause,
ListDataSourcesError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListFunctionsError {
BadRequest(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl ListFunctionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListFunctionsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListFunctionsError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(ListFunctionsError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(ListFunctionsError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(ListFunctionsError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListFunctionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListFunctionsError {
fn description(&self) -> &str {
match *self {
ListFunctionsError::BadRequest(ref cause) => cause,
ListFunctionsError::InternalFailure(ref cause) => cause,
ListFunctionsError::NotFound(ref cause) => cause,
ListFunctionsError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListGraphqlApisError {
BadRequest(String),
InternalFailure(String),
Unauthorized(String),
}
impl ListGraphqlApisError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListGraphqlApisError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListGraphqlApisError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(ListGraphqlApisError::InternalFailure(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(ListGraphqlApisError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListGraphqlApisError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListGraphqlApisError {
fn description(&self) -> &str {
match *self {
ListGraphqlApisError::BadRequest(ref cause) => cause,
ListGraphqlApisError::InternalFailure(ref cause) => cause,
ListGraphqlApisError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListResolversError {
BadRequest(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl ListResolversError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListResolversError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListResolversError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(ListResolversError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(ListResolversError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(ListResolversError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListResolversError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListResolversError {
fn description(&self) -> &str {
match *self {
ListResolversError::BadRequest(ref cause) => cause,
ListResolversError::InternalFailure(ref cause) => cause,
ListResolversError::NotFound(ref cause) => cause,
ListResolversError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListResolversByFunctionError {
BadRequest(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl ListResolversByFunctionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListResolversByFunctionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListResolversByFunctionError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(ListResolversByFunctionError::InternalFailure(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(ListResolversByFunctionError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(ListResolversByFunctionError::Unauthorized(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListResolversByFunctionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListResolversByFunctionError {
fn description(&self) -> &str {
match *self {
ListResolversByFunctionError::BadRequest(ref cause) => cause,
ListResolversByFunctionError::InternalFailure(ref cause) => cause,
ListResolversByFunctionError::NotFound(ref cause) => cause,
ListResolversByFunctionError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
AccessDenied(String),
BadRequest(String),
InternalFailure(String),
LimitExceeded(String),
NotFound(String),
Unauthorized(String),
}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListTagsForResourceError::AccessDenied(err.msg))
}
"BadRequestException" => {
return RusotoError::Service(ListTagsForResourceError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(ListTagsForResourceError::InternalFailure(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(ListTagsForResourceError::LimitExceeded(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(ListTagsForResourceError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(ListTagsForResourceError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsForResourceError {
fn description(&self) -> &str {
match *self {
ListTagsForResourceError::AccessDenied(ref cause) => cause,
ListTagsForResourceError::BadRequest(ref cause) => cause,
ListTagsForResourceError::InternalFailure(ref cause) => cause,
ListTagsForResourceError::LimitExceeded(ref cause) => cause,
ListTagsForResourceError::NotFound(ref cause) => cause,
ListTagsForResourceError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTypesError {
BadRequest(String),
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl ListTypesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTypesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListTypesError::BadRequest(err.msg))
}
"ConcurrentModificationException" => {
return RusotoError::Service(ListTypesError::ConcurrentModification(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(ListTypesError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(ListTypesError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(ListTypesError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTypesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTypesError {
fn description(&self) -> &str {
match *self {
ListTypesError::BadRequest(ref cause) => cause,
ListTypesError::ConcurrentModification(ref cause) => cause,
ListTypesError::InternalFailure(ref cause) => cause,
ListTypesError::NotFound(ref cause) => cause,
ListTypesError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartSchemaCreationError {
BadRequest(String),
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl StartSchemaCreationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartSchemaCreationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(StartSchemaCreationError::BadRequest(err.msg))
}
"ConcurrentModificationException" => {
return RusotoError::Service(StartSchemaCreationError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(StartSchemaCreationError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(StartSchemaCreationError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(StartSchemaCreationError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartSchemaCreationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartSchemaCreationError {
fn description(&self) -> &str {
match *self {
StartSchemaCreationError::BadRequest(ref cause) => cause,
StartSchemaCreationError::ConcurrentModification(ref cause) => cause,
StartSchemaCreationError::InternalFailure(ref cause) => cause,
StartSchemaCreationError::NotFound(ref cause) => cause,
StartSchemaCreationError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
AccessDenied(String),
BadRequest(String),
InternalFailure(String),
LimitExceeded(String),
NotFound(String),
Unauthorized(String),
}
impl TagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(TagResourceError::AccessDenied(err.msg))
}
"BadRequestException" => {
return RusotoError::Service(TagResourceError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(TagResourceError::InternalFailure(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(TagResourceError::LimitExceeded(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(TagResourceError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(TagResourceError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for TagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagResourceError {
fn description(&self) -> &str {
match *self {
TagResourceError::AccessDenied(ref cause) => cause,
TagResourceError::BadRequest(ref cause) => cause,
TagResourceError::InternalFailure(ref cause) => cause,
TagResourceError::LimitExceeded(ref cause) => cause,
TagResourceError::NotFound(ref cause) => cause,
TagResourceError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
AccessDenied(String),
BadRequest(String),
InternalFailure(String),
LimitExceeded(String),
NotFound(String),
Unauthorized(String),
}
impl UntagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(UntagResourceError::AccessDenied(err.msg))
}
"BadRequestException" => {
return RusotoError::Service(UntagResourceError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(UntagResourceError::InternalFailure(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(UntagResourceError::LimitExceeded(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(UntagResourceError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(UntagResourceError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagResourceError {
fn description(&self) -> &str {
match *self {
UntagResourceError::AccessDenied(ref cause) => cause,
UntagResourceError::BadRequest(ref cause) => cause,
UntagResourceError::InternalFailure(ref cause) => cause,
UntagResourceError::LimitExceeded(ref cause) => cause,
UntagResourceError::NotFound(ref cause) => cause,
UntagResourceError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateApiKeyError {
ApiKeyValidityOutOfBounds(String),
BadRequest(String),
InternalFailure(String),
LimitExceeded(String),
NotFound(String),
Unauthorized(String),
}
impl UpdateApiKeyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateApiKeyError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ApiKeyValidityOutOfBoundsException" => {
return RusotoError::Service(UpdateApiKeyError::ApiKeyValidityOutOfBounds(
err.msg,
))
}
"BadRequestException" => {
return RusotoError::Service(UpdateApiKeyError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(UpdateApiKeyError::InternalFailure(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(UpdateApiKeyError::LimitExceeded(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(UpdateApiKeyError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(UpdateApiKeyError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateApiKeyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateApiKeyError {
fn description(&self) -> &str {
match *self {
UpdateApiKeyError::ApiKeyValidityOutOfBounds(ref cause) => cause,
UpdateApiKeyError::BadRequest(ref cause) => cause,
UpdateApiKeyError::InternalFailure(ref cause) => cause,
UpdateApiKeyError::LimitExceeded(ref cause) => cause,
UpdateApiKeyError::NotFound(ref cause) => cause,
UpdateApiKeyError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateDataSourceError {
BadRequest(String),
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl UpdateDataSourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateDataSourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateDataSourceError::BadRequest(err.msg))
}
"ConcurrentModificationException" => {
return RusotoError::Service(UpdateDataSourceError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(UpdateDataSourceError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(UpdateDataSourceError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(UpdateDataSourceError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateDataSourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateDataSourceError {
fn description(&self) -> &str {
match *self {
UpdateDataSourceError::BadRequest(ref cause) => cause,
UpdateDataSourceError::ConcurrentModification(ref cause) => cause,
UpdateDataSourceError::InternalFailure(ref cause) => cause,
UpdateDataSourceError::NotFound(ref cause) => cause,
UpdateDataSourceError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateFunctionError {
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl UpdateFunctionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateFunctionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(UpdateFunctionError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(UpdateFunctionError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(UpdateFunctionError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(UpdateFunctionError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateFunctionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateFunctionError {
fn description(&self) -> &str {
match *self {
UpdateFunctionError::ConcurrentModification(ref cause) => cause,
UpdateFunctionError::InternalFailure(ref cause) => cause,
UpdateFunctionError::NotFound(ref cause) => cause,
UpdateFunctionError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateGraphqlApiError {
AccessDenied(String),
BadRequest(String),
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl UpdateGraphqlApiError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateGraphqlApiError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(UpdateGraphqlApiError::AccessDenied(err.msg))
}
"BadRequestException" => {
return RusotoError::Service(UpdateGraphqlApiError::BadRequest(err.msg))
}
"ConcurrentModificationException" => {
return RusotoError::Service(UpdateGraphqlApiError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(UpdateGraphqlApiError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(UpdateGraphqlApiError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(UpdateGraphqlApiError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateGraphqlApiError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateGraphqlApiError {
fn description(&self) -> &str {
match *self {
UpdateGraphqlApiError::AccessDenied(ref cause) => cause,
UpdateGraphqlApiError::BadRequest(ref cause) => cause,
UpdateGraphqlApiError::ConcurrentModification(ref cause) => cause,
UpdateGraphqlApiError::InternalFailure(ref cause) => cause,
UpdateGraphqlApiError::NotFound(ref cause) => cause,
UpdateGraphqlApiError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateResolverError {
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl UpdateResolverError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateResolverError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(UpdateResolverError::ConcurrentModification(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(UpdateResolverError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(UpdateResolverError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(UpdateResolverError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateResolverError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateResolverError {
fn description(&self) -> &str {
match *self {
UpdateResolverError::ConcurrentModification(ref cause) => cause,
UpdateResolverError::InternalFailure(ref cause) => cause,
UpdateResolverError::NotFound(ref cause) => cause,
UpdateResolverError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateTypeError {
BadRequest(String),
ConcurrentModification(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl UpdateTypeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateTypeError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateTypeError::BadRequest(err.msg))
}
"ConcurrentModificationException" => {
return RusotoError::Service(UpdateTypeError::ConcurrentModification(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(UpdateTypeError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(UpdateTypeError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(UpdateTypeError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateTypeError {
fn description(&self) -> &str {
match *self {
UpdateTypeError::BadRequest(ref cause) => cause,
UpdateTypeError::ConcurrentModification(ref cause) => cause,
UpdateTypeError::InternalFailure(ref cause) => cause,
UpdateTypeError::NotFound(ref cause) => cause,
UpdateTypeError::Unauthorized(ref cause) => cause,
}
}
}
pub trait AppSync {
fn create_api_key(
&self,
input: CreateApiKeyRequest,
) -> RusotoFuture<CreateApiKeyResponse, CreateApiKeyError>;
fn create_data_source(
&self,
input: CreateDataSourceRequest,
) -> RusotoFuture<CreateDataSourceResponse, CreateDataSourceError>;
fn create_function(
&self,
input: CreateFunctionRequest,
) -> RusotoFuture<CreateFunctionResponse, CreateFunctionError>;
fn create_graphql_api(
&self,
input: CreateGraphqlApiRequest,
) -> RusotoFuture<CreateGraphqlApiResponse, CreateGraphqlApiError>;
fn create_resolver(
&self,
input: CreateResolverRequest,
) -> RusotoFuture<CreateResolverResponse, CreateResolverError>;
fn create_type(
&self,
input: CreateTypeRequest,
) -> RusotoFuture<CreateTypeResponse, CreateTypeError>;
fn delete_api_key(
&self,
input: DeleteApiKeyRequest,
) -> RusotoFuture<DeleteApiKeyResponse, DeleteApiKeyError>;
fn delete_data_source(
&self,
input: DeleteDataSourceRequest,
) -> RusotoFuture<DeleteDataSourceResponse, DeleteDataSourceError>;
fn delete_function(
&self,
input: DeleteFunctionRequest,
) -> RusotoFuture<DeleteFunctionResponse, DeleteFunctionError>;
fn delete_graphql_api(
&self,
input: DeleteGraphqlApiRequest,
) -> RusotoFuture<DeleteGraphqlApiResponse, DeleteGraphqlApiError>;
fn delete_resolver(
&self,
input: DeleteResolverRequest,
) -> RusotoFuture<DeleteResolverResponse, DeleteResolverError>;
fn delete_type(
&self,
input: DeleteTypeRequest,
) -> RusotoFuture<DeleteTypeResponse, DeleteTypeError>;
fn get_data_source(
&self,
input: GetDataSourceRequest,
) -> RusotoFuture<GetDataSourceResponse, GetDataSourceError>;
fn get_function(
&self,
input: GetFunctionRequest,
) -> RusotoFuture<GetFunctionResponse, GetFunctionError>;
fn get_graphql_api(
&self,
input: GetGraphqlApiRequest,
) -> RusotoFuture<GetGraphqlApiResponse, GetGraphqlApiError>;
fn get_introspection_schema(
&self,
input: GetIntrospectionSchemaRequest,
) -> RusotoFuture<GetIntrospectionSchemaResponse, GetIntrospectionSchemaError>;
fn get_resolver(
&self,
input: GetResolverRequest,
) -> RusotoFuture<GetResolverResponse, GetResolverError>;
fn get_schema_creation_status(
&self,
input: GetSchemaCreationStatusRequest,
) -> RusotoFuture<GetSchemaCreationStatusResponse, GetSchemaCreationStatusError>;
fn get_type(&self, input: GetTypeRequest) -> RusotoFuture<GetTypeResponse, GetTypeError>;
fn list_api_keys(
&self,
input: ListApiKeysRequest,
) -> RusotoFuture<ListApiKeysResponse, ListApiKeysError>;
fn list_data_sources(
&self,
input: ListDataSourcesRequest,
) -> RusotoFuture<ListDataSourcesResponse, ListDataSourcesError>;
fn list_functions(
&self,
input: ListFunctionsRequest,
) -> RusotoFuture<ListFunctionsResponse, ListFunctionsError>;
fn list_graphql_apis(
&self,
input: ListGraphqlApisRequest,
) -> RusotoFuture<ListGraphqlApisResponse, ListGraphqlApisError>;
fn list_resolvers(
&self,
input: ListResolversRequest,
) -> RusotoFuture<ListResolversResponse, ListResolversError>;
fn list_resolvers_by_function(
&self,
input: ListResolversByFunctionRequest,
) -> RusotoFuture<ListResolversByFunctionResponse, ListResolversByFunctionError>;
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError>;
fn list_types(
&self,
input: ListTypesRequest,
) -> RusotoFuture<ListTypesResponse, ListTypesError>;
fn start_schema_creation(
&self,
input: StartSchemaCreationRequest,
) -> RusotoFuture<StartSchemaCreationResponse, StartSchemaCreationError>;
fn tag_resource(
&self,
input: TagResourceRequest,
) -> RusotoFuture<TagResourceResponse, TagResourceError>;
fn untag_resource(
&self,
input: UntagResourceRequest,
) -> RusotoFuture<UntagResourceResponse, UntagResourceError>;
fn update_api_key(
&self,
input: UpdateApiKeyRequest,
) -> RusotoFuture<UpdateApiKeyResponse, UpdateApiKeyError>;
fn update_data_source(
&self,
input: UpdateDataSourceRequest,
) -> RusotoFuture<UpdateDataSourceResponse, UpdateDataSourceError>;
fn update_function(
&self,
input: UpdateFunctionRequest,
) -> RusotoFuture<UpdateFunctionResponse, UpdateFunctionError>;
fn update_graphql_api(
&self,
input: UpdateGraphqlApiRequest,
) -> RusotoFuture<UpdateGraphqlApiResponse, UpdateGraphqlApiError>;
fn update_resolver(
&self,
input: UpdateResolverRequest,
) -> RusotoFuture<UpdateResolverResponse, UpdateResolverError>;
fn update_type(
&self,
input: UpdateTypeRequest,
) -> RusotoFuture<UpdateTypeResponse, UpdateTypeError>;
}
#[derive(Clone)]
pub struct AppSyncClient {
client: Client,
region: region::Region,
}
impl AppSyncClient {
pub fn new(region: region::Region) -> AppSyncClient {
AppSyncClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> AppSyncClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
AppSyncClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl AppSync for AppSyncClient {
fn create_api_key(
&self,
input: CreateApiKeyRequest,
) -> RusotoFuture<CreateApiKeyResponse, CreateApiKeyError> {
let request_uri = format!("/v1/apis/{api_id}/apikeys", api_id = input.api_id);
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateApiKeyResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateApiKeyError::from_response(response))),
)
}
})
}
fn create_data_source(
&self,
input: CreateDataSourceRequest,
) -> RusotoFuture<CreateDataSourceResponse, CreateDataSourceError> {
let request_uri = format!("/v1/apis/{api_id}/datasources", api_id = input.api_id);
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateDataSourceResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateDataSourceError::from_response(response))),
)
}
})
}
fn create_function(
&self,
input: CreateFunctionRequest,
) -> RusotoFuture<CreateFunctionResponse, CreateFunctionError> {
let request_uri = format!("/v1/apis/{api_id}/functions", api_id = input.api_id);
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateFunctionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateFunctionError::from_response(response))),
)
}
})
}
fn create_graphql_api(
&self,
input: CreateGraphqlApiRequest,
) -> RusotoFuture<CreateGraphqlApiResponse, CreateGraphqlApiError> {
let request_uri = "/v1/apis";
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateGraphqlApiResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateGraphqlApiError::from_response(response))),
)
}
})
}
fn create_resolver(
&self,
input: CreateResolverRequest,
) -> RusotoFuture<CreateResolverResponse, CreateResolverError> {
let request_uri = format!(
"/v1/apis/{api_id}/types/{type_name}/resolvers",
api_id = input.api_id,
type_name = input.type_name
);
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateResolverResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateResolverError::from_response(response))),
)
}
})
}
fn create_type(
&self,
input: CreateTypeRequest,
) -> RusotoFuture<CreateTypeResponse, CreateTypeError> {
let request_uri = format!("/v1/apis/{api_id}/types", api_id = input.api_id);
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateTypeResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateTypeError::from_response(response))),
)
}
})
}
fn delete_api_key(
&self,
input: DeleteApiKeyRequest,
) -> RusotoFuture<DeleteApiKeyResponse, DeleteApiKeyError> {
let request_uri = format!(
"/v1/apis/{api_id}/apikeys/{id}",
api_id = input.api_id,
id = input.id
);
let mut request = SignedRequest::new("DELETE", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteApiKeyResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteApiKeyError::from_response(response))),
)
}
})
}
fn delete_data_source(
&self,
input: DeleteDataSourceRequest,
) -> RusotoFuture<DeleteDataSourceResponse, DeleteDataSourceError> {
let request_uri = format!(
"/v1/apis/{api_id}/datasources/{name}",
api_id = input.api_id,
name = input.name
);
let mut request = SignedRequest::new("DELETE", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteDataSourceResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteDataSourceError::from_response(response))),
)
}
})
}
fn delete_function(
&self,
input: DeleteFunctionRequest,
) -> RusotoFuture<DeleteFunctionResponse, DeleteFunctionError> {
let request_uri = format!(
"/v1/apis/{api_id}/functions/{function_id}",
api_id = input.api_id,
function_id = input.function_id
);
let mut request = SignedRequest::new("DELETE", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteFunctionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteFunctionError::from_response(response))),
)
}
})
}
fn delete_graphql_api(
&self,
input: DeleteGraphqlApiRequest,
) -> RusotoFuture<DeleteGraphqlApiResponse, DeleteGraphqlApiError> {
let request_uri = format!("/v1/apis/{api_id}", api_id = input.api_id);
let mut request = SignedRequest::new("DELETE", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteGraphqlApiResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteGraphqlApiError::from_response(response))),
)
}
})
}
fn delete_resolver(
&self,
input: DeleteResolverRequest,
) -> RusotoFuture<DeleteResolverResponse, DeleteResolverError> {
let request_uri = format!(
"/v1/apis/{api_id}/types/{type_name}/resolvers/{field_name}",
api_id = input.api_id,
field_name = input.field_name,
type_name = input.type_name
);
let mut request = SignedRequest::new("DELETE", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteResolverResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteResolverError::from_response(response))),
)
}
})
}
fn delete_type(
&self,
input: DeleteTypeRequest,
) -> RusotoFuture<DeleteTypeResponse, DeleteTypeError> {
let request_uri = format!(
"/v1/apis/{api_id}/types/{type_name}",
api_id = input.api_id,
type_name = input.type_name
);
let mut request = SignedRequest::new("DELETE", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteTypeResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteTypeError::from_response(response))),
)
}
})
}
fn get_data_source(
&self,
input: GetDataSourceRequest,
) -> RusotoFuture<GetDataSourceResponse, GetDataSourceError> {
let request_uri = format!(
"/v1/apis/{api_id}/datasources/{name}",
api_id = input.api_id,
name = input.name
);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetDataSourceResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDataSourceError::from_response(response))),
)
}
})
}
fn get_function(
&self,
input: GetFunctionRequest,
) -> RusotoFuture<GetFunctionResponse, GetFunctionError> {
let request_uri = format!(
"/v1/apis/{api_id}/functions/{function_id}",
api_id = input.api_id,
function_id = input.function_id
);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetFunctionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetFunctionError::from_response(response))),
)
}
})
}
fn get_graphql_api(
&self,
input: GetGraphqlApiRequest,
) -> RusotoFuture<GetGraphqlApiResponse, GetGraphqlApiError> {
let request_uri = format!("/v1/apis/{api_id}", api_id = input.api_id);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetGraphqlApiResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetGraphqlApiError::from_response(response))),
)
}
})
}
fn get_introspection_schema(
&self,
input: GetIntrospectionSchemaRequest,
) -> RusotoFuture<GetIntrospectionSchemaResponse, GetIntrospectionSchemaError> {
let request_uri = format!("/v1/apis/{api_id}/schema", api_id = input.api_id);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
params.put("format", &input.format);
if let Some(ref x) = input.include_directives {
params.put("includeDirectives", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let mut result = GetIntrospectionSchemaResponse::default();
result.schema = Some(response.body);
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetIntrospectionSchemaError::from_response(response))
}),
)
}
})
}
fn get_resolver(
&self,
input: GetResolverRequest,
) -> RusotoFuture<GetResolverResponse, GetResolverError> {
let request_uri = format!(
"/v1/apis/{api_id}/types/{type_name}/resolvers/{field_name}",
api_id = input.api_id,
field_name = input.field_name,
type_name = input.type_name
);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetResolverResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetResolverError::from_response(response))),
)
}
})
}
fn get_schema_creation_status(
&self,
input: GetSchemaCreationStatusRequest,
) -> RusotoFuture<GetSchemaCreationStatusResponse, GetSchemaCreationStatusError> {
let request_uri = format!("/v1/apis/{api_id}/schemacreation", api_id = input.api_id);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetSchemaCreationStatusResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetSchemaCreationStatusError::from_response(response))
}))
}
})
}
fn get_type(&self, input: GetTypeRequest) -> RusotoFuture<GetTypeResponse, GetTypeError> {
let request_uri = format!(
"/v1/apis/{api_id}/types/{type_name}",
api_id = input.api_id,
type_name = input.type_name
);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
params.put("format", &input.format);
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetTypeResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetTypeError::from_response(response))),
)
}
})
}
fn list_api_keys(
&self,
input: ListApiKeysRequest,
) -> RusotoFuture<ListApiKeysResponse, ListApiKeysError> {
let request_uri = format!("/v1/apis/{api_id}/apikeys", api_id = input.api_id);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListApiKeysResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListApiKeysError::from_response(response))),
)
}
})
}
fn list_data_sources(
&self,
input: ListDataSourcesRequest,
) -> RusotoFuture<ListDataSourcesResponse, ListDataSourcesError> {
let request_uri = format!("/v1/apis/{api_id}/datasources", api_id = input.api_id);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListDataSourcesResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListDataSourcesError::from_response(response))),
)
}
})
}
fn list_functions(
&self,
input: ListFunctionsRequest,
) -> RusotoFuture<ListFunctionsResponse, ListFunctionsError> {
let request_uri = format!("/v1/apis/{api_id}/functions", api_id = input.api_id);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListFunctionsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListFunctionsError::from_response(response))),
)
}
})
}
fn list_graphql_apis(
&self,
input: ListGraphqlApisRequest,
) -> RusotoFuture<ListGraphqlApisResponse, ListGraphqlApisError> {
let request_uri = "/v1/apis";
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListGraphqlApisResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListGraphqlApisError::from_response(response))),
)
}
})
}
fn list_resolvers(
&self,
input: ListResolversRequest,
) -> RusotoFuture<ListResolversResponse, ListResolversError> {
let request_uri = format!(
"/v1/apis/{api_id}/types/{type_name}/resolvers",
api_id = input.api_id,
type_name = input.type_name
);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListResolversResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListResolversError::from_response(response))),
)
}
})
}
fn list_resolvers_by_function(
&self,
input: ListResolversByFunctionRequest,
) -> RusotoFuture<ListResolversByFunctionResponse, ListResolversByFunctionError> {
let request_uri = format!(
"/v1/apis/{api_id}/functions/{function_id}/resolvers",
api_id = input.api_id,
function_id = input.function_id
);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListResolversByFunctionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListResolversByFunctionError::from_response(response))
}))
}
})
}
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError> {
let request_uri = format!("/v1/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForResourceResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListTagsForResourceError::from_response(response))
}),
)
}
})
}
fn list_types(
&self,
input: ListTypesRequest,
) -> RusotoFuture<ListTypesResponse, ListTypesError> {
let request_uri = format!("/v1/apis/{api_id}/types", api_id = input.api_id);
let mut request = SignedRequest::new("GET", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
params.put("format", &input.format);
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListTypesResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListTypesError::from_response(response))),
)
}
})
}
fn start_schema_creation(
&self,
input: StartSchemaCreationRequest,
) -> RusotoFuture<StartSchemaCreationResponse, StartSchemaCreationError> {
let request_uri = format!("/v1/apis/{api_id}/schemacreation", api_id = input.api_id);
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<StartSchemaCreationResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(StartSchemaCreationError::from_response(response))
}),
)
}
})
}
fn tag_resource(
&self,
input: TagResourceRequest,
) -> RusotoFuture<TagResourceResponse, TagResourceError> {
let request_uri = format!("/v1/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<TagResourceResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagResourceError::from_response(response))),
)
}
})
}
fn untag_resource(
&self,
input: UntagResourceRequest,
) -> RusotoFuture<UntagResourceResponse, UntagResourceError> {
let request_uri = format!("/v1/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("DELETE", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
for item in input.tag_keys.iter() {
params.put("tagKeys", item);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UntagResourceResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagResourceError::from_response(response))),
)
}
})
}
fn update_api_key(
&self,
input: UpdateApiKeyRequest,
) -> RusotoFuture<UpdateApiKeyResponse, UpdateApiKeyError> {
let request_uri = format!(
"/v1/apis/{api_id}/apikeys/{id}",
api_id = input.api_id,
id = input.id
);
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateApiKeyResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateApiKeyError::from_response(response))),
)
}
})
}
fn update_data_source(
&self,
input: UpdateDataSourceRequest,
) -> RusotoFuture<UpdateDataSourceResponse, UpdateDataSourceError> {
let request_uri = format!(
"/v1/apis/{api_id}/datasources/{name}",
api_id = input.api_id,
name = input.name
);
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateDataSourceResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateDataSourceError::from_response(response))),
)
}
})
}
fn update_function(
&self,
input: UpdateFunctionRequest,
) -> RusotoFuture<UpdateFunctionResponse, UpdateFunctionError> {
let request_uri = format!(
"/v1/apis/{api_id}/functions/{function_id}",
api_id = input.api_id,
function_id = input.function_id
);
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateFunctionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateFunctionError::from_response(response))),
)
}
})
}
fn update_graphql_api(
&self,
input: UpdateGraphqlApiRequest,
) -> RusotoFuture<UpdateGraphqlApiResponse, UpdateGraphqlApiError> {
let request_uri = format!("/v1/apis/{api_id}", api_id = input.api_id);
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateGraphqlApiResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateGraphqlApiError::from_response(response))),
)
}
})
}
fn update_resolver(
&self,
input: UpdateResolverRequest,
) -> RusotoFuture<UpdateResolverResponse, UpdateResolverError> {
let request_uri = format!(
"/v1/apis/{api_id}/types/{type_name}/resolvers/{field_name}",
api_id = input.api_id,
field_name = input.field_name,
type_name = input.type_name
);
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateResolverResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateResolverError::from_response(response))),
)
}
})
}
fn update_type(
&self,
input: UpdateTypeRequest,
) -> RusotoFuture<UpdateTypeResponse, UpdateTypeError> {
let request_uri = format!(
"/v1/apis/{api_id}/types/{type_name}",
api_id = input.api_id,
type_name = input.type_name
);
let mut request = SignedRequest::new("POST", "appsync", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateTypeResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateTypeError::from_response(response))),
)
}
})
}
}