Skip to content

create_app_authorization

create_app_authorization(
    app_bundle_identifier: Identifier,
    app: String255,
    credential: Credential,
    tenant: Tenant,
    auth_type: AuthType,
    *,
    config_overrides: Optional[AppFabricClientConfig] = None,
    client_token: Optional[UUID] = None,
    tags: Optional[TagList] = None,
) -> CreateAppAuthorizationResponse

Creates an app authorization within an app bundle, which allows AppFabric to connect to an application.

Parameters:

  • app_bundle_identifier (Identifier) –

    The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.

  • app (String255) –

    The name of the application.

    Valid values are:

    • SLACK

    • ASANA

    • JIRA

    • M365

    • M365AUDITLOGS

    • ZOOM

    • ZENDESK

    • OKTA

    • GOOGLE

    • DROPBOX

    • SMARTSHEET

    • CISCO

  • credential (Credential) –

    Contains credentials for the application, such as an API key or OAuth2 client ID and secret.

    Specify credentials that match the authorization type for your request. For example, if the authorization type for your request is OAuth2 (oauth2), then you should provide only the OAuth2 credentials.

  • tenant (Tenant) –

    Contains information about an application tenant, such as the application display name and identifier.

  • auth_type (AuthType) –

    The authorization type for the app authorization.

  • client_token (Optional[UUID], default: None ) –

    Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value.

    If you don't provide this value, then Amazon Web Services generates a random one for you.

    If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an IdempotentParameterMismatch error.

  • tags (Optional[TagList], default: None ) –

    A map of the key-value pairs of the tag or tags to assign to the resource.

Raises:

Source code in docs_src/capo_appfabric/_services/app_fabric.py
def create_app_authorization(
    self,
    app_bundle_identifier: "capo_appfabric.types.identifier.Identifier",
    app: "capo_appfabric.types.string255.String255",
    credential: "capo_appfabric.types.credential.Credential",
    tenant: "capo_appfabric.types.tenant.Tenant",
    auth_type: "capo_appfabric.types.auth_type.AuthType",
    *,
    config_overrides: Optional[AppFabricClientConfig] = None,
    client_token: Optional["capo_appfabric.types.uuid.UUID"] = None,
    tags: Optional["capo_appfabric.types.tag_list.TagList"] = None,
) -> "capo_appfabric.types.create_app_authorization_response.CreateAppAuthorizationResponse":
    """<p>Creates an app authorization within an app bundle, which allows AppFabric to connect to an application.</p>

    Args:
        app_bundle_identifier: <p>The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the app bundle to use for the request.</p>
        app: <p>The name of the application.</p> <p>Valid values are:</p> <ul> <li> <p> <code>SLACK</code> </p> </li> <li> <p> <code>ASANA</code> </p> </li> <li> <p> <code>JIRA</code> </p> </li> <li> <p> <code>M365</code> </p> </li> <li> <p> <code>M365AUDITLOGS</code> </p> </li> <li> <p> <code>ZOOM</code> </p> </li> <li> <p> <code>ZENDESK</code> </p> </li> <li> <p> <code>OKTA</code> </p> </li> <li> <p> <code>GOOGLE</code> </p> </li> <li> <p> <code>DROPBOX</code> </p> </li> <li> <p> <code>SMARTSHEET</code> </p> </li> <li> <p> <code>CISCO</code> </p> </li> </ul>
        credential: <p>Contains credentials for the application, such as an API key or OAuth2 client ID and secret.</p> <p>Specify credentials that match the authorization type for your request. For example, if the authorization type for your request is OAuth2 (<code>oauth2</code>), then you should provide only the OAuth2 credentials.</p>
        tenant: <p>Contains information about an application tenant, such as the application display name and identifier.</p>
        auth_type: <p>The authorization type for the app authorization.</p>
        client_token: <p>Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value</a>.</p> <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p> <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
        tags: <p>A map of the key-value pairs of the tag or tags to assign to the resource.</p>

    Raises:
        capo_appfabric.errors.access_denied_exception.AccessDeniedException: <p>You are not authorized to perform this operation.</p>
        capo_appfabric.errors.conflict_exception.ConflictException: <p>The request has created a conflict. Check the request parameters and try again.</p>
        capo_appfabric.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure with an internal server.</p>
        capo_appfabric.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_appfabric.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeds a service quota.</p>
        capo_appfabric.errors.throttling_exception.ThrottlingException: <p>The request rate exceeds the limit.</p>
        capo_appfabric.errors.validation_exception.ValidationException: <p>The request has invalid or missing parameters.</p>
        capo_appfabric.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_appfabric.types.create_app_authorization_request.CreateAppAuthorizationRequest]",
    ) -> OperationResponse[
        "capo_appfabric.types.create_app_authorization_response.CreateAppAuthorizationResponse"
    ]:
        import capo_appfabric._operations.fabric_front_end_service.create_app_authorization

        output, http_response = (
            capo_appfabric._operations.fabric_front_end_service.create_app_authorization.create_app_authorization(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_appfabric.types.create_app_authorization_request.CreateAppAuthorizationRequest",
    ) -> dict[str, Any]:
        import capo_appfabric.types.create_app_authorization_request

        return (
            capo_appfabric.types.create_app_authorization_request.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateAppAuthorization", redact_input=_redact_input),
    )
    input_: capo_appfabric.types.create_app_authorization_request.CreateAppAuthorizationRequest = {
        "app_bundle_identifier": app_bundle_identifier,
        "app": app,
        "credential": credential,
        "tenant": tenant,
        "auth_type": auth_type,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output