Skip to content

create_entitlement

create_entitlement(
    *,
    config_overrides: Optional[AppStreamClientConfig] = None,
    name: Optional[Name] = None,
    stack_name: Optional[Name] = None,
    description: Optional[Description] = None,
    app_visibility: Optional[AppVisibility] = None,
    attributes: Optional[EntitlementAttributeList] = None,
) -> CreateEntitlementResult

Creates a new entitlement. Entitlements control access to specific applications within a stack, based on user attributes. Entitlements apply to SAML 2.0 federated user identities. WorkSpaces Applications user pool and streaming URL users are entitled to all applications in a stack. Entitlements don't apply to the desktop stream view application, or to applications managed by a dynamic app provider using the Dynamic Application Framework.

Parameters:

  • name (Optional[Name], default: None ) –

    The name of the entitlement.

  • stack_name (Optional[Name], default: None ) –

    The name of the stack with which the entitlement is associated.

  • description (Optional[Description], default: None ) –

    The description of the entitlement.

  • app_visibility (Optional[AppVisibility], default: None ) –

    Specifies whether all or selected apps are entitled.

  • attributes (Optional[EntitlementAttributeList], default: None ) –

    The attributes of the entitlement.

Raises:

Source code in docs_src/capo_appstream/_services/app_stream.py
def create_entitlement(
    self,
    *,
    config_overrides: Optional[AppStreamClientConfig] = None,
    name: Optional["capo_appstream.types.name.Name"] = None,
    stack_name: Optional["capo_appstream.types.name.Name"] = None,
    description: Optional["capo_appstream.types.description.Description"] = None,
    app_visibility: Optional[
        "capo_appstream.types.app_visibility.AppVisibility"
    ] = None,
    attributes: Optional[
        "capo_appstream.types.entitlement_attribute_list.EntitlementAttributeList"
    ] = None,
) -> "capo_appstream.types.create_entitlement_result.CreateEntitlementResult":
    """<p>Creates a new entitlement. Entitlements control access to specific applications within a stack, based on user attributes. Entitlements apply to SAML 2.0 federated user identities. WorkSpaces Applications user pool and streaming URL users are entitled to all applications in a stack. Entitlements don't apply to the desktop stream view application, or to applications managed by a dynamic app provider using the Dynamic Application Framework.</p>

    Args:
        name: <p>The name of the entitlement.</p>
        stack_name: <p>The name of the stack with which the entitlement is associated.</p>
        description: <p>The description of the entitlement.</p>
        app_visibility: <p>Specifies whether all or selected apps are entitled.</p>
        attributes: <p>The attributes of the entitlement.</p>

    Raises:
        capo_appstream.errors.entitlement_already_exists_exception.EntitlementAlreadyExistsException: <p>The entitlement already exists.</p>
        capo_appstream.errors.limit_exceeded_exception.LimitExceededException: <p>The requested limit exceeds the permitted limit for an account.</p>
        capo_appstream.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>The attempted operation is not permitted.</p>
        capo_appstream.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_appstream.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_appstream.types.create_entitlement_request.CreateEntitlementRequest]",
    ) -> OperationResponse[
        "capo_appstream.types.create_entitlement_result.CreateEntitlementResult"
    ]:
        import capo_appstream._operations.photon_admin_proxy_service.create_entitlement

        output, http_response = (
            capo_appstream._operations.photon_admin_proxy_service.create_entitlement.create_entitlement(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateEntitlement")
    )
    input_: capo_appstream.types.create_entitlement_request.CreateEntitlementRequest = {}
    if name is not None:
        input_["name"] = name
    if stack_name is not None:
        input_["stack_name"] = stack_name
    if description is not None:
        input_["description"] = description
    if app_visibility is not None:
        input_["app_visibility"] = app_visibility
    if attributes is not None:
        input_["attributes"] = attributes

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