updatePolicyWithHttpInfo method

Future<Response> updatePolicyWithHttpInfo(
  1. String account,
  2. String policy, {
  3. UpdatePolicyRequest? updatePolicyRequest,
})

Update a policy

Updates the specified policy resource by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if the maxMachines property is not provided, then the policy's maxMachines value will be left unchanged. However, if the maxMachines property is provided with a value of null, then the policy's maxMachines value will be updated to null.

Note: This method returns the HTTP Response.

Parameters:

  • String account (required): The identifier (UUID) or slug of your Keygen account.

  • String policy (required): The identifier (UUID) of the policy to be updated.

  • UpdatePolicyRequest updatePolicyRequest:

Implementation

Future<Response> updatePolicyWithHttpInfo(String account, String policy, { UpdatePolicyRequest? updatePolicyRequest, }) async {
  // ignore: prefer_const_declarations
  final path = r'/accounts/{account}/policies/{policy}'
    .replaceAll('{account}', account)
    .replaceAll('{policy}', policy);

  // ignore: prefer_final_locals
  Object? postBody = updatePolicyRequest;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/vnd.api+json'];


  return apiClient.invokeAPI(
    path,
    'PATCH',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}