createEntitlement method
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.
May throw EntitlementAlreadyExistsException.
May throw LimitExceededException.
May throw OperationNotPermittedException.
May throw ResourceNotFoundException.
Parameter appVisibility :
Specifies whether all or selected apps are entitled.
Parameter attributes :
The attributes of the entitlement.
Parameter name :
The name of the entitlement.
Parameter stackName :
The name of the stack with which the entitlement is associated.
Parameter description :
The description of the entitlement.
Implementation
Future<CreateEntitlementResult> createEntitlement({
required AppVisibility appVisibility,
required List<EntitlementAttribute> attributes,
required String name,
required String stackName,
String? description,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'PhotonAdminProxyService.CreateEntitlement'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AppVisibility': appVisibility.value,
'Attributes': attributes,
'Name': name,
'StackName': stackName,
if (description != null) 'Description': description,
},
);
return CreateEntitlementResult.fromJson(jsonResponse.body);
}