private static void AssociateAgencyWithProjectPermission(IamClient iamClient) { var grantPermissionToAgencyOnProjectRequest = new AssociateAgencyWithProjectPermissionRequest() { ProjectId = "", AgencyId = "", RoleId = "" }; try { var grantPermissionToAgencyOnProjectResponse = iamClient.AssociateAgencyWithProjectPermission(grantPermissionToAgencyOnProjectRequest); Console.WriteLine(JsonConvert.SerializeObject(grantPermissionToAgencyOnProjectResponse.HttpStatusCode)); } catch (RequestTimeoutException requestTimeoutException) { Console.WriteLine(requestTimeoutException.ErrorMessage); } catch (ServiceResponseException clientRequestException) { Console.WriteLine(clientRequestException.HttpStatusCode); Console.WriteLine(clientRequestException.ErrorCode); Console.WriteLine(clientRequestException.ErrorMsg); } catch (ConnectionException connectionException) { Console.WriteLine(connectionException.ErrorMessage); } }