def batch_associate_user_stack(
self,
*,
config_overrides: Optional[AppStreamClientConfig] = None,
user_stack_associations: Optional[
"capo_appstream.types.user_stack_association_list.UserStackAssociationList"
] = None,
) -> "capo_appstream.types.batch_associate_user_stack_result.BatchAssociateUserStackResult":
"""<p>Associates the specified users with the specified stacks. Users in a user pool cannot be assigned to stacks with fleets that are joined to an Active Directory domain.</p>
Args:
user_stack_associations: <p>The list of UserStackAssociation objects.</p>
Raises:
capo_appstream.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Indicates an incorrect combination of parameters, or a missing parameter.</p>
capo_appstream.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>The attempted operation is not permitted.</p>
capo_appstream.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_appstream.types.batch_associate_user_stack_request.BatchAssociateUserStackRequest]",
) -> OperationResponse[
"capo_appstream.types.batch_associate_user_stack_result.BatchAssociateUserStackResult"
]:
import capo_appstream._operations.photon_admin_proxy_service.batch_associate_user_stack
output, http_response = (
capo_appstream._operations.photon_admin_proxy_service.batch_associate_user_stack.batch_associate_user_stack(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_appstream.types.batch_associate_user_stack_request.BatchAssociateUserStackRequest",
) -> dict[str, Any]:
import capo_appstream.types.batch_associate_user_stack_request
return capo_appstream.types.batch_associate_user_stack_request.redact_sensitive(
input_
)
def _redact_output(
output: "capo_appstream.types.batch_associate_user_stack_result.BatchAssociateUserStackResult",
) -> dict[str, Any]:
import capo_appstream.types.batch_associate_user_stack_result
return (
capo_appstream.types.batch_associate_user_stack_result.redact_sensitive(
output
)
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging(
"BatchAssociateUserStack",
redact_input=_redact_input,
redact_output=_redact_output,
),
)
input_: capo_appstream.types.batch_associate_user_stack_request.BatchAssociateUserStackRequest = {}
if user_stack_associations is not None:
input_["user_stack_associations"] = user_stack_associations
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output