AWS AppSync

2021/02/12 - AWS AppSync - 4 updated api methods

Changes  Update appsync client to latest version

CreateFunction (updated) Link ¶
Changes (request, response)
Request
{'syncConfig': {'conflictDetection': 'VERSION | NONE',
                'conflictHandler': 'OPTIMISTIC_CONCURRENCY | LAMBDA | '
                                   'AUTOMERGE | NONE',
                'lambdaConflictHandlerConfig': {'lambdaConflictHandlerArn': 'string'}}}
Response
{'functionConfiguration': {'syncConfig': {'conflictDetection': 'VERSION | NONE',
                                          'conflictHandler': 'OPTIMISTIC_CONCURRENCY '
                                                             '| LAMBDA | '
                                                             'AUTOMERGE | NONE',
                                          'lambdaConflictHandlerConfig': {'lambdaConflictHandlerArn': 'string'}}}}

Creates a Function object.

A function is a reusable entity. Multiple functions can be used to compose the resolver logic.

See also: AWS API Documentation

Request Syntax

client.create_function(
    apiId='string',
    name='string',
    description='string',
    dataSourceName='string',
    requestMappingTemplate='string',
    responseMappingTemplate='string',
    functionVersion='string',
    syncConfig={
        'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
        'conflictDetection': 'VERSION'|'NONE',
        'lambdaConflictHandlerConfig': {
            'lambdaConflictHandlerArn': 'string'
        }
    }
)
type apiId:

string

param apiId:

[REQUIRED]

The GraphQL API ID.

type name:

string

param name:

[REQUIRED]

The Function name. The function name does not have to be unique.

type description:

string

param description:

The Function description.

type dataSourceName:

string

param dataSourceName:

[REQUIRED]

The Function DataSource name.

type requestMappingTemplate:

string

param requestMappingTemplate:

The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

type responseMappingTemplate:

string

param responseMappingTemplate:

The Function response mapping template.

type functionVersion:

string

param functionVersion:

[REQUIRED]

The version of the request mapping template. Currently the supported value is 2018-05-29.

type syncConfig:

dict

param syncConfig:

Describes a Sync configuration for a resolver.

Contains information on which Conflict Detection as well as Resolution strategy should be performed when the resolver is invoked.

  • conflictHandler (string) --

    The Conflict Resolution strategy to perform in the event of a conflict.

    • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions do not match the latest version at the server.

    • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

    • LAMBDA: Resolve conflicts with a Lambda function supplied in the LambdaConflictHandlerConfig.

  • conflictDetection (string) --

    The Conflict Detection strategy to use.

    • VERSION: Detect conflicts based on object versions for this resolver.

    • NONE: Do not detect conflicts when executing this resolver.

  • lambdaConflictHandlerConfig (dict) --

    The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

    • lambdaConflictHandlerArn (string) --

      The Arn for the Lambda function to use as the Conflict Handler.

rtype:

dict

returns:

Response Syntax

