private static void CreateAgency(IamClient iamClient) { var createAgencyRequest = new CreateAgencyRequest() { Body = new CreateAgencyRequestBody() { Agency = new CreateAgencyOption() { Name = "", Description = "", TrustDomainId = "", TrustDomainName = "", Duration = CreateAgencyOption.DurationEnum.ONEDAY, DomainId = "" } } }; try { var createAgencyResponse = iamClient.CreateAgency(createAgencyRequest); Console.WriteLine(JsonConvert.SerializeObject(createAgencyResponse.Agency)); } 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); } }