getIamPolicy method

Future<Policy> getIamPolicy(
  1. GetIamPolicyLicenseCodeRequest request
)

Gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creatingCloud Marketplace images.

Throws a http.ClientException if there were problems communicating with the API service. Throws a ServiceException if the API method failed for any reason.

Implementation

Future<Policy> getIamPolicy(GetIamPolicyLicenseCodeRequest request) async {
  final url = _endPoint.replace(
    path:
        '/compute/v1/projects/${request.project}/global/licenseCodes/${request.resource}/getIamPolicy',
    queryParameters: {
      if (request.optionsRequestedPolicyVersion case final $1?)
        'optionsRequestedPolicyVersion': '${$1}',
    },
  );
  final response = await _client.get(url);
  return Policy.fromJson(response);
}