{
    'functionConfiguration': {
        'functionId': 'string',
        'functionArn': 'string',
        'name': 'string',
        'description': 'string',
        'dataSourceName': 'string',
        'requestMappingTemplate': 'string',
        'responseMappingTemplate': 'string',
        'functionVersion': 'string',
        'syncConfig': {
            'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
            'conflictDetection': 'VERSION'|'NONE',
            'lambdaConflictHandlerConfig': {
                'lambdaConflictHandlerArn': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    • functionConfiguration (dict) --

      The Function object.

      • functionId (string) --

        A unique ID representing the Function object.

      • functionArn (string) --

        The ARN of the Function object.

      • name (string) --

        The name of the Function object.

      • description (string) --

        The Function description.

      • dataSourceName (string) --

        The name of the DataSource.

      • requestMappingTemplate (string) --

        The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

      • responseMappingTemplate (string) --

        The Function response mapping template.

      • functionVersion (string) --

        The version of the request mapping template. Currently only the 2018-05-29 version of the template is supported.

      • syncConfig (dict) --

        Describes a Sync configuration for a resolver.

        Contains information on which Conflict Detection as well as Resolution strategy should be performed when the resolver is invoked.

        • conflictHandler (string) --

          The Conflict Resolution strategy to perform in the event of a conflict.

          • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions do not match the latest version at the server.

          • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

          • LAMBDA: Resolve conflicts with a Lambda function supplied in the LambdaConflictHandlerConfig.

        • conflictDetection (string) --

          The Conflict Detection strategy to use.

          • VERSION: Detect conflicts based on object versions for this resolver.

          • NONE: Do not detect conflicts when executing this resolver.

        • lambdaConflictHandlerConfig (dict) --

          The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

          • lambdaConflictHandlerArn (string) --

            The Arn for the Lambda function to use as the Conflict Handler.

GetFunction (updated) Link ¶
Changes (response)
{'functionConfiguration': {'syncConfig': {'conflictDetection': 'VERSION | NONE',
                                          'conflictHandler': 'OPTIMISTIC_CONCURRENCY '
                                                             '| LAMBDA | '
                                                             'AUTOMERGE | NONE',
                                          'lambdaConflictHandlerConfig': {'lambdaConflictHandlerArn': 'string'}}}}

Get a Function.

See also: AWS API Documentation

Request Syntax

client.get_function(
    apiId='string',
    functionId='string'
)
type apiId:

string

param apiId:

[REQUIRED]

The GraphQL API ID.

type functionId:

string

param functionId:

[REQUIRED]

The Function ID.

rtype:

dict

returns:

Response Syntax

{
    'functionConfiguration': {
        'functionId': 'string',
        'functionArn': 'string',
        'name': 'string',
        'description': 'string',
        'dataSourceName': 'string',
        'requestMappingTemplate': 'string',
        'responseMappingTemplate': 'string',
        'functionVersion': 'string',
        'syncConfig': {
            'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
            'conflictDetection': 'VERSION'|'NONE',
            'lambdaConflictHandlerConfig': {
                'lambdaConflictHandlerArn': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    • functionConfiguration (dict) --

      The Function object.

      • functionId (string) --

        A unique ID representing the Function object.

      • functionArn (string) --

        The ARN of the Function object.

      • name (string) --

        The name of the Function object.

      • description (string) --

        The Function description.

      • dataSourceName (string) --

        The name of the DataSource.

      • requestMappingTemplate (string) --

        The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

      • responseMappingTemplate (string) --

        The Function response mapping template.

      • functionVersion (string) --

        The version of the request mapping template. Currently only the 2018-05-29 version of the template is supported.

      • syncConfig (dict) --

        Describes a Sync configuration for a resolver.

        Contains information on which Conflict Detection as well as Resolution strategy should be performed when the resolver is invoked.

        • conflictHandler (string) --

          The Conflict Resolution strategy to perform in the event of a conflict.

          • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions do not match the latest version at the server.

          • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

          • LAMBDA: Resolve conflicts with a Lambda function supplied in the LambdaConflictHandlerConfig.

        • conflictDetection (string) --

          The Conflict Detection strategy to use.

          • VERSION: Detect conflicts based on object versions for this resolver.

          • NONE: Do not detect conflicts when executing this resolver.

        • lambdaConflictHandlerConfig (dict) --

          The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

          • lambdaConflictHandlerArn (string) --

            The Arn for the Lambda function to use as the Conflict Handler.

ListFunctions (updated) Link ¶
Changes (response)
{'functions': {'syncConfig': {'conflictDetection': 'VERSION | NONE',
                              'conflictHandler': 'OPTIMISTIC_CONCURRENCY | '
                                                 'LAMBDA | AUTOMERGE | NONE',
                              'lambdaConflictHandlerConfig': {'lambdaConflictHandlerArn': 'string'}}}}

List multiple functions.

See also: AWS API Documentation

Request Syntax

client.list_functions(
    apiId='string',
    nextToken='string',
    maxResults=123
)
type apiId:

string

param apiId:

[REQUIRED]

The GraphQL API ID.

type nextToken:

string

param nextToken:

An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

type maxResults:

integer

param maxResults:

The maximum number of results you want the request to return.

rtype:

dict

returns:

Response Syntax

{
    'functions': [
        {
            'functionId': 'string',
            'functionArn': 'string',
            'name': 'string',
            'description': 'string',
            'dataSourceName': 'string',
            'requestMappingTemplate': 'string',
            'responseMappingTemplate': 'string',
            'functionVersion': 'string',
            'syncConfig': {
                'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
                'conflictDetection': 'VERSION'|'NONE',
                'lambdaConflictHandlerConfig': {
                    'lambdaConflictHandlerArn': 'string'
                }
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • functions (list) --

      A list of Function objects.

      • (dict) --

        A function is a reusable entity. Multiple functions can be used to compose the resolver logic.

        • functionId (string) --

          A unique ID representing the Function object.

        • functionArn (string) --

          The ARN of the Function object.

        • name (string) --

          The name of the Function object.

        • description (string) --

          The Function description.

        • dataSourceName (string) --

          The name of the DataSource.

        • requestMappingTemplate (string) --

          The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

        • responseMappingTemplate (string) --

          The Function response mapping template.

        • functionVersion (string) --

          The version of the request mapping template. Currently only the 2018-05-29 version of the template is supported.

        • syncConfig (dict) --

          Describes a Sync configuration for a resolver.

          Contains information on which Conflict Detection as well as Resolution strategy should be performed when the resolver is invoked.

          • conflictHandler (string) --

            The Conflict Resolution strategy to perform in the event of a conflict.

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions do not match the latest version at the server.

            • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

            • LAMBDA: Resolve conflicts with a Lambda function supplied in the LambdaConflictHandlerConfig.

          • conflictDetection (string) --

            The Conflict Detection strategy to use.

            • VERSION: Detect conflicts based on object versions for this resolver.

            • NONE: Do not detect conflicts when executing this resolver.

          • lambdaConflictHandlerConfig (dict) --

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn (string) --

              The Arn for the Lambda function to use as the Conflict Handler.

    • nextToken (string) --

      An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

UpdateFunction (updated) Link ¶
Changes (request, response)
Request
{'syncConfig': {'conflictDetection': 'VERSION | NONE',
                'conflictHandler': 'OPTIMISTIC_CONCURRENCY | LAMBDA | '
                                   'AUTOMERGE | NONE',
                'lambdaConflictHandlerConfig': {'lambdaConflictHandlerArn': 'string'}}}
Response
{'functionConfiguration': {'syncConfig': {'conflictDetection': 'VERSION | NONE',
                                          'conflictHandler': 'OPTIMISTIC_CONCURRENCY '
                                                             '| LAMBDA | '
                                                             'AUTOMERGE | NONE',
                                          'lambdaConflictHandlerConfig': {'lambdaConflictHandlerArn': 'string'}}}}

Updates a Function object.

See also: AWS API Documentation

Request Syntax

client.update_function(
    apiId='string',
    name='string',
    description='string',
    functionId='string',
    dataSourceName='string',
    requestMappingTemplate='string',
    responseMappingTemplate='string',
    functionVersion='string',
    syncConfig={
        'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
        'conflictDetection': 'VERSION'|'NONE',
        'lambdaConflictHandlerConfig': {
            'lambdaConflictHandlerArn': 'string'
        }
    }
)
type apiId:

string

param apiId:

[REQUIRED]

The GraphQL API ID.

type name:

string

param name:

[REQUIRED]

The Function name.

type description:

string

param description:

The Function description.

type functionId:

string

param functionId:

[REQUIRED]

The function ID.

type dataSourceName:

string

param dataSourceName:

[REQUIRED]

The Function DataSource name.

type requestMappingTemplate:

string

param requestMappingTemplate:

The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

type responseMappingTemplate:

string

param responseMappingTemplate:

The Function request mapping template.

type functionVersion:

string

param functionVersion:

[REQUIRED]

The version of the request mapping template. Currently the supported value is 2018-05-29.

type syncConfig:

dict

param syncConfig:

Describes a Sync configuration for a resolver.

Contains information on which Conflict Detection as well as Resolution strategy should be performed when the resolver is invoked.

  • conflictHandler (string) --

    The Conflict Resolution strategy to perform in the event of a conflict.

    • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions do not match the latest version at the server.

    • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

    • LAMBDA: Resolve conflicts with a Lambda function supplied in the LambdaConflictHandlerConfig.

  • conflictDetection (string) --

    The Conflict Detection strategy to use.

    • VERSION: Detect conflicts based on object versions for this resolver.

    • NONE: Do not detect conflicts when executing this resolver.

  • lambdaConflictHandlerConfig (dict) --

    The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

    • lambdaConflictHandlerArn (string) --

      The Arn for the Lambda function to use as the Conflict Handler.

rtype:

dict

returns:

Response Syntax

{
    'functionConfiguration': {
        'functionId': 'string',
        'functionArn': 'string',
        'name': 'string',
        'description': 'string',
        'dataSourceName': 'string',
        'requestMappingTemplate': 'string',
        'responseMappingTemplate': 'string',
        'functionVersion': 'string',
        'syncConfig': {
            'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
            'conflictDetection': 'VERSION'|'NONE',
            'lambdaConflictHandlerConfig': {
                'lambdaConflictHandlerArn': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    • functionConfiguration (dict) --

      The Function object.

      • functionId (string) --

        A unique ID representing the Function object.

      • functionArn (string) --

        The ARN of the Function object.

      • name (string) --

        The name of the Function object.

      • description (string) --

        The Function description.

      • dataSourceName (string) --

        The name of the DataSource.

      • requestMappingTemplate (string) --

        The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

      • responseMappingTemplate (string) --

        The Function response mapping template.

      • functionVersion (string) --

        The version of the request mapping template. Currently only the 2018-05-29 version of the template is supported.

      • syncConfig (dict) --

        Describes a Sync configuration for a resolver.

        Contains information on which Conflict Detection as well as Resolution strategy should be performed when the resolver is invoked.

        • conflictHandler (string) --

          The Conflict Resolution strategy to perform in the event of a conflict.

          • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions do not match the latest version at the server.

          • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

          • LAMBDA: Resolve conflicts with a Lambda function supplied in the LambdaConflictHandlerConfig.

        • conflictDetection (string) --

          The Conflict Detection strategy to use.

          • VERSION: Detect conflicts based on object versions for this resolver.

          • NONE: Do not detect conflicts when executing this resolver.

        • lambdaConflictHandlerConfig (dict) --

          The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

          • lambdaConflictHandlerArn (string) --

            The Arn for the Lambda function to use as the Conflict Handler.