updateEntitlement method

Future<UpdateEntitlementResult> updateEntitlement({
  1. required String name,
  2. required String stackName,
  3. AppVisibility? appVisibility,
  4. List<EntitlementAttribute>? attributes,
  5. String? description,
})

Updates the specified entitlement.

May throw ConcurrentModificationException. May throw EntitlementNotFoundException. May throw OperationNotPermittedException. May throw ResourceNotFoundException.

Parameter name : The name of the entitlement.

Parameter stackName : The name of the stack with which the entitlement is associated.

Parameter appVisibility : Specifies whether all or only selected apps are entitled.

Parameter attributes : The attributes of the entitlement.

Parameter description : The description of the entitlement.

Implementation

Future<UpdateEntitlementResult> updateEntitlement({
  required String name,
  required String stackName,
  AppVisibility? appVisibility,
  List<EntitlementAttribute>? attributes,
  String? description,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'PhotonAdminProxyService.UpdateEntitlement'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      'StackName': stackName,
      if (appVisibility != null) 'AppVisibility': appVisibility.value,
      if (attributes != null) 'Attributes': attributes,
      if (description != null) 'Description': description,
    },
  );

  return UpdateEntitlementResult.fromJson(jsonResponse.body);
}