Skip to content

create_social_connection_authorization_url

create_social_connection_authorization_url(
    catalog: Catalog,
    platform: Platform,
    *,
    config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
) -> CreateSocialConnectionAuthorizationUrlResponse

Creates a single-use URL the partner visits to authorize publishing on a platform. Serves a first connect, connecting a further account, and re-authorizing an expired one: consenting with an account that is already connected re-authorizes that connection and keeps its id; any other account adds a connection. Poll ListSocialConnections for the outcome. Deliberately not idempotent and takes no client token: every call must mint a fresh single-use URL, so replaying a cached response would hand back a dead one.

Parameters:

  • catalog (Catalog) –

    Catalog the connection belongs to.

  • platform (Platform) –

    Social platform to authorize.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action. An IAM denial carries no Reason. A refusal for the caller's Partner Central state carries one, so a client tells the two apart by its presence.

  • InternalServerException –

    An unexpected error occurred during the processing of the request.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy the constraints specified by the service. A caller branches on Reason, and where the rejection is attributable to particular fields it reads FieldList rather than parsing Message, which is prose and may change.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_partnercentral_marketing/_services/partner_central_marketing.py
def create_social_connection_authorization_url(
    self,
    catalog: "capo_partnercentral_marketing.types.catalog.Catalog",
    platform: "capo_partnercentral_marketing.types.platform.Platform",
    *,
    config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
) -> "capo_partnercentral_marketing.types.create_social_connection_authorization_url_response.CreateSocialConnectionAuthorizationUrlResponse":
    """Creates a single-use URL the partner visits to authorize publishing on a platform. Serves a first connect, connecting a further account, and re-authorizing an expired one: consenting with an account that is already connected re-authorizes that connection and keeps its id; any other account adds a connection. Poll ListSocialConnections for the outcome. Deliberately not idempotent and takes no client token: every call must mint a fresh single-use URL, so replaying a cached response would hand back a dead one.

    Args:
        catalog: Catalog the connection belongs to.
        platform: Social platform to authorize.

    Raises:
        capo_partnercentral_marketing.errors.access_denied_exception.AccessDeniedException: You do not have sufficient access to perform this action. An IAM denial carries no `Reason`. A refusal for the caller's Partner Central state carries one, so a client tells the two apart by its presence.
        capo_partnercentral_marketing.errors.internal_server_exception.InternalServerException: An unexpected error occurred during the processing of the request.
        capo_partnercentral_marketing.errors.throttling_exception.ThrottlingException: The request was denied due to request throttling.
        capo_partnercentral_marketing.errors.validation_exception.ValidationException: The input fails to satisfy the constraints specified by the service. A caller branches on `Reason`, and where the rejection is attributable to particular fields it reads `FieldList` rather than parsing `Message`, which is prose and may change.
        capo_partnercentral_marketing.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_partnercentral_marketing.types.create_social_connection_authorization_url_request.CreateSocialConnectionAuthorizationUrlRequest]",
    ) -> OperationResponse[
        "capo_partnercentral_marketing.types.create_social_connection_authorization_url_response.CreateSocialConnectionAuthorizationUrlResponse"
    ]:
        import capo_partnercentral_marketing._operations.aws_partner_demand_generator.create_social_connection_authorization_url

        output, http_response = (
            capo_partnercentral_marketing._operations.aws_partner_demand_generator.create_social_connection_authorization_url.create_social_connection_authorization_url(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_partnercentral_marketing.types.create_social_connection_authorization_url_response.CreateSocialConnectionAuthorizationUrlResponse",
    ) -> dict[str, Any]:
        import capo_partnercentral_marketing.types.create_social_connection_authorization_url_response

        return capo_partnercentral_marketing.types.create_social_connection_authorization_url_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateSocialConnectionAuthorizationUrl", redact_output=_redact_output
        ),
    )
    input_: capo_partnercentral_marketing.types.create_social_connection_authorization_url_request.CreateSocialConnectionAuthorizationUrlRequest = {
        "catalog": catalog,
        "platform": platform,
    }

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