private static void ListSecurityGroups(VpcClient client) { ListSecurityGroupsRequest req = new ListSecurityGroupsRequest { Limit = 1, }; try { ListSecurityGroupsResponse resp = client.ListSecurityGroups(req); foreach (var securityGroup in resp.SecurityGroups) { Console.WriteLine(securityGroup.Id); Console.WriteLine(securityGroup.Name); } } 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); } }
public static ListSecurityGroupsResponse Unmarshall(UnmarshallerContext _ctx) { ListSecurityGroupsResponse listSecurityGroupsResponse = new ListSecurityGroupsResponse(); listSecurityGroupsResponse.HttpResponse = _ctx.HttpResponse; listSecurityGroupsResponse.RequestId = _ctx.StringValue("ListSecurityGroups.RequestId"); listSecurityGroupsResponse.TotalCount = _ctx.IntegerValue("ListSecurityGroups.TotalCount"); List <string> listSecurityGroupsResponse_securityGroups = new List <string>(); for (int i = 0; i < _ctx.Length("ListSecurityGroups.SecurityGroups.Length"); i++) { listSecurityGroupsResponse_securityGroups.Add(_ctx.StringValue("ListSecurityGroups.SecurityGroups[" + i + "]")); } listSecurityGroupsResponse.SecurityGroups = listSecurityGroupsResponse_securityGroups; return(listSecurityGroupsResponse); }