diff --git a/modules/examples/src/main/java/com/ibm/cloud/is/vpc/v1/VPCExamples.java b/modules/examples/src/main/java/com/ibm/cloud/is/vpc/v1/VPCExamples.java index 34192a9766..ca644a83eb 100644 --- a/modules/examples/src/main/java/com/ibm/cloud/is/vpc/v1/VPCExamples.java +++ b/modules/examples/src/main/java/com/ibm/cloud/is/vpc/v1/VPCExamples.java @@ -1996,7 +1996,11 @@ public static void main(String[] args) throws Exception { DedicatedHostProfileCollection dedicatedHostProfileCollection = response.getResult(); // end-list_dedicated_host_profiles - dedicatedHostProfileName = dedicatedHostProfileCollection.getProfiles().get(0).getName(); + for (DedicatedHostProfile profile : dedicatedHostProfileCollection.getProfiles()) { + if (profile.getFamily().equalsIgnoreCase("balanced-disk")) { + dedicatedHostProfileName = profile.getName(); + } + } } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/Vpc.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/Vpc.java index d044cd13f3..387038b523 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/Vpc.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/Vpc.java @@ -12,7 +12,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.48.1-52130155-20220425-145431 + * IBM OpenAPI SDK Code Generator Version: 3.55.1-b24c7487-20220831-201343 */ package com.ibm.cloud.is.vpc.v1; @@ -168,6 +168,7 @@ import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerDiskOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerInitializationOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerNetworkInterfaceFloatingIpOptions; +import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerNetworkInterfaceIpOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerNetworkInterfaceOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerProfileOptions; @@ -270,6 +271,7 @@ import com.ibm.cloud.is.vpc.v1.model.ListBackupPolicyPlansOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerDisksOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerNetworkInterfaceFloatingIpsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerNetworkInterfaceIpsOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerNetworkInterfacesOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServersOptions; @@ -481,15 +483,21 @@ * The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual server * instances, along with subnets, volumes, load balancers, and more. * - * API Version: 2022-03-29 + * API Version: 2022-09-13 */ public class Vpc extends BaseService { + /** + * Default service name used when configuring the `Vpc` client. + */ public static final String DEFAULT_SERVICE_NAME = "vpc"; + /** + * Default service endpoint URL. + */ public static final String DEFAULT_SERVICE_URL = "https://us-south.iaas.cloud.ibm.com/v1"; - private String version = "2022-03-29"; + private String version = "2022-09-13"; private Long generation = Long.valueOf("2"); @@ -534,7 +542,7 @@ public Vpc(String serviceName, Authenticator authenticator) { * Gets the version. * * The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between - * `2022-03-29` and today's date (UTC). + * `2022-09-13` and today's date (UTC). * * @return the version */ @@ -1408,7 +1416,8 @@ public ServiceCall createVpcRoutingTableRoute(CreateVpcRoutingTableRouteO /** * Delete a VPC routing table route. * - * This request deletes a VPC route. This operation cannot be reversed. + * This request deletes a VPC route. This operation cannot be reversed. Only VPC routes with an `origin` of `user` are + * allowed to be deleted. * * @param deleteVpcRoutingTableRouteOptions the {@link DeleteVpcRoutingTableRouteOptions} containing the options for the call * @return a {@link ServiceCall} with a void result @@ -1463,7 +1472,8 @@ public ServiceCall getVpcRoutingTableRoute(GetVpcRoutingTableRouteOptions * Update a VPC routing table route. * * This request updates a VPC route with the information provided in a route patch object. The patch object is - * structured in the same way as a retrieved VPC route and needs to contain only the information to be updated. + * structured in the same way as a retrieved VPC route and needs to contain only the information to be updated. Only + * VPC routes with an `origin` of `user` are allowed to be updated. * * @param updateVpcRoutingTableRouteOptions the {@link UpdateVpcRoutingTableRouteOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link Route} @@ -1677,10 +1687,9 @@ public ServiceCall getSubnetNetworkAcl(GetSubnetNetworkAclOptions ge } /** - * Attach a network ACL to a subnet. + * Replace the network ACL for a subnet. * - * This request attaches the network ACL, specified in the request body, to the subnet specified by the subnet - * identifier in the URL. This replaces the existing network ACL on the subnet. + * This request replaces the existing network ACL for a subnet with the network ACL specified in the request body. * * @param replaceSubnetNetworkAclOptions the {@link ReplaceSubnetNetworkAclOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link NetworkACL} @@ -1809,10 +1818,9 @@ public ServiceCall getSubnetRoutingTable(GetSubnetRoutingTableOpti } /** - * Attach a routing table to a subnet. + * Replace the routing table for a subnet. * - * This request attaches the routing table, specified in the request body, to the subnet specified by the subnet - * identifier in the URL. This replaces the existing routing table on the subnet. + * This request replaces the existing routing table for a subnet with the routing table specified in the request body. * * For this request to succeed, the routing table `route_direct_link_ingress`, * `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` properties must be `false`. @@ -1921,6 +1929,9 @@ public ServiceCall createSubnetReservedIp(CreateSubnetReservedIpOpti * * This request releases a reserved IP. This operation cannot be reversed. * + * For this request to succeed, the reserved IP must not be required by another resource, such as a network interface + * for which it is the primary IP. A provider-owned reserved IP is not allowed to be deleted. + * * @param deleteSubnetReservedIpOptions the {@link DeleteSubnetReservedIpOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ @@ -1974,6 +1985,8 @@ public ServiceCall getSubnetReservedIp(GetSubnetReservedIpOptions ge * This request updates a reserved IP with the information in a provided reserved IP patch. The reserved IP patch * object is structured in the same way as a retrieved reserved IP and contains only the information to be updated. * + * A provider-owned reserved IP is not allowed to be updated. + * * @param updateSubnetReservedIpOptions the {@link UpdateSubnetReservedIpOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ReservedIP} */ @@ -2001,7 +2014,7 @@ public ServiceCall updateSubnetReservedIp(UpdateSubnetReservedIpOpti * List all images. * * This request lists all images available in the region. An image provides source data for a volume. Images are - * either system-provided, or created from another source, such as importing from object storage. + * either system-provided, or created from another source, such as importing from Cloud Object Storage. * * The images will be sorted by their `created_at` property values, with the newest first. Images with identical * `created_at` values will be secondarily sorted by ascending `id` property values. @@ -2045,7 +2058,7 @@ public ServiceCall listImages(ListImagesOptions listImagesOptio * List all images. * * This request lists all images available in the region. An image provides source data for a volume. Images are - * either system-provided, or created from another source, such as importing from object storage. + * either system-provided, or created from another source, such as importing from Cloud Object Storage. * * The images will be sorted by their `created_at` property values, with the newest first. Images with identical * `created_at` values will be secondarily sorted by ascending `id` property values. @@ -2090,7 +2103,8 @@ public ServiceCall createImage(CreateImageOptions createImageOptions) { * This request deletes an image. This operation cannot be reversed. A system-provided image is not allowed to be * deleted. Additionally, an image cannot be deleted if it: * - has a `status` of `tentative` or `deleting` - * - has a `status` of `pending` with a `status_reasons` code of `image_request_in_progress`. + * - has a `status` of `pending` with a `status_reasons` code of `image_request_in_progress` + * - has `catalog_offering.managed` set to `true`. * * @param deleteImageOptions the {@link DeleteImageOptions} containing the options for the call * @return a {@link ServiceCall} with a void result @@ -2396,8 +2410,8 @@ public ServiceCall updateKey(UpdateKeyOptions updateKeyOptions) { /** * List all instance profiles. * - * This request lists provisionable instance profiles in the region. An instance profile specifies the performance - * characteristics and pricing model for an instance. + * This request lists provisionable [instance profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) in the + * region. An instance profile specifies the performance characteristics and pricing model for an instance. * * @param listInstanceProfilesOptions the {@link ListInstanceProfilesOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link InstanceProfileCollection} @@ -2419,8 +2433,8 @@ public ServiceCall listInstanceProfiles(ListInstanceP /** * List all instance profiles. * - * This request lists provisionable instance profiles in the region. An instance profile specifies the performance - * characteristics and pricing model for an instance. + * This request lists provisionable [instance profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) in the + * region. An instance profile specifies the performance characteristics and pricing model for an instance. * * @return a {@link ServiceCall} with a result of type {@link InstanceProfileCollection} */ @@ -4383,8 +4397,8 @@ public ServiceCall updateDedicatedHostGroup(UpdateDedicatedH /** * List all dedicated host profiles. * - * This request lists all provisionable dedicated host profiles in the region. A dedicated host profile specifies the - * hardware characteristics for a dedicated host. + * This request lists provisionable [dedicated host profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) in + * the region. A dedicated host profile specifies the hardware characteristics for a dedicated host. * * @param listDedicatedHostProfilesOptions the {@link ListDedicatedHostProfilesOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link DedicatedHostProfileCollection} @@ -4415,8 +4429,8 @@ public ServiceCall listDedicatedHostProfiles(Lis /** * List all dedicated host profiles. * - * This request lists all provisionable dedicated host profiles in the region. A dedicated host profile specifies the - * hardware characteristics for a dedicated host. + * This request lists provisionable [dedicated host profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) in + * the region. A dedicated host profile specifies the hardware characteristics for a dedicated host. * * @return a {@link ServiceCall} with a result of type {@link DedicatedHostProfileCollection} */ @@ -5228,8 +5242,9 @@ public ServiceCall updatePlacementGroup(UpdatePlacementGroupOpti /** * List all bare metal server profiles. * - * This request lists all bare metal server profiles available in the region. A bare metal server profile specifies - * the performance characteristics and pricing model for a bare metal server. + * This request lists all [bare metal server + * profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) available in the region. A bare + * metal server profile specifies the performance characteristics and pricing model for a bare metal server. * * @param listBareMetalServerProfilesOptions the {@link ListBareMetalServerProfilesOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link BareMetalServerProfileCollection} @@ -5260,8 +5275,9 @@ public ServiceCall listBareMetalServerProfiles /** * List all bare metal server profiles. * - * This request lists all bare metal server profiles available in the region. A bare metal server profile specifies - * the performance characteristics and pricing model for a bare metal server. + * This request lists all [bare metal server + * profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) available in the region. A bare + * metal server profile specifies the performance characteristics and pricing model for a bare metal server. * * @return a {@link ServiceCall} with a result of type {@link BareMetalServerProfileCollection} */ @@ -5785,6 +5801,62 @@ public ServiceCall addBareMetalServerNetworkInterfaceFloatingIp(AddB return createServiceCall(builder.build(), responseConverter); } + /** + * List all reserved IPs bound to a network interface. + * + * This request lists all reserved IPs bound to a network interface. + * + * @param listBareMetalServerNetworkInterfaceIpsOptions the {@link ListBareMetalServerNetworkInterfaceIpsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIPCollectionNetworkInterfaceContext} + */ + public ServiceCall listBareMetalServerNetworkInterfaceIps(ListBareMetalServerNetworkInterfaceIpsOptions listBareMetalServerNetworkInterfaceIpsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listBareMetalServerNetworkInterfaceIpsOptions, + "listBareMetalServerNetworkInterfaceIpsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("bare_metal_server_id", listBareMetalServerNetworkInterfaceIpsOptions.bareMetalServerId()); + pathParamsMap.put("network_interface_id", listBareMetalServerNetworkInterfaceIpsOptions.networkInterfaceId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServerNetworkInterfaceIps"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Retrieve bound reserved IP. + * + * This request a retrieves the specified reserved IP address if it is bound to the network interface and bare metal + * server specified in the URL. + * + * @param getBareMetalServerNetworkInterfaceIpOptions the {@link GetBareMetalServerNetworkInterfaceIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIP} + */ + public ServiceCall getBareMetalServerNetworkInterfaceIp(GetBareMetalServerNetworkInterfaceIpOptions getBareMetalServerNetworkInterfaceIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerNetworkInterfaceIpOptions, + "getBareMetalServerNetworkInterfaceIpOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("bare_metal_server_id", getBareMetalServerNetworkInterfaceIpOptions.bareMetalServerId()); + pathParamsMap.put("network_interface_id", getBareMetalServerNetworkInterfaceIpOptions.networkInterfaceId()); + pathParamsMap.put("id", getBareMetalServerNetworkInterfaceIpOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerNetworkInterfaceIp"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + /** * Delete a bare metal server. * @@ -5972,8 +6044,8 @@ public ServiceCall stopBareMetalServer(StopBareMetalServerOptions stopBare /** * List all volume profiles. * - * This request lists all volume profiles available in the region. A volume profile specifies the performance - * characteristics and pricing model for a volume. + * This request lists all [volume profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) available + * in the region. A volume profile specifies the performance characteristics and pricing model for a volume. * * @param listVolumeProfilesOptions the {@link ListVolumeProfilesOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link VolumeProfileCollection} @@ -6004,8 +6076,8 @@ public ServiceCall listVolumeProfiles(ListVolumeProfile /** * List all volume profiles. * - * This request lists all volume profiles available in the region. A volume profile specifies the performance - * characteristics and pricing model for a volume. + * This request lists all [volume profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) available + * in the region. A volume profile specifies the performance characteristics and pricing model for a volume. * * @return a {@link ServiceCall} with a result of type {@link VolumeProfileCollection} */ @@ -6899,8 +6971,9 @@ public ServiceCall listNetworkAcls() { /** * Create a network ACL. * - * This request creates a new network ACL from a network ACL prototype object. The prototype object is structured in - * the same way as a retrieved network ACL, and contains the information necessary to create the new network ACL. + * This request creates a new stateless network ACL from a network ACL prototype object. The prototype object is + * structured in the same way as a retrieved network ACL, and contains the information necessary to create the new + * network ACL. * * @param createNetworkAclOptions the {@link CreateNetworkAclOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link NetworkACL} @@ -6928,8 +7001,9 @@ public ServiceCall createNetworkAcl(CreateNetworkAclOptions createNe /** * Create a network ACL. * - * This request creates a new network ACL from a network ACL prototype object. The prototype object is structured in - * the same way as a retrieved network ACL, and contains the information necessary to create the new network ACL. + * This request creates a new stateless network ACL from a network ACL prototype object. The prototype object is + * structured in the same way as a retrieved network ACL, and contains the information necessary to create the new + * network ACL. * * @return a {@link ServiceCall} with a result of type {@link NetworkACL} */ @@ -8012,6 +8086,9 @@ public ServiceCall listVpnGateways(ListVpnGatewaysOptions if (listVpnGatewaysOptions.resourceGroupId() != null) { builder.query("resource_group.id", String.valueOf(listVpnGatewaysOptions.resourceGroupId())); } + if (listVpnGatewaysOptions.sort() != null) { + builder.query("sort", String.valueOf(listVpnGatewaysOptions.sort())); + } if (listVpnGatewaysOptions.mode() != null) { builder.query("mode", String.valueOf(listVpnGatewaysOptions.mode())); } @@ -9177,6 +9254,9 @@ public ServiceCall deleteLoadBalancer(DeleteLoadBalancerOptions deleteLoad for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + if (deleteLoadBalancerOptions.ifMatch() != null) { + builder.header("If-Match", deleteLoadBalancerOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); @@ -9212,7 +9292,9 @@ public ServiceCall getLoadBalancer(GetLoadBalancerOptions getLoadB /** * Update a load balancer. * - * This request updates a load balancer. + * This request updates a load balancer with the information in a provided load balancer patch. The load balancer + * patch object is structured in the same way as a retrieved load balancer and contains only the information to be + * updated. A load balancer can only be updated if its `provisioning_status` is `active`. * * @param updateLoadBalancerOptions the {@link UpdateLoadBalancerOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link LoadBalancer} @@ -9228,6 +9310,9 @@ public ServiceCall updateLoadBalancer(UpdateLoadBalancerOptions up builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateLoadBalancerOptions.ifMatch() != null) { + builder.header("If-Match", updateLoadBalancerOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(updateLoadBalancerOptions.loadBalancerPatch()), "application/merge-patch+json"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddBareMetalServerNetworkInterfaceFloatingIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddBareMetalServerNetworkInterfaceFloatingIpOptions.java index 75cc5276f5..88afab7843 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddBareMetalServerNetworkInterfaceFloatingIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddBareMetalServerNetworkInterfaceFloatingIpOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String networkInterfaceId; private String id; + /** + * Instantiates a new Builder from an existing AddBareMetalServerNetworkInterfaceFloatingIpOptions instance. + * + * @param addBareMetalServerNetworkInterfaceFloatingIpOptions the instance to initialize the Builder with + */ private Builder(AddBareMetalServerNetworkInterfaceFloatingIpOptions addBareMetalServerNetworkInterfaceFloatingIpOptions) { this.bareMetalServerId = addBareMetalServerNetworkInterfaceFloatingIpOptions.bareMetalServerId; this.networkInterfaceId = addBareMetalServerNetworkInterfaceFloatingIpOptions.networkInterfaceId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected AddBareMetalServerNetworkInterfaceFloatingIpOptions() { } + protected AddBareMetalServerNetworkInterfaceFloatingIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddEndpointGatewayIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddEndpointGatewayIpOptions.java index bf8e73b391..ea176f89ff 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddEndpointGatewayIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddEndpointGatewayIpOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String endpointGatewayId; private String id; + /** + * Instantiates a new Builder from an existing AddEndpointGatewayIpOptions instance. + * + * @param addEndpointGatewayIpOptions the instance to initialize the Builder with + */ private Builder(AddEndpointGatewayIpOptions addEndpointGatewayIpOptions) { this.endpointGatewayId = addEndpointGatewayIpOptions.endpointGatewayId; this.id = addEndpointGatewayIpOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected AddEndpointGatewayIpOptions() { } + protected AddEndpointGatewayIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.endpointGatewayId, "endpointGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddInstanceNetworkInterfaceFloatingIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddInstanceNetworkInterfaceFloatingIpOptions.java index 208be00326..14120aa4cd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddInstanceNetworkInterfaceFloatingIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddInstanceNetworkInterfaceFloatingIpOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String networkInterfaceId; private String id; + /** + * Instantiates a new Builder from an existing AddInstanceNetworkInterfaceFloatingIpOptions instance. + * + * @param addInstanceNetworkInterfaceFloatingIpOptions the instance to initialize the Builder with + */ private Builder(AddInstanceNetworkInterfaceFloatingIpOptions addInstanceNetworkInterfaceFloatingIpOptions) { this.instanceId = addInstanceNetworkInterfaceFloatingIpOptions.instanceId; this.networkInterfaceId = addInstanceNetworkInterfaceFloatingIpOptions.networkInterfaceId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected AddInstanceNetworkInterfaceFloatingIpOptions() { } + protected AddInstanceNetworkInterfaceFloatingIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayConnectionLocalCidrOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayConnectionLocalCidrOptions.java index 4243e28eca..0c66349476 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayConnectionLocalCidrOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayConnectionLocalCidrOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String cidrPrefix; private String prefixLength; + /** + * Instantiates a new Builder from an existing AddVpnGatewayConnectionLocalCidrOptions instance. + * + * @param addVpnGatewayConnectionLocalCidrOptions the instance to initialize the Builder with + */ private Builder(AddVpnGatewayConnectionLocalCidrOptions addVpnGatewayConnectionLocalCidrOptions) { this.vpnGatewayId = addVpnGatewayConnectionLocalCidrOptions.vpnGatewayId; this.id = addVpnGatewayConnectionLocalCidrOptions.id; @@ -115,6 +120,8 @@ public Builder prefixLength(String prefixLength) { } } + protected AddVpnGatewayConnectionLocalCidrOptions() { } + protected AddVpnGatewayConnectionLocalCidrOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, "vpnGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayConnectionPeerCidrOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayConnectionPeerCidrOptions.java index 6131708412..c2295abcc2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayConnectionPeerCidrOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayConnectionPeerCidrOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String cidrPrefix; private String prefixLength; + /** + * Instantiates a new Builder from an existing AddVpnGatewayConnectionPeerCidrOptions instance. + * + * @param addVpnGatewayConnectionPeerCidrOptions the instance to initialize the Builder with + */ private Builder(AddVpnGatewayConnectionPeerCidrOptions addVpnGatewayConnectionPeerCidrOptions) { this.vpnGatewayId = addVpnGatewayConnectionPeerCidrOptions.vpnGatewayId; this.id = addVpnGatewayConnectionPeerCidrOptions.id; @@ -115,6 +120,8 @@ public Builder prefixLength(String prefixLength) { } } + protected AddVpnGatewayConnectionPeerCidrOptions() { } + protected AddVpnGatewayConnectionPeerCidrOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, "vpnGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefix.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefix.java index beddeb243a..578f893381 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefix.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefix.java @@ -34,6 +34,8 @@ public class AddressPrefix extends GenericModel { protected String name; protected ZoneReference zone; + protected AddressPrefix() { } + /** * Gets the cidr. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixCollection.java index 38e890644a..8df616abe4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixCollection.java @@ -30,6 +30,8 @@ public class AddressPrefixCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected AddressPrefixCollection() { } + /** * Gets the addressPrefixes. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixCollectionFirst.java index 829c0a305e..4c220c35d8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixCollectionFirst.java @@ -21,6 +21,8 @@ public class AddressPrefixCollectionFirst extends GenericModel { protected String href; + protected AddressPrefixCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixCollectionNext.java index 5547f1fa5a..f76048a49d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixCollectionNext.java @@ -21,6 +21,8 @@ public class AddressPrefixCollectionNext extends GenericModel { protected String href; + protected AddressPrefixCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixPatch.java index c95ee89e44..dc9afea0e8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddressPrefixPatch.java @@ -34,6 +34,11 @@ public static class Builder { private Boolean isDefault; private String name; + /** + * Instantiates a new Builder from an existing AddressPrefixPatch instance. + * + * @param addressPrefixPatch the instance to initialize the Builder with + */ private Builder(AddressPrefixPatch addressPrefixPatch) { this.isDefault = addressPrefixPatch.isDefault; this.name = addressPrefixPatch.name; @@ -77,6 +82,8 @@ public Builder name(String name) { } } + protected AddressPrefixPatch() { } + protected AddressPrefixPatch(Builder builder) { isDefault = builder.isDefault; name = builder.name; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPoliciesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPoliciesPager.java new file mode 100644 index 0000000000..1292684bf6 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPoliciesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * BackupPoliciesPager can be used to simplify the use of the "listBackupPolicies" method. + */ +public class BackupPoliciesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListBackupPoliciesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected BackupPoliciesPager() { } + + /** + * Constructs a new BackupPoliciesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listBackupPolicies" method + * @param options the ListBackupPoliciesOptions instance to be used to invoke the "listBackupPolicies" method + */ + public BackupPoliciesPager(Vpc client, ListBackupPoliciesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<BackupPolicy> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListBackupPoliciesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + BackupPolicyCollection result = client.listBackupPolicies(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getBackupPolicies(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<BackupPolicy> containing all results returned by the "listBackupPolicies" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicy.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicy.java index c4ca75f4c2..fc8e01a5cd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicy.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicy.java @@ -79,6 +79,8 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected BackupPolicy() { } + /** * Gets the createdAt. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollection.java index f1071799c2..74d411ba32 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollection.java @@ -30,6 +30,8 @@ public class BackupPolicyCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected BackupPolicyCollection() { } + /** * Gets the backupPolicies. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionFirst.java index a0c670c4ba..d89dd1d04f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionFirst.java @@ -21,6 +21,8 @@ public class BackupPolicyCollectionFirst extends GenericModel { protected String href; + protected BackupPolicyCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionNext.java index 0900f6eb67..38c955016a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionNext.java @@ -21,6 +21,8 @@ public class BackupPolicyCollectionNext extends GenericModel { protected String href; + protected BackupPolicyCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPatch.java index c92305fe4d..1437bd0ee3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPatch.java @@ -36,6 +36,11 @@ public static class Builder { private List matchUserTags; private String name; + /** + * Instantiates a new Builder from an existing BackupPolicyPatch instance. + * + * @param backupPolicyPatch the instance to initialize the Builder with + */ private Builder(BackupPolicyPatch backupPolicyPatch) { this.matchUserTags = backupPolicyPatch.matchUserTags; this.name = backupPolicyPatch.name; @@ -96,6 +101,8 @@ public Builder name(String name) { } } + protected BackupPolicyPatch() { } + protected BackupPolicyPatch(Builder builder) { matchUserTags = builder.matchUserTags; name = builder.name; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlan.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlan.java index 565bdc2773..b4b1106215 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlan.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlan.java @@ -70,6 +70,8 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected BackupPolicyPlan() { } + /** * Gets the active. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanCollection.java index f6228dd3f0..66964ea2da 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanCollection.java @@ -23,6 +23,8 @@ public class BackupPolicyPlanCollection extends GenericModel { protected List plans; + protected BackupPolicyPlanCollection() { } + /** * Gets the plans. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanDeletionTrigger.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanDeletionTrigger.java index e57185a8ae..7443705131 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanDeletionTrigger.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanDeletionTrigger.java @@ -25,6 +25,8 @@ public class BackupPolicyPlanDeletionTrigger extends GenericModel { @SerializedName("delete_over_count") protected Long deleteOverCount; + protected BackupPolicyPlanDeletionTrigger() { } + /** * Gets the deleteAfter. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanDeletionTriggerPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanDeletionTriggerPatch.java index f40de87889..c82ebbfda8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanDeletionTriggerPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanDeletionTriggerPatch.java @@ -32,6 +32,11 @@ public static class Builder { private Long deleteAfter; private Long deleteOverCount; + /** + * Instantiates a new Builder from an existing BackupPolicyPlanDeletionTriggerPatch instance. + * + * @param backupPolicyPlanDeletionTriggerPatch the instance to initialize the Builder with + */ private Builder(BackupPolicyPlanDeletionTriggerPatch backupPolicyPlanDeletionTriggerPatch) { this.deleteAfter = backupPolicyPlanDeletionTriggerPatch.deleteAfter; this.deleteOverCount = backupPolicyPlanDeletionTriggerPatch.deleteOverCount; @@ -75,6 +80,8 @@ public Builder deleteOverCount(long deleteOverCount) { } } + protected BackupPolicyPlanDeletionTriggerPatch() { } + protected BackupPolicyPlanDeletionTriggerPatch(Builder builder) { deleteAfter = builder.deleteAfter; deleteOverCount = builder.deleteOverCount; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanDeletionTriggerPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanDeletionTriggerPrototype.java index 338427c6e5..9c05159f34 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanDeletionTriggerPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanDeletionTriggerPrototype.java @@ -32,6 +32,11 @@ public static class Builder { private Long deleteAfter; private Long deleteOverCount; + /** + * Instantiates a new Builder from an existing BackupPolicyPlanDeletionTriggerPrototype instance. + * + * @param backupPolicyPlanDeletionTriggerPrototype the instance to initialize the Builder with + */ private Builder(BackupPolicyPlanDeletionTriggerPrototype backupPolicyPlanDeletionTriggerPrototype) { this.deleteAfter = backupPolicyPlanDeletionTriggerPrototype.deleteAfter; this.deleteOverCount = backupPolicyPlanDeletionTriggerPrototype.deleteOverCount; @@ -75,6 +80,8 @@ public Builder deleteOverCount(long deleteOverCount) { } } + protected BackupPolicyPlanDeletionTriggerPrototype() { } + protected BackupPolicyPlanDeletionTriggerPrototype(Builder builder) { deleteAfter = builder.deleteAfter; deleteOverCount = builder.deleteOverCount; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatch.java index e38aa3f1fe..d908a79c4e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatch.java @@ -47,6 +47,11 @@ public static class Builder { private BackupPolicyPlanDeletionTriggerPatch deletionTrigger; private String name; + /** + * Instantiates a new Builder from an existing BackupPolicyPlanPatch instance. + * + * @param backupPolicyPlanPatch the instance to initialize the Builder with + */ private Builder(BackupPolicyPlanPatch backupPolicyPlanPatch) { this.active = backupPolicyPlanPatch.active; this.attachUserTags = backupPolicyPlanPatch.attachUserTags; @@ -155,6 +160,8 @@ public Builder name(String name) { } } + protected BackupPolicyPlanPatch() { } + protected BackupPolicyPlanPatch(Builder builder) { active = builder.active; attachUserTags = builder.attachUserTags; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototype.java index 70ac5e2096..27e592cee9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototype.java @@ -45,6 +45,11 @@ public static class Builder { private BackupPolicyPlanDeletionTriggerPrototype deletionTrigger; private String name; + /** + * Instantiates a new Builder from an existing BackupPolicyPlanPrototype instance. + * + * @param backupPolicyPlanPrototype the instance to initialize the Builder with + */ private Builder(BackupPolicyPlanPrototype backupPolicyPlanPrototype) { this.active = backupPolicyPlanPrototype.active; this.attachUserTags = backupPolicyPlanPrototype.attachUserTags; @@ -162,6 +167,8 @@ public Builder name(String name) { } } + protected BackupPolicyPlanPrototype() { } + protected BackupPolicyPlanPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.cronSpec, "cronSpec cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReference.java index bacf65ed04..abbf52dedb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReference.java @@ -35,10 +35,12 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected BackupPolicyPlanReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReferenceDeleted.java index 2a75adcc62..8142775e96 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class BackupPolicyPlanReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class BackupPolicyPlanReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected BackupPolicyPlanReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServer.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServer.java index 3c1c994ec8..8f93a78c33 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServer.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServer.java @@ -84,6 +84,8 @@ public interface Status { protected VPCReference vpc; protected ZoneReference zone; + protected BareMetalServer() { } + /** * Gets the bandwidth. * @@ -232,7 +234,8 @@ public NetworkInterfaceBareMetalServerContextReference getPrimaryNetworkInterfac /** * Gets the profile. * - * The profile this bare metal server uses. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + * for this bare metal server. * * @return the profile */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerBootTarget.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerBootTarget.java index 3c22dfb923..ce4a3c37df 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerBootTarget.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerBootTarget.java @@ -38,13 +38,12 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; - protected BareMetalServerBootTarget() { - } + protected BareMetalServerBootTarget() { } /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerBootTargetBareMetalServerDiskReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerBootTargetBareMetalServerDiskReference.java index a3e02e04cb..2f23cba47f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerBootTargetBareMetalServerDiskReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerBootTargetBareMetalServerDiskReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String BARE_METAL_SERVER_DISK = "bare_metal_server_disk"; } + + protected BareMetalServerBootTargetBareMetalServerDiskReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCPU.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCPU.java index 5fbba7bb7c..7fa67f3fdf 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCPU.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCPU.java @@ -28,6 +28,8 @@ public class BareMetalServerCPU extends GenericModel { @SerializedName("threads_per_core") protected Long threadsPerCore; + protected BareMetalServerCPU() { } + /** * Gets the architecture. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollection.java index 16b0e37353..e2f45ec66f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollection.java @@ -30,6 +30,8 @@ public class BareMetalServerCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected BareMetalServerCollection() { } + /** * Gets the bareMetalServers. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionFirst.java index d2f9e0abdd..23d87cf66d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionFirst.java @@ -21,6 +21,8 @@ public class BareMetalServerCollectionFirst extends GenericModel { protected String href; + protected BareMetalServerCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionNext.java index 9b64c2d724..1ddc7df962 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionNext.java @@ -21,6 +21,8 @@ public class BareMetalServerCollectionNext extends GenericModel { protected String href; + protected BareMetalServerCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerConsoleAccessToken.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerConsoleAccessToken.java index b9fbb3cc87..d15b42478a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerConsoleAccessToken.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerConsoleAccessToken.java @@ -43,6 +43,8 @@ public interface ConsoleType { protected Boolean force; protected String href; + protected BareMetalServerConsoleAccessToken() { } + /** * Gets the accessToken. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDisk.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDisk.java index 53713abfee..48f47487ed 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDisk.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDisk.java @@ -25,11 +25,17 @@ public class BareMetalServerDisk extends GenericModel { /** * The disk interface used for attaching the disk. * + * - `fcp`: Attached using Fiber Channel Protocol + * - `sata`: Attached using Serial Advanced Technology Attachment + * - `nvme`: Attached using Non-Volatile Memory Express + * * The enumerated values for this property are expected to expand in the future. When processing this property, check * for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the * unexpected property value was encountered. */ public interface InterfaceType { + /** fcp. */ + String FCP = "fcp"; /** nvme. */ String NVME = "nvme"; /** sata. */ @@ -55,6 +61,8 @@ public interface ResourceType { protected String resourceType; protected Long size; + protected BareMetalServerDisk() { } + /** * Gets the createdAt. * @@ -93,6 +101,10 @@ public String getId() { * * The disk interface used for attaching the disk. * + * - `fcp`: Attached using Fiber Channel Protocol + * - `sata`: Attached using Serial Advanced Technology Attachment + * - `nvme`: Attached using Non-Volatile Memory Express + * * The enumerated values for this property are expected to expand in the future. When processing this property, check * for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the * unexpected property value was encountered. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskCollection.java index 9f03ec9ed3..b7e9d84959 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskCollection.java @@ -23,6 +23,8 @@ public class BareMetalServerDiskCollection extends GenericModel { protected List disks; + protected BareMetalServerDiskCollection() { } + /** * Gets the disks. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskPatch.java index b900bd68e2..0dd944dfc6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskPatch.java @@ -30,6 +30,11 @@ public class BareMetalServerDiskPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing BareMetalServerDiskPatch instance. + * + * @param bareMetalServerDiskPatch the instance to initialize the Builder with + */ private Builder(BareMetalServerDiskPatch bareMetalServerDiskPatch) { this.name = bareMetalServerDiskPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected BareMetalServerDiskPatch() { } + protected BareMetalServerDiskPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskReferenceDeleted.java index 15fb83ee06..f37f575dea 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class BareMetalServerDiskReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class BareMetalServerDiskReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected BareMetalServerDiskReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitialization.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitialization.java index 1b84f45aa5..d7e5cee8b9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitialization.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitialization.java @@ -27,6 +27,8 @@ public class BareMetalServerInitialization extends GenericModel { @SerializedName("user_accounts") protected List userAccounts; + protected BareMetalServerInitialization() { } + /** * Gets the image. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototype.java index efefe3c2e1..43f85b0004 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototype.java @@ -36,6 +36,11 @@ public static class Builder { private List keys; private String userData; + /** + * Instantiates a new Builder from an existing BareMetalServerInitializationPrototype instance. + * + * @param bareMetalServerInitializationPrototype the instance to initialize the Builder with + */ private Builder(BareMetalServerInitializationPrototype bareMetalServerInitializationPrototype) { this.image = bareMetalServerInitializationPrototype.image; this.keys = bareMetalServerInitializationPrototype.keys; @@ -119,6 +124,8 @@ public Builder userData(String userData) { } } + protected BareMetalServerInitializationPrototype() { } + protected BareMetalServerInitializationPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.image, "image cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationUserAccount.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationUserAccount.java index afcd37a36b..e0fe3ab4f2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationUserAccount.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationUserAccount.java @@ -39,8 +39,7 @@ public interface ResourceType { protected String resourceType; protected String username; - protected BareMetalServerInitializationUserAccount() { - } + protected BareMetalServerInitializationUserAccount() { } /** * Gets the encryptedPassword. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount.java index 1c6d594e40..29025a39da 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount.java @@ -25,5 +25,7 @@ public interface ResourceType { String HOST_USER_ACCOUNT = "host_user_account"; } + + protected BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterface.java index c478ebe4be..3cb4614a9e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterface.java @@ -22,6 +22,7 @@ * BareMetalServerNetworkInterface. * * Classes which extend this class: + * - BareMetalServerNetworkInterfaceByHiperSocket * - BareMetalServerNetworkInterfaceByPCI * - BareMetalServerNetworkInterfaceByVLAN */ @@ -31,12 +32,15 @@ public class BareMetalServerNetworkInterface extends GenericModel { protected static java.util.Map> discriminatorMapping; static { discriminatorMapping = new java.util.HashMap<>(); + discriminatorMapping.put("hipersocket", BareMetalServerNetworkInterfaceByHiperSocket.class); discriminatorMapping.put("pci", BareMetalServerNetworkInterfaceByPCI.class); discriminatorMapping.put("vlan", BareMetalServerNetworkInterfaceByVLAN.class); } /** * The network interface type: + * - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity + * within a `s390x` based system * - `pci`: a physical PCI device which can only be created or deleted when the bare metal * server is stopped * - Has an `allowed_vlans` property which controls the VLANs that will be permitted @@ -47,8 +51,14 @@ public class BareMetalServerNetworkInterface extends GenericModel { * - Must use an IEEE 802.1q tag. * - Has its own security groups and does not inherit those of the PCI device through * which traffic flows. + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + * unexpected property value was encountered. */ public interface InterfaceType { + /** hipersocket. */ + String HIPERSOCKET = "hipersocket"; /** pci. */ String PCI = "pci"; /** vlan. */ @@ -119,8 +129,7 @@ public interface Type { protected Boolean allowInterfaceToFloat; protected Long vlan; - protected BareMetalServerNetworkInterface() { - } + protected BareMetalServerNetworkInterface() { } /** * Gets the allowIpSpoofing. @@ -153,11 +162,13 @@ public Date getCreatedAt() { * - A single floating IP can be assigned to the network interface. * * If `false`: - * - Packets are passed unmodified to/from the network interface, + * - Packets are passed unchanged to/from the network interface, * allowing the workload to perform any needed NAT operations. * - Multiple floating IPs can be assigned to the network interface. * - `allow_ip_spoofing` must be set to `false`. * + * This must be `true` when `interface_type` is `hipersocket`. + * * @return the enableInfrastructureNat */ public Boolean isEnableInfrastructureNat() { @@ -201,6 +212,8 @@ public String getId() { * Gets the interfaceType. * * The network interface type: + * - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity + * within a `s390x` based system * - `pci`: a physical PCI device which can only be created or deleted when the bare metal * server is stopped * - Has an `allowed_vlans` property which controls the VLANs that will be permitted @@ -212,6 +225,10 @@ public String getId() { * - Has its own security groups and does not inherit those of the PCI device through * which traffic flows. * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + * unexpected property value was encountered. + * * @return the interfaceType */ public String getInterfaceType() { @@ -318,8 +335,7 @@ public String getType() { /** * Gets the allowedVlans. * - * Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be - * in the `allowed_vlans` array for one PCI type adapter per bare metal server. + * Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. * * @return the allowedVlans */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByHiperSocket.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByHiperSocket.java new file mode 100644 index 0000000000..ff729cfb89 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByHiperSocket.java @@ -0,0 +1,64 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +/** + * BareMetalServerNetworkInterfaceByHiperSocket. + */ +public class BareMetalServerNetworkInterfaceByHiperSocket extends BareMetalServerNetworkInterface { + + /** + * The resource type. + */ + public interface ResourceType { + /** network_interface. */ + String NETWORK_INTERFACE = "network_interface"; + } + + /** + * The status of the network interface. + */ + public interface Status { + /** available. */ + String AVAILABLE = "available"; + /** deleting. */ + String DELETING = "deleting"; + /** failed. */ + String FAILED = "failed"; + /** pending. */ + String PENDING = "pending"; + } + + /** + * The type of this bare metal server network interface. + */ + public interface Type { + /** primary. */ + String PRIMARY = "primary"; + /** secondary. */ + String SECONDARY = "secondary"; + } + + /** + * - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity + * within a `s390x` based system. + */ + public interface InterfaceType { + /** hipersocket. */ + String HIPERSOCKET = "hipersocket"; + } + + + protected BareMetalServerNetworkInterfaceByHiperSocket() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByPCI.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByPCI.java index 5bc581a4f4..57fdbe0bd3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByPCI.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByPCI.java @@ -61,5 +61,7 @@ public interface InterfaceType { String PCI = "pci"; } + + protected BareMetalServerNetworkInterfaceByPCI() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByVLAN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByVLAN.java index d6085570f3..a07f597dc5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByVLAN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByVLAN.java @@ -61,5 +61,7 @@ public interface InterfaceType { String VLAN = "vlan"; } + + protected BareMetalServerNetworkInterfaceByVLAN() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollection.java index c05557823c..3184a679f3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollection.java @@ -30,6 +30,8 @@ public class BareMetalServerNetworkInterfaceCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected BareMetalServerNetworkInterfaceCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollectionFirst.java index a684afb200..a4b0eb99b0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollectionFirst.java @@ -21,6 +21,8 @@ public class BareMetalServerNetworkInterfaceCollectionFirst extends GenericModel protected String href; + protected BareMetalServerNetworkInterfaceCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollectionNext.java index ec66bf136f..03e95216b7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollectionNext.java @@ -21,6 +21,8 @@ public class BareMetalServerNetworkInterfaceCollectionNext extends GenericModel protected String href; + protected BareMetalServerNetworkInterfaceCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePatch.java index ce0ccecc1c..4fb03eba1f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePatch.java @@ -42,6 +42,11 @@ public static class Builder { private Boolean enableInfrastructureNat; private String name; + /** + * Instantiates a new Builder from an existing BareMetalServerNetworkInterfacePatch instance. + * + * @param bareMetalServerNetworkInterfacePatch the instance to initialize the Builder with + */ private Builder(BareMetalServerNetworkInterfacePatch bareMetalServerNetworkInterfacePatch) { this.allowIpSpoofing = bareMetalServerNetworkInterfacePatch.allowIpSpoofing; this.allowedVlans = bareMetalServerNetworkInterfacePatch.allowedVlans; @@ -126,6 +131,8 @@ public Builder name(String name) { } } + protected BareMetalServerNetworkInterfacePatch() { } + protected BareMetalServerNetworkInterfacePatch(Builder builder) { allowIpSpoofing = builder.allowIpSpoofing; allowedVlans = builder.allowedVlans; @@ -157,8 +164,7 @@ public Boolean allowIpSpoofing() { /** * Gets the allowedVlans. * - * Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be - * in the `allowed_vlans` array for one PCI type adapter per bare metal server. + * Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. * * @return the allowedVlans */ @@ -174,11 +180,13 @@ public List allowedVlans() { * - A single floating IP can be assigned to the network interface. * * If `false`: - * - Packets are passed unmodified to/from the network interface, + * - Packets are passed unchanged to/from the network interface, * allowing the workload to perform any needed NAT operations. * - Multiple floating IPs can be assigned to the network interface. * - `allow_ip_spoofing` must be set to `false`. * + * This must be `true` when `interface_type` is `hipersocket`. + * * @return the enableInfrastructureNat */ public Boolean enableInfrastructureNat() { diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototype.java index 0292df09c4..6194d4bdb2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototype.java @@ -21,6 +21,7 @@ * BareMetalServerNetworkInterfacePrototype. * * Classes which extend this class: + * - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype * - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype * - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype */ @@ -30,24 +31,32 @@ public class BareMetalServerNetworkInterfacePrototype extends GenericModel { protected static java.util.Map> discriminatorMapping; static { discriminatorMapping = new java.util.HashMap<>(); + discriminatorMapping.put("hipersocket", BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.class); discriminatorMapping.put("pci", BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype.class); discriminatorMapping.put("vlan", BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.class); } /** * The network interface type: + * - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity + * within a `s390x` based system + * - Not supported on bare metal servers with a `cpu.architecture` of `amd64` * - `pci`: a physical PCI device which can only be created or deleted when the bare metal * server is stopped * - Has an `allowed_vlans` property which controls the VLANs that will be permitted * to use the PCI interface * - Cannot directly use an IEEE 802.1q VLAN tag. + * - Not supported on bare metal servers with a `cpu.architecture` of `s390x` * - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its * array of `allowed_vlans`. * - Must use an IEEE 802.1q tag. * - Has its own security groups and does not inherit those of the PCI device through * which traffic flows. + * - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. */ public interface InterfaceType { + /** hipersocket. */ + String HIPERSOCKET = "hipersocket"; /** pci. */ String PCI = "pci"; /** vlan. */ @@ -72,8 +81,7 @@ public interface InterfaceType { protected Boolean allowInterfaceToFloat; protected Long vlan; - protected BareMetalServerNetworkInterfacePrototype() { - } + protected BareMetalServerNetworkInterfacePrototype() { } /** * Gets the allowIpSpoofing. @@ -95,11 +103,13 @@ public Boolean allowIpSpoofing() { * - A single floating IP can be assigned to the network interface. * * If `false`: - * - Packets are passed unmodified to/from the network interface, + * - Packets are passed unchanged to/from the network interface, * allowing the workload to perform any needed NAT operations. * - Multiple floating IPs can be assigned to the network interface. * - `allow_ip_spoofing` must be set to `false`. * + * This must be `true` when `interface_type` is `hipersocket`. + * * @return the enableInfrastructureNat */ public Boolean enableInfrastructureNat() { @@ -110,16 +120,21 @@ public Boolean enableInfrastructureNat() { * Gets the interfaceType. * * The network interface type: + * - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity + * within a `s390x` based system + * - Not supported on bare metal servers with a `cpu.architecture` of `amd64` * - `pci`: a physical PCI device which can only be created or deleted when the bare metal * server is stopped * - Has an `allowed_vlans` property which controls the VLANs that will be permitted * to use the PCI interface * - Cannot directly use an IEEE 802.1q VLAN tag. + * - Not supported on bare metal servers with a `cpu.architecture` of `s390x` * - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its * array of `allowed_vlans`. * - Must use an IEEE 802.1q tag. * - Has its own security groups and does not inherit those of the PCI device through * which traffic flows. + * - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. * * @return the interfaceType */ @@ -180,8 +195,7 @@ public SubnetIdentity subnet() { /** * Gets the allowedVlans. * - * Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be - * in the `allowed_vlans` array for one PCI type adapter per bare metal server. + * Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. * * @return the allowedVlans */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.java new file mode 100644 index 0000000000..9ee7f2bc3f --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.java @@ -0,0 +1,207 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype. + */ +public class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype extends BareMetalServerNetworkInterfacePrototype { + + /** + * - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity + * within a `s390x` based system. + * - Not supported on bare metal servers with a `cpu.architecture` of `amd64`. + */ + public interface InterfaceType { + /** hipersocket. */ + String HIPERSOCKET = "hipersocket"; + } + + + /** + * Builder. + */ + public static class Builder { + private Boolean allowIpSpoofing; + private Boolean enableInfrastructureNat; + private String name; + private NetworkInterfaceIPPrototype primaryIp; + private List securityGroups; + private SubnetIdentity subnet; + private String interfaceType; + + /** + * Instantiates a new Builder from an existing BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype instance. + * + * @param bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype the instance to initialize the Builder with + */ + public Builder(BareMetalServerNetworkInterfacePrototype bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype) { + this.allowIpSpoofing = bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.allowIpSpoofing; + this.enableInfrastructureNat = bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.enableInfrastructureNat; + this.name = bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.name; + this.primaryIp = bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.primaryIp; + this.securityGroups = bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.securityGroups; + this.subnet = bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.subnet; + this.interfaceType = bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.interfaceType; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param subnet the subnet + * @param interfaceType the interfaceType + */ + public Builder(SubnetIdentity subnet, String interfaceType) { + this.subnet = subnet; + this.interfaceType = interfaceType; + } + + /** + * Builds a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype. + * + * @return the new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype instance + */ + public BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype build() { + return new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(this); + } + + /** + * Adds an securityGroups to securityGroups. + * + * @param securityGroups the new securityGroups + * @return the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype builder + */ + public Builder addSecurityGroups(SecurityGroupIdentity securityGroups) { + com.ibm.cloud.sdk.core.util.Validator.notNull(securityGroups, + "securityGroups cannot be null"); + if (this.securityGroups == null) { + this.securityGroups = new ArrayList(); + } + this.securityGroups.add(securityGroups); + return this; + } + + /** + * Set the allowIpSpoofing. + * + * @param allowIpSpoofing the allowIpSpoofing + * @return the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype builder + */ + public Builder allowIpSpoofing(Boolean allowIpSpoofing) { + this.allowIpSpoofing = allowIpSpoofing; + return this; + } + + /** + * Set the enableInfrastructureNat. + * + * @param enableInfrastructureNat the enableInfrastructureNat + * @return the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype builder + */ + public Builder enableInfrastructureNat(Boolean enableInfrastructureNat) { + this.enableInfrastructureNat = enableInfrastructureNat; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the primaryIp. + * + * @param primaryIp the primaryIp + * @return the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype builder + */ + public Builder primaryIp(NetworkInterfaceIPPrototype primaryIp) { + this.primaryIp = primaryIp; + return this; + } + + /** + * Set the securityGroups. + * Existing securityGroups will be replaced. + * + * @param securityGroups the securityGroups + * @return the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype builder + */ + public Builder securityGroups(List securityGroups) { + this.securityGroups = securityGroups; + return this; + } + + /** + * Set the subnet. + * + * @param subnet the subnet + * @return the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype builder + */ + public Builder subnet(SubnetIdentity subnet) { + this.subnet = subnet; + return this; + } + + /** + * Set the interfaceType. + * + * @param interfaceType the interfaceType + * @return the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype builder + */ + public Builder interfaceType(String interfaceType) { + this.interfaceType = interfaceType; + return this; + } + } + + protected BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype() { } + + protected BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.subnet, + "subnet cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.interfaceType, + "interfaceType cannot be null"); + allowIpSpoofing = builder.allowIpSpoofing; + enableInfrastructureNat = builder.enableInfrastructureNat; + name = builder.name; + primaryIp = builder.primaryIp; + securityGroups = builder.securityGroups; + subnet = builder.subnet; + interfaceType = builder.interfaceType; + } + + /** + * New builder. + * + * @return a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype.java index 900b9dce77..0b162ad948 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype.java @@ -26,6 +26,7 @@ public class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInter * - Has an `allowed_vlans` property which controls the VLANs that will be permitted * to use the PCI interface * - Cannot directly use an IEEE 802.1q VLAN tag. + * - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. */ public interface InterfaceType { /** pci. */ @@ -46,6 +47,11 @@ public static class Builder { private List allowedVlans; private String interfaceType; + /** + * Instantiates a new Builder from an existing BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype instance. + * + * @param bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype the instance to initialize the Builder with + */ public Builder(BareMetalServerNetworkInterfacePrototype bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype) { this.allowIpSpoofing = bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype.allowIpSpoofing; this.enableInfrastructureNat = bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype.enableInfrastructureNat; @@ -206,6 +212,8 @@ public Builder interfaceType(String interfaceType) { } } + protected BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype() { } + protected BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.subnet, "subnet cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.java index 32f06adae0..2d28ea2cab 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.java @@ -26,6 +26,7 @@ public class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInter * - Must use an IEEE 802.1q tag. * - Has its own security groups and does not inherit those of the PCI device through * which traffic flows. + * - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. */ public interface InterfaceType { /** vlan. */ @@ -47,6 +48,11 @@ public static class Builder { private String interfaceType; private Long vlan; + /** + * Instantiates a new Builder from an existing BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype instance. + * + * @param bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype the instance to initialize the Builder with + */ public Builder(BareMetalServerNetworkInterfacePrototype bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype) { this.allowIpSpoofing = bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype.allowIpSpoofing; this.enableInfrastructureNat = bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype.enableInfrastructureNat; @@ -204,6 +210,8 @@ public Builder vlan(long vlan) { } } + protected BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype() { } + protected BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.subnet, "subnet cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacesPager.java new file mode 100644 index 0000000000..48db800958 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * BareMetalServerNetworkInterfacesPager can be used to simplify the use of the "listBareMetalServerNetworkInterfaces" method. + */ +public class BareMetalServerNetworkInterfacesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListBareMetalServerNetworkInterfacesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected BareMetalServerNetworkInterfacesPager() { } + + /** + * Constructs a new BareMetalServerNetworkInterfacesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listBareMetalServerNetworkInterfaces" method + * @param options the ListBareMetalServerNetworkInterfacesOptions instance to be used to invoke the "listBareMetalServerNetworkInterfaces" method + */ + public BareMetalServerNetworkInterfacesPager(Vpc client, ListBareMetalServerNetworkInterfacesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<BareMetalServerNetworkInterface> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListBareMetalServerNetworkInterfacesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + BareMetalServerNetworkInterfaceCollection result = client.listBareMetalServerNetworkInterfaces(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getNetworkInterfaces(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<BareMetalServerNetworkInterface> containing all results returned by the "listBareMetalServerNetworkInterfaces" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPatch.java index 1df0126c1f..8ed273e0cd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPatch.java @@ -30,6 +30,11 @@ public class BareMetalServerPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing BareMetalServerPatch instance. + * + * @param bareMetalServerPatch the instance to initialize the Builder with + */ private Builder(BareMetalServerPatch bareMetalServerPatch) { this.name = bareMetalServerPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected BareMetalServerPatch() { } + protected BareMetalServerPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrimaryNetworkInterfacePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrimaryNetworkInterfacePrototype.java index f3d86f440f..fb6fa07f35 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrimaryNetworkInterfacePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrimaryNetworkInterfacePrototype.java @@ -25,13 +25,19 @@ public class BareMetalServerPrimaryNetworkInterfacePrototype extends GenericMode /** * The network interface type: + * - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity + * within a `s390x` based system. + * - Not supported on bare metal servers with a `cpu.architecture` of `amd64` * - `pci`: a physical PCI device which can only be created or deleted when the bare metal * server is stopped * - Has an `allowed_vlans` property which controls the VLANs that will be permitted * to use the PCI interface * - Cannot directly use an IEEE 802.1q VLAN tag. + * - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. */ public interface InterfaceType { + /** hipersocket. */ + String HIPERSOCKET = "hipersocket"; /** pci. */ String PCI = "pci"; } @@ -64,6 +70,11 @@ public static class Builder { private List securityGroups; private SubnetIdentity subnet; + /** + * Instantiates a new Builder from an existing BareMetalServerPrimaryNetworkInterfacePrototype instance. + * + * @param bareMetalServerPrimaryNetworkInterfacePrototype the instance to initialize the Builder with + */ private Builder(BareMetalServerPrimaryNetworkInterfacePrototype bareMetalServerPrimaryNetworkInterfacePrototype) { this.allowIpSpoofing = bareMetalServerPrimaryNetworkInterfacePrototype.allowIpSpoofing; this.allowedVlans = bareMetalServerPrimaryNetworkInterfacePrototype.allowedVlans; @@ -222,6 +233,8 @@ public Builder subnet(SubnetIdentity subnet) { } } + protected BareMetalServerPrimaryNetworkInterfacePrototype() { } + protected BareMetalServerPrimaryNetworkInterfacePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.subnet, "subnet cannot be null"); @@ -259,8 +272,7 @@ public Boolean allowIpSpoofing() { /** * Gets the allowedVlans. * - * Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be - * in the `allowed_vlans` array for one PCI type adapter per bare metal server. + * Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. * * @return the allowedVlans */ @@ -276,11 +288,13 @@ public List allowedVlans() { * - A single floating IP can be assigned to the network interface. * * If `false`: - * - Packets are passed unmodified to/from the network interface, + * - Packets are passed unchanged to/from the network interface, * allowing the workload to perform any needed NAT operations. * - Multiple floating IPs can be assigned to the network interface. * - `allow_ip_spoofing` must be set to `false`. * + * This must be `true` when `interface_type` is `hipersocket`. + * * @return the enableInfrastructureNat */ public Boolean enableInfrastructureNat() { @@ -291,11 +305,15 @@ public Boolean enableInfrastructureNat() { * Gets the interfaceType. * * The network interface type: + * - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity + * within a `s390x` based system. + * - Not supported on bare metal servers with a `cpu.architecture` of `amd64` * - `pci`: a physical PCI device which can only be created or deleted when the bare metal * server is stopped * - Has an `allowed_vlans` property which controls the VLANs that will be permitted * to use the PCI interface * - Cannot directly use an IEEE 802.1q VLAN tag. + * - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. * * @return the interfaceType */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfile.java index 623680be65..6376f7cd4f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfile.java @@ -49,6 +49,8 @@ public interface ResourceType { @SerializedName("supported_trusted_platform_module_modes") protected BareMetalServerProfileSupportedTrustedPlatformModuleModes supportedTrustedPlatformModuleModes; + protected BareMetalServerProfile() { } + /** * Gets the bandwidth. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidth.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidth.java index 46360ac4a4..2e2a9a68d5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidth.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidth.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected BareMetalServerProfileBandwidth() { - } + protected BareMetalServerProfileBandwidth() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthDependent.java index 9305be26a3..435fa29e52 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthDependent.java @@ -26,5 +26,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected BareMetalServerProfileBandwidthDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthEnum.java index 839358c32b..7fba5170e4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthEnum.java @@ -26,5 +26,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected BareMetalServerProfileBandwidthEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthFixed.java index b126b495a6..16849fb061 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthFixed.java @@ -26,5 +26,7 @@ public interface Type { String FIXED = "fixed"; } + + protected BareMetalServerProfileBandwidthFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthRange.java index 5395d683ee..983d80d890 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileBandwidthRange.java @@ -26,5 +26,7 @@ public interface Type { String RANGE = "range"; } + + protected BareMetalServerProfileBandwidthRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUArchitecture.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUArchitecture.java index c441459f4d..eadd139c8f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUArchitecture.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUArchitecture.java @@ -33,6 +33,8 @@ public interface Type { protected String type; protected String value; + protected BareMetalServerProfileCPUArchitecture() { } + /** * Gets the xDefault. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCount.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCount.java index 8410d61292..709e84ba24 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCount.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCount.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected BareMetalServerProfileCPUCoreCount() { - } + protected BareMetalServerProfileCPUCoreCount() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountDependent.java index 5cec69620e..e69d9a83d9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected BareMetalServerProfileCPUCoreCountDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountEnum.java index e0dbe63e0c..d58a33f13a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected BareMetalServerProfileCPUCoreCountEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountFixed.java index 5d86fb7098..abf3c7e124 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected BareMetalServerProfileCPUCoreCountFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountRange.java index a69df2789c..810cbca1a7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUCoreCountRange.java @@ -25,5 +25,7 @@ public interface Type { String RANGE = "range"; } + + protected BareMetalServerProfileCPUCoreCountRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCount.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCount.java index 92cb7968ee..f75f425881 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCount.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCount.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected BareMetalServerProfileCPUSocketCount() { - } + protected BareMetalServerProfileCPUSocketCount() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountDependent.java index 3708b9558b..b4d04152d4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected BareMetalServerProfileCPUSocketCountDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountEnum.java index c16f050827..482929650a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected BareMetalServerProfileCPUSocketCountEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountFixed.java index 0b2bbe26e4..5c68e18a55 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected BareMetalServerProfileCPUSocketCountFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountRange.java index a565a9f32c..718afbd6bf 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCPUSocketCountRange.java @@ -25,5 +25,7 @@ public interface Type { String RANGE = "range"; } + + protected BareMetalServerProfileCPUSocketCountRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollection.java index b7a8084990..f02a8fc8e1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollection.java @@ -29,6 +29,8 @@ public class BareMetalServerProfileCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected BareMetalServerProfileCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollectionFirst.java index 848c0b83a9..d5afeb1839 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollectionFirst.java @@ -21,6 +21,8 @@ public class BareMetalServerProfileCollectionFirst extends GenericModel { protected String href; + protected BareMetalServerProfileCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollectionNext.java index 8001e65e68..7bdd8eed5d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollectionNext.java @@ -21,6 +21,8 @@ public class BareMetalServerProfileCollectionNext extends GenericModel { protected String href; + protected BareMetalServerProfileCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDisk.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDisk.java index 9c8571fb16..2efa793209 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDisk.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDisk.java @@ -25,6 +25,8 @@ public class BareMetalServerProfileDisk extends GenericModel { @SerializedName("supported_interface_types") protected BareMetalServerProfileDiskSupportedInterfaces supportedInterfaceTypes; + protected BareMetalServerProfileDisk() { } + /** * Gets the quantity. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantity.java index a906732371..f27ef506c9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantity.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected BareMetalServerProfileDiskQuantity() { - } + protected BareMetalServerProfileDiskQuantity() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityDependent.java index e5b96d63d6..93d573004c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityDependent.java @@ -26,5 +26,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected BareMetalServerProfileDiskQuantityDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityEnum.java index a51c153899..d7d136867e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected BareMetalServerProfileDiskQuantityEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityFixed.java index 155a050239..3762b4537d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected BareMetalServerProfileDiskQuantityFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityRange.java index 0796f4961e..fec2ea82ac 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskQuantityRange.java @@ -25,5 +25,7 @@ public interface Type { String RANGE = "range"; } + + protected BareMetalServerProfileDiskQuantityRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSize.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSize.java index ab5b94983f..c1f7a10160 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSize.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSize.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected BareMetalServerProfileDiskSize() { - } + protected BareMetalServerProfileDiskSize() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeDependent.java index 54220c93d6..d86dc6a20d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeDependent.java @@ -26,5 +26,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected BareMetalServerProfileDiskSizeDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeEnum.java index f85d29f201..a0c6fc9990 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected BareMetalServerProfileDiskSizeEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeFixed.java index 451b78a7e9..de924080d5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected BareMetalServerProfileDiskSizeFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeRange.java index c25d53a98c..a51cf4015a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSizeRange.java @@ -26,5 +26,7 @@ public interface Type { String RANGE = "range"; } + + protected BareMetalServerProfileDiskSizeRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSupportedInterfaces.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSupportedInterfaces.java index ea9652bb13..3b43925e4d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSupportedInterfaces.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskSupportedInterfaces.java @@ -25,11 +25,17 @@ public class BareMetalServerProfileDiskSupportedInterfaces extends GenericModel /** * The disk interface used for attaching the disk. * + * - `fcp`: Attached using Fiber Channel Protocol + * - `sata`: Attached using Serial Advanced Technology Attachment + * - `nvme`: Attached using Non-Volatile Memory Express + * * The enumerated values for this property are expected to expand in the future. When processing this property, check * for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the * unexpected property value was encountered. */ public interface XDefault { + /** fcp. */ + String FCP = "fcp"; /** nvme. */ String NVME = "nvme"; /** sata. */ @@ -47,11 +53,17 @@ public interface Type { /** * The disk interface used for attaching the disk. * + * - `fcp`: Attached using Fiber Channel Protocol + * - `sata`: Attached using Serial Advanced Technology Attachment + * - `nvme`: Attached using Non-Volatile Memory Express + * * The enumerated values for this property are expected to expand in the future. When processing this property, check * for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the * unexpected property value was encountered. */ public interface Values { + /** fcp. */ + String FCP = "fcp"; /** nvme. */ String NVME = "nvme"; /** sata. */ @@ -63,11 +75,17 @@ public interface Values { protected String type; protected List values; + protected BareMetalServerProfileDiskSupportedInterfaces() { } + /** * Gets the xDefault. * * The disk interface used for attaching the disk. * + * - `fcp`: Attached using Fiber Channel Protocol + * - `sata`: Attached using Serial Advanced Technology Attachment + * - `nvme`: Attached using Non-Volatile Memory Express + * * The enumerated values for this property are expected to expand in the future. When processing this property, check * for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the * unexpected property value was encountered. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileIdentity.java index 400d5f11e0..fdc6ca8bd7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileIdentity.java @@ -26,8 +26,7 @@ public class BareMetalServerProfileIdentity extends GenericModel { protected String name; protected String href; - protected BareMetalServerProfileIdentity() { - } + protected BareMetalServerProfileIdentity() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileIdentityByHref.java index 979afa413a..ba239f2036 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileIdentityByHref.java @@ -24,6 +24,11 @@ public class BareMetalServerProfileIdentityByHref extends BareMetalServerProfile public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing BareMetalServerProfileIdentityByHref instance. + * + * @param bareMetalServerProfileIdentityByHref the instance to initialize the Builder with + */ public Builder(BareMetalServerProfileIdentity bareMetalServerProfileIdentityByHref) { this.href = bareMetalServerProfileIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected BareMetalServerProfileIdentityByHref() { } + protected BareMetalServerProfileIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileIdentityByName.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileIdentityByName.java index 5a38e83904..270595294c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileIdentityByName.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileIdentityByName.java @@ -24,6 +24,11 @@ public class BareMetalServerProfileIdentityByName extends BareMetalServerProfile public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing BareMetalServerProfileIdentityByName instance. + * + * @param bareMetalServerProfileIdentityByName the instance to initialize the Builder with + */ public Builder(BareMetalServerProfileIdentity bareMetalServerProfileIdentityByName) { this.name = bareMetalServerProfileIdentityByName.name; } @@ -64,6 +69,8 @@ public Builder name(String name) { } } + protected BareMetalServerProfileIdentityByName() { } + protected BareMetalServerProfileIdentityByName(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemory.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemory.java index 935d5cb092..f9e1f46588 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemory.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemory.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected BareMetalServerProfileMemory() { - } + protected BareMetalServerProfileMemory() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryDependent.java index e4b8b4ff63..a636680f1c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected BareMetalServerProfileMemoryDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryEnum.java index 8e04a62e18..96e694f6ac 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected BareMetalServerProfileMemoryEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryFixed.java index df95240fb0..9c4e3e491a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected BareMetalServerProfileMemoryFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryRange.java index 72d4befc95..96e354dbca 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileMemoryRange.java @@ -25,5 +25,7 @@ public interface Type { String RANGE = "range"; } + + protected BareMetalServerProfileMemoryRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileOSArchitecture.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileOSArchitecture.java index 7c9a7aeedb..02ead05d85 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileOSArchitecture.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileOSArchitecture.java @@ -35,6 +35,8 @@ public interface Type { protected String type; protected List values; + protected BareMetalServerProfileOSArchitecture() { } + /** * Gets the xDefault. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileReference.java index 92bfd5e462..8132e08634 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileReference.java @@ -33,6 +33,8 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected BareMetalServerProfileReference() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileSupportedTrustedPlatformModuleModes.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileSupportedTrustedPlatformModuleModes.java index d79b2f6ff1..1f4eabcf72 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileSupportedTrustedPlatformModuleModes.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileSupportedTrustedPlatformModuleModes.java @@ -48,6 +48,8 @@ public interface Values { protected String type; protected List values; + protected BareMetalServerProfileSupportedTrustedPlatformModuleModes() { } + /** * Gets the type. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfilesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfilesPager.java new file mode 100644 index 0000000000..e472ac2d75 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfilesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * BareMetalServerProfilesPager can be used to simplify the use of the "listBareMetalServerProfiles" method. + */ +public class BareMetalServerProfilesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListBareMetalServerProfilesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected BareMetalServerProfilesPager() { } + + /** + * Constructs a new BareMetalServerProfilesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listBareMetalServerProfiles" method + * @param options the ListBareMetalServerProfilesOptions instance to be used to invoke the "listBareMetalServerProfiles" method + */ + public BareMetalServerProfilesPager(Vpc client, ListBareMetalServerProfilesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<BareMetalServerProfile> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListBareMetalServerProfilesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + BareMetalServerProfileCollection result = client.listBareMetalServerProfiles(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getProfiles(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<BareMetalServerProfile> containing all results returned by the "listBareMetalServerProfiles" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerStatusReason.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerStatusReason.java index 6229b42077..172e51852b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerStatusReason.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerStatusReason.java @@ -46,6 +46,8 @@ public interface Code { @SerializedName("more_info") protected String moreInfo; + protected BareMetalServerStatusReason() { } + /** * Gets the code. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerTrustedPlatformModule.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerTrustedPlatformModule.java index d67d270d9a..b3639c2015 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerTrustedPlatformModule.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerTrustedPlatformModule.java @@ -38,6 +38,8 @@ public interface Mode { protected Boolean enabled; protected String mode; + protected BareMetalServerTrustedPlatformModule() { } + /** * Gets the enabled. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServersPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServersPager.java new file mode 100644 index 0000000000..e415ae30c6 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServersPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * BareMetalServersPager can be used to simplify the use of the "listBareMetalServers" method. + */ +public class BareMetalServersPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListBareMetalServersOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected BareMetalServersPager() { } + + /** + * Constructs a new BareMetalServersPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listBareMetalServers" method + * @param options the ListBareMetalServersOptions instance to be used to invoke the "listBareMetalServers" method + */ + public BareMetalServersPager(Vpc client, ListBareMetalServersOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<BareMetalServer> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListBareMetalServersOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + BareMetalServerCollection result = client.listBareMetalServers(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getBareMetalServers(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<BareMetalServer> containing all results returned by the "listBareMetalServers" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingIdentity.java new file mode 100644 index 0000000000..7715881ef1 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingIdentity.java @@ -0,0 +1,42 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * Identifies a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a unique + * property. + * + * Classes which extend this class: + * - CatalogOfferingIdentityCatalogOfferingByCRN + */ +public class CatalogOfferingIdentity extends GenericModel { + + protected String crn; + + protected CatalogOfferingIdentity() { } + + /** + * Gets the crn. + * + * The CRN for this + * [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. + * + * @return the crn + */ + public String crn() { + return crn; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingIdentityCatalogOfferingByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingIdentityCatalogOfferingByCRN.java new file mode 100644 index 0000000000..82036b06cd --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingIdentityCatalogOfferingByCRN.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +/** + * CatalogOfferingIdentityCatalogOfferingByCRN. + */ +public class CatalogOfferingIdentityCatalogOfferingByCRN extends CatalogOfferingIdentity { + + + /** + * Builder. + */ + public static class Builder { + private String crn; + + /** + * Instantiates a new Builder from an existing CatalogOfferingIdentityCatalogOfferingByCRN instance. + * + * @param catalogOfferingIdentityCatalogOfferingByCrn the instance to initialize the Builder with + */ + public Builder(CatalogOfferingIdentity catalogOfferingIdentityCatalogOfferingByCrn) { + this.crn = catalogOfferingIdentityCatalogOfferingByCrn.crn; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param crn the crn + */ + public Builder(String crn) { + this.crn = crn; + } + + /** + * Builds a CatalogOfferingIdentityCatalogOfferingByCRN. + * + * @return the new CatalogOfferingIdentityCatalogOfferingByCRN instance + */ + public CatalogOfferingIdentityCatalogOfferingByCRN build() { + return new CatalogOfferingIdentityCatalogOfferingByCRN(this); + } + + /** + * Set the crn. + * + * @param crn the crn + * @return the CatalogOfferingIdentityCatalogOfferingByCRN builder + */ + public Builder crn(String crn) { + this.crn = crn; + return this; + } + } + + protected CatalogOfferingIdentityCatalogOfferingByCRN() { } + + protected CatalogOfferingIdentityCatalogOfferingByCRN(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, + "crn cannot be null"); + crn = builder.crn; + } + + /** + * New builder. + * + * @return a CatalogOfferingIdentityCatalogOfferingByCRN builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionIdentity.java new file mode 100644 index 0000000000..6f4eefd023 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionIdentity.java @@ -0,0 +1,42 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * Identifies a version of a + * [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a unique property. + * + * Classes which extend this class: + * - CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN + */ +public class CatalogOfferingVersionIdentity extends GenericModel { + + protected String crn; + + protected CatalogOfferingVersionIdentity() { } + + /** + * Gets the crn. + * + * The CRN for this version of a + * [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. + * + * @return the crn + */ + public String crn() { + return crn; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.java new file mode 100644 index 0000000000..5ed6187052 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +/** + * CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN. + */ +public class CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN extends CatalogOfferingVersionIdentity { + + + /** + * Builder. + */ + public static class Builder { + private String crn; + + /** + * Instantiates a new Builder from an existing CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN instance. + * + * @param catalogOfferingVersionIdentityCatalogOfferingVersionByCrn the instance to initialize the Builder with + */ + public Builder(CatalogOfferingVersionIdentity catalogOfferingVersionIdentityCatalogOfferingVersionByCrn) { + this.crn = catalogOfferingVersionIdentityCatalogOfferingVersionByCrn.crn; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param crn the crn + */ + public Builder(String crn) { + this.crn = crn; + } + + /** + * Builds a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN. + * + * @return the new CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN instance + */ + public CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN build() { + return new CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(this); + } + + /** + * Set the crn. + * + * @param crn the crn + * @return the CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN builder + */ + public Builder crn(String crn) { + this.crn = crn; + return this; + } + } + + protected CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN() { } + + protected CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, + "crn cannot be null"); + crn = builder.crn; + } + + /** + * New builder. + * + * @return a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionReference.java new file mode 100644 index 0000000000..10f145df3f --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionReference.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * CatalogOfferingVersionReference. + */ +public class CatalogOfferingVersionReference extends GenericModel { + + protected String crn; + + protected CatalogOfferingVersionReference() { } + + /** + * Gets the crn. + * + * The CRN for this version of a + * [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. + * + * @return the crn + */ + public String getCrn() { + return crn; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CertificateInstanceIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CertificateInstanceIdentity.java index 6e342b54f0..b39585c412 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CertificateInstanceIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CertificateInstanceIdentity.java @@ -24,8 +24,7 @@ public class CertificateInstanceIdentity extends GenericModel { protected String crn; - protected CertificateInstanceIdentity() { - } + protected CertificateInstanceIdentity() { } /** * Gets the crn. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CertificateInstanceIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CertificateInstanceIdentityByCRN.java index 804b474be9..8640bd1954 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CertificateInstanceIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CertificateInstanceIdentityByCRN.java @@ -24,6 +24,11 @@ public class CertificateInstanceIdentityByCRN extends CertificateInstanceIdentit public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing CertificateInstanceIdentityByCRN instance. + * + * @param certificateInstanceIdentityByCrn the instance to initialize the Builder with + */ public Builder(CertificateInstanceIdentity certificateInstanceIdentityByCrn) { this.crn = certificateInstanceIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected CertificateInstanceIdentityByCRN() { } + protected CertificateInstanceIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CertificateInstanceReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CertificateInstanceReference.java index bff69bc54f..38f4704947 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CertificateInstanceReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CertificateInstanceReference.java @@ -21,6 +21,8 @@ public class CertificateInstanceReference extends GenericModel { protected String crn; + protected CertificateInstanceReference() { } + /** * Gets the crn. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayConnectionLocalCidrOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayConnectionLocalCidrOptions.java index 8f1dffc346..1097cd2932 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayConnectionLocalCidrOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayConnectionLocalCidrOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String cidrPrefix; private String prefixLength; + /** + * Instantiates a new Builder from an existing CheckVpnGatewayConnectionLocalCidrOptions instance. + * + * @param checkVpnGatewayConnectionLocalCidrOptions the instance to initialize the Builder with + */ private Builder(CheckVpnGatewayConnectionLocalCidrOptions checkVpnGatewayConnectionLocalCidrOptions) { this.vpnGatewayId = checkVpnGatewayConnectionLocalCidrOptions.vpnGatewayId; this.id = checkVpnGatewayConnectionLocalCidrOptions.id; @@ -115,6 +120,8 @@ public Builder prefixLength(String prefixLength) { } } + protected CheckVpnGatewayConnectionLocalCidrOptions() { } + protected CheckVpnGatewayConnectionLocalCidrOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, "vpnGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayConnectionPeerCidrOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayConnectionPeerCidrOptions.java index 39251bf614..91d4683607 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayConnectionPeerCidrOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayConnectionPeerCidrOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String cidrPrefix; private String prefixLength; + /** + * Instantiates a new Builder from an existing CheckVpnGatewayConnectionPeerCidrOptions instance. + * + * @param checkVpnGatewayConnectionPeerCidrOptions the instance to initialize the Builder with + */ private Builder(CheckVpnGatewayConnectionPeerCidrOptions checkVpnGatewayConnectionPeerCidrOptions) { this.vpnGatewayId = checkVpnGatewayConnectionPeerCidrOptions.vpnGatewayId; this.id = checkVpnGatewayConnectionPeerCidrOptions.id; @@ -115,6 +120,8 @@ public Builder prefixLength(String prefixLength) { } } + protected CheckVpnGatewayConnectionPeerCidrOptions() { } + protected CheckVpnGatewayConnectionPeerCidrOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, "vpnGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyOptions.java index 51acccd91f..879a7d87d6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyOptions.java @@ -46,6 +46,11 @@ public static class Builder { private List plans; private ResourceGroupIdentity resourceGroup; + /** + * Instantiates a new Builder from an existing CreateBackupPolicyOptions instance. + * + * @param createBackupPolicyOptions the instance to initialize the Builder with + */ private Builder(CreateBackupPolicyOptions createBackupPolicyOptions) { this.matchResourceTypes = createBackupPolicyOptions.matchResourceTypes; this.matchUserTags = createBackupPolicyOptions.matchUserTags; @@ -176,6 +181,8 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { } } + protected CreateBackupPolicyOptions() { } + protected CreateBackupPolicyOptions(Builder builder) { matchResourceTypes = builder.matchResourceTypes; matchUserTags = builder.matchUserTags; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptions.java index 15e479e151..9984b0b78f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptions.java @@ -42,6 +42,11 @@ public static class Builder { private BackupPolicyPlanDeletionTriggerPrototype deletionTrigger; private String name; + /** + * Instantiates a new Builder from an existing CreateBackupPolicyPlanOptions instance. + * + * @param createBackupPolicyPlanOptions the instance to initialize the Builder with + */ private Builder(CreateBackupPolicyPlanOptions createBackupPolicyPlanOptions) { this.backupPolicyId = createBackupPolicyPlanOptions.backupPolicyId; this.cronSpec = createBackupPolicyPlanOptions.cronSpec; @@ -173,6 +178,8 @@ public Builder name(String name) { } } + protected CreateBackupPolicyPlanOptions() { } + protected CreateBackupPolicyPlanOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.backupPolicyId, "backupPolicyId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerConsoleAccessTokenOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerConsoleAccessTokenOptions.java index 4564a710d9..31b20867a1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerConsoleAccessTokenOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerConsoleAccessTokenOptions.java @@ -20,7 +20,9 @@ public class CreateBareMetalServerConsoleAccessTokenOptions extends GenericModel { /** - * The bare metal server console type for which this token may be used. + * The bare metal server console type for which this token may be used + * + * Must be `serial` for bare metal servers with a `cpu.architecture` of `s390x`. */ public interface ConsoleType { /** serial. */ @@ -41,6 +43,11 @@ public static class Builder { private String consoleType; private Boolean force; + /** + * Instantiates a new Builder from an existing CreateBareMetalServerConsoleAccessTokenOptions instance. + * + * @param createBareMetalServerConsoleAccessTokenOptions the instance to initialize the Builder with + */ private Builder(CreateBareMetalServerConsoleAccessTokenOptions createBareMetalServerConsoleAccessTokenOptions) { this.bareMetalServerId = createBareMetalServerConsoleAccessTokenOptions.bareMetalServerId; this.consoleType = createBareMetalServerConsoleAccessTokenOptions.consoleType; @@ -107,6 +114,8 @@ public Builder force(Boolean force) { } } + protected CreateBareMetalServerConsoleAccessTokenOptions() { } + protected CreateBareMetalServerConsoleAccessTokenOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); @@ -140,7 +149,9 @@ public String bareMetalServerId() { /** * Gets the consoleType. * - * The bare metal server console type for which this token may be used. + * The bare metal server console type for which this token may be used + * + * Must be `serial` for bare metal servers with a `cpu.architecture` of `s390x`. * * @return the consoleType */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerNetworkInterfaceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerNetworkInterfaceOptions.java index 30222bb1da..4933d879b0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerNetworkInterfaceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerNetworkInterfaceOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String bareMetalServerId; private BareMetalServerNetworkInterfacePrototype bareMetalServerNetworkInterfacePrototype; + /** + * Instantiates a new Builder from an existing CreateBareMetalServerNetworkInterfaceOptions instance. + * + * @param createBareMetalServerNetworkInterfaceOptions the instance to initialize the Builder with + */ private Builder(CreateBareMetalServerNetworkInterfaceOptions createBareMetalServerNetworkInterfaceOptions) { this.bareMetalServerId = createBareMetalServerNetworkInterfaceOptions.bareMetalServerId; this.bareMetalServerNetworkInterfacePrototype = createBareMetalServerNetworkInterfaceOptions.bareMetalServerNetworkInterfacePrototype; @@ -83,6 +88,8 @@ public Builder bareMetalServerNetworkInterfacePrototype(BareMetalServerNetworkIn } } + protected CreateBareMetalServerNetworkInterfaceOptions() { } + protected CreateBareMetalServerNetworkInterfaceOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerOptions.java index 09aaaac58c..55f8b4528d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerOptions.java @@ -44,6 +44,11 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private VPCIdentity vpc; + /** + * Instantiates a new Builder from an existing CreateBareMetalServerOptions instance. + * + * @param createBareMetalServerOptions the instance to initialize the Builder with + */ private Builder(CreateBareMetalServerOptions createBareMetalServerOptions) { this.initialization = createBareMetalServerOptions.initialization; this.primaryNetworkInterface = createBareMetalServerOptions.primaryNetworkInterface; @@ -191,6 +196,8 @@ public Builder vpc(VPCIdentity vpc) { } } + protected CreateBareMetalServerOptions() { } + protected CreateBareMetalServerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.initialization, "initialization cannot be null"); @@ -242,7 +249,8 @@ public BareMetalServerPrimaryNetworkInterfacePrototype primaryNetworkInterface() /** * Gets the profile. * - * The profile to use for this bare metal server. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + * to use for this bare metal server. * * @return the profile */ @@ -299,8 +307,10 @@ public ResourceGroupIdentity resourceGroup() { /** * Gets the vpc. * - * The VPC the bare metal server is to be a part of. If specified, it must match the - * VPC referenced by the subnets of the server's network interfaces. + * The VPC this bare metal server will reside in. + * + * If specified, it must match the VPC for the subnets of the server's network + * interfaces. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateDedicatedHostGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateDedicatedHostGroupOptions.java index 45fbd5f68b..74a7693c4b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateDedicatedHostGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateDedicatedHostGroupOptions.java @@ -47,6 +47,11 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private ZoneIdentity zone; + /** + * Instantiates a new Builder from an existing CreateDedicatedHostGroupOptions instance. + * + * @param createDedicatedHostGroupOptions the instance to initialize the Builder with + */ private Builder(CreateDedicatedHostGroupOptions createDedicatedHostGroupOptions) { this.xClass = createDedicatedHostGroupOptions.xClass; this.family = createDedicatedHostGroupOptions.family; @@ -126,6 +131,8 @@ public Builder zone(ZoneIdentity zone) { } } + protected CreateDedicatedHostGroupOptions() { } + protected CreateDedicatedHostGroupOptions(Builder builder) { xClass = builder.xClass; family = builder.family; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateDedicatedHostOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateDedicatedHostOptions.java index 41cf95cef9..2fe5c8da69 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateDedicatedHostOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateDedicatedHostOptions.java @@ -27,6 +27,11 @@ public class CreateDedicatedHostOptions extends GenericModel { public static class Builder { private DedicatedHostPrototype dedicatedHostPrototype; + /** + * Instantiates a new Builder from an existing CreateDedicatedHostOptions instance. + * + * @param createDedicatedHostOptions the instance to initialize the Builder with + */ private Builder(CreateDedicatedHostOptions createDedicatedHostOptions) { this.dedicatedHostPrototype = createDedicatedHostOptions.dedicatedHostPrototype; } @@ -67,6 +72,8 @@ public Builder dedicatedHostPrototype(DedicatedHostPrototype dedicatedHostProtot } } + protected CreateDedicatedHostOptions() { } + protected CreateDedicatedHostOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.dedicatedHostPrototype, "dedicatedHostPrototype cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptions.java index 37bd1d06cf..eb56390389 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptions.java @@ -40,6 +40,11 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private List securityGroups; + /** + * Instantiates a new Builder from an existing CreateEndpointGatewayOptions instance. + * + * @param createEndpointGatewayOptions the instance to initialize the Builder with + */ private Builder(CreateEndpointGatewayOptions createEndpointGatewayOptions) { this.target = createEndpointGatewayOptions.target; this.vpc = createEndpointGatewayOptions.vpc; @@ -176,6 +181,8 @@ public Builder securityGroups(List securityGroups) { } } + protected CreateEndpointGatewayOptions() { } + protected CreateEndpointGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.target, "target cannot be null"); @@ -201,7 +208,8 @@ public Builder newBuilder() { /** * Gets the target. * - * The target for this endpoint gateway. + * The target to use for this endpoint gateway. Must not already be the target of another + * endpoint gateway in the VPC. * * @return the target */ @@ -212,7 +220,7 @@ public EndpointGatewayTargetPrototype target() { /** * Gets the vpc. * - * The VPC this endpoint gateway will serve. + * The VPC this endpoint gateway will reside in. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateFloatingIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateFloatingIpOptions.java index 5414484c6c..29e76a17bc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateFloatingIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateFloatingIpOptions.java @@ -27,6 +27,11 @@ public class CreateFloatingIpOptions extends GenericModel { public static class Builder { private FloatingIPPrototype floatingIpPrototype; + /** + * Instantiates a new Builder from an existing CreateFloatingIpOptions instance. + * + * @param createFloatingIpOptions the instance to initialize the Builder with + */ private Builder(CreateFloatingIpOptions createFloatingIpOptions) { this.floatingIpPrototype = createFloatingIpOptions.floatingIpPrototype; } @@ -67,6 +72,8 @@ public Builder floatingIpPrototype(FloatingIPPrototype floatingIpPrototype) { } } + protected CreateFloatingIpOptions() { } + protected CreateFloatingIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.floatingIpPrototype, "floatingIpPrototype cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateFlowLogCollectorOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateFlowLogCollectorOptions.java index 20d99506c4..b649219a20 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateFlowLogCollectorOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateFlowLogCollectorOptions.java @@ -35,6 +35,11 @@ public static class Builder { private String name; private ResourceGroupIdentity resourceGroup; + /** + * Instantiates a new Builder from an existing CreateFlowLogCollectorOptions instance. + * + * @param createFlowLogCollectorOptions the instance to initialize the Builder with + */ private Builder(CreateFlowLogCollectorOptions createFlowLogCollectorOptions) { this.storageBucket = createFlowLogCollectorOptions.storageBucket; this.target = createFlowLogCollectorOptions.target; @@ -125,6 +130,8 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { } } + protected CreateFlowLogCollectorOptions() { } + protected CreateFlowLogCollectorOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.storageBucket, "storageBucket cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIkePolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIkePolicyOptions.java index ac6ee81853..c211e43cd6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIkePolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIkePolicyOptions.java @@ -20,7 +20,9 @@ public class CreateIkePolicyOptions extends GenericModel { /** - * The authentication algorithm. + * The authentication algorithm + * + * The `md5` and `sha1` algorithms have been deprecated. */ public interface AuthenticationAlgorithm { /** md5. */ @@ -29,16 +31,22 @@ public interface AuthenticationAlgorithm { String SHA1 = "sha1"; /** sha256. */ String SHA256 = "sha256"; + /** sha384. */ + String SHA384 = "sha384"; /** sha512. */ String SHA512 = "sha512"; } /** - * The encryption algorithm. + * The encryption algorithm + * + * The `triple_des` algorithm has been deprecated. */ public interface EncryptionAlgorithm { /** aes128. */ String AES128 = "aes128"; + /** aes192. */ + String AES192 = "aes192"; /** aes256. */ String AES256 = "aes256"; /** triple_des. */ @@ -65,6 +73,11 @@ public static class Builder { private String name; private ResourceGroupIdentity resourceGroup; + /** + * Instantiates a new Builder from an existing CreateIkePolicyOptions instance. + * + * @param createIkePolicyOptions the instance to initialize the Builder with + */ private Builder(CreateIkePolicyOptions createIkePolicyOptions) { this.authenticationAlgorithm = createIkePolicyOptions.authenticationAlgorithm; this.dhGroup = createIkePolicyOptions.dhGroup; @@ -183,6 +196,8 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { } } + protected CreateIkePolicyOptions() { } + protected CreateIkePolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.authenticationAlgorithm, "authenticationAlgorithm cannot be null"); @@ -213,7 +228,9 @@ public Builder newBuilder() { /** * Gets the authenticationAlgorithm. * - * The authentication algorithm. + * The authentication algorithm + * + * The `md5` and `sha1` algorithms have been deprecated. * * @return the authenticationAlgorithm */ @@ -224,7 +241,9 @@ public String authenticationAlgorithm() { /** * Gets the dhGroup. * - * The Diffie-Hellman group. + * The Diffie-Hellman group + * + * Groups `2` and `5` have been deprecated. * * @return the dhGroup */ @@ -235,7 +254,9 @@ public Long dhGroup() { /** * Gets the encryptionAlgorithm. * - * The encryption algorithm. + * The encryption algorithm + * + * The `triple_des` algorithm has been deprecated. * * @return the encryptionAlgorithm */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateImageOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateImageOptions.java index e4aaa793a0..e8a3e660b8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateImageOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateImageOptions.java @@ -27,6 +27,11 @@ public class CreateImageOptions extends GenericModel { public static class Builder { private ImagePrototype imagePrototype; + /** + * Instantiates a new Builder from an existing CreateImageOptions instance. + * + * @param createImageOptions the instance to initialize the Builder with + */ private Builder(CreateImageOptions createImageOptions) { this.imagePrototype = createImageOptions.imagePrototype; } @@ -67,6 +72,8 @@ public Builder imagePrototype(ImagePrototype imagePrototype) { } } + protected CreateImageOptions() { } + protected CreateImageOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.imagePrototype, "imagePrototype cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceActionOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceActionOptions.java index bae99edaf2..917b584047 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceActionOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceActionOptions.java @@ -43,6 +43,11 @@ public static class Builder { private String type; private Boolean force; + /** + * Instantiates a new Builder from an existing CreateInstanceActionOptions instance. + * + * @param createInstanceActionOptions the instance to initialize the Builder with + */ private Builder(CreateInstanceActionOptions createInstanceActionOptions) { this.instanceId = createInstanceActionOptions.instanceId; this.type = createInstanceActionOptions.type; @@ -109,6 +114,8 @@ public Builder force(Boolean force) { } } + protected CreateInstanceActionOptions() { } + protected CreateInstanceActionOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceConsoleAccessTokenOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceConsoleAccessTokenOptions.java index 67be1a51cc..e8f318ed7d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceConsoleAccessTokenOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceConsoleAccessTokenOptions.java @@ -41,6 +41,11 @@ public static class Builder { private String consoleType; private Boolean force; + /** + * Instantiates a new Builder from an existing CreateInstanceConsoleAccessTokenOptions instance. + * + * @param createInstanceConsoleAccessTokenOptions the instance to initialize the Builder with + */ private Builder(CreateInstanceConsoleAccessTokenOptions createInstanceConsoleAccessTokenOptions) { this.instanceId = createInstanceConsoleAccessTokenOptions.instanceId; this.consoleType = createInstanceConsoleAccessTokenOptions.consoleType; @@ -107,6 +112,8 @@ public Builder force(Boolean force) { } } + protected CreateInstanceConsoleAccessTokenOptions() { } + protected CreateInstanceConsoleAccessTokenOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerActionOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerActionOptions.java index bf9f68ce21..945c664df7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerActionOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerActionOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String instanceGroupManagerId; private InstanceGroupManagerActionPrototype instanceGroupManagerActionPrototype; + /** + * Instantiates a new Builder from an existing CreateInstanceGroupManagerActionOptions instance. + * + * @param createInstanceGroupManagerActionOptions the instance to initialize the Builder with + */ private Builder(CreateInstanceGroupManagerActionOptions createInstanceGroupManagerActionOptions) { this.instanceGroupId = createInstanceGroupManagerActionOptions.instanceGroupId; this.instanceGroupManagerId = createInstanceGroupManagerActionOptions.instanceGroupManagerId; @@ -99,6 +104,8 @@ public Builder instanceGroupManagerActionPrototype(InstanceGroupManagerActionPro } } + protected CreateInstanceGroupManagerActionOptions() { } + protected CreateInstanceGroupManagerActionOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerOptions.java index a0b6490332..70fc8fe9d1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String instanceGroupId; private InstanceGroupManagerPrototype instanceGroupManagerPrototype; + /** + * Instantiates a new Builder from an existing CreateInstanceGroupManagerOptions instance. + * + * @param createInstanceGroupManagerOptions the instance to initialize the Builder with + */ private Builder(CreateInstanceGroupManagerOptions createInstanceGroupManagerOptions) { this.instanceGroupId = createInstanceGroupManagerOptions.instanceGroupId; this.instanceGroupManagerPrototype = createInstanceGroupManagerOptions.instanceGroupManagerPrototype; @@ -83,6 +88,8 @@ public Builder instanceGroupManagerPrototype(InstanceGroupManagerPrototype insta } } + protected CreateInstanceGroupManagerOptions() { } + protected CreateInstanceGroupManagerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerPolicyOptions.java index 2e73fa37c3..bb0f62cc44 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerPolicyOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String instanceGroupManagerId; private InstanceGroupManagerPolicyPrototype instanceGroupManagerPolicyPrototype; + /** + * Instantiates a new Builder from an existing CreateInstanceGroupManagerPolicyOptions instance. + * + * @param createInstanceGroupManagerPolicyOptions the instance to initialize the Builder with + */ private Builder(CreateInstanceGroupManagerPolicyOptions createInstanceGroupManagerPolicyOptions) { this.instanceGroupId = createInstanceGroupManagerPolicyOptions.instanceGroupId; this.instanceGroupManagerId = createInstanceGroupManagerPolicyOptions.instanceGroupManagerId; @@ -99,6 +104,8 @@ public Builder instanceGroupManagerPolicyPrototype(InstanceGroupManagerPolicyPro } } + protected CreateInstanceGroupManagerPolicyOptions() { } + protected CreateInstanceGroupManagerPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupOptions.java index 705e46c6fa..175c4c22a9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupOptions.java @@ -44,6 +44,11 @@ public static class Builder { private String name; private ResourceGroupIdentity resourceGroup; + /** + * Instantiates a new Builder from an existing CreateInstanceGroupOptions instance. + * + * @param createInstanceGroupOptions the instance to initialize the Builder with + */ private Builder(CreateInstanceGroupOptions createInstanceGroupOptions) { this.instanceTemplate = createInstanceGroupOptions.instanceTemplate; this.subnets = createInstanceGroupOptions.subnets; @@ -187,6 +192,8 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { } } + protected CreateInstanceGroupOptions() { } + protected CreateInstanceGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.instanceTemplate, "instanceTemplate cannot be null"); @@ -239,8 +246,9 @@ public List subnets() { /** * Gets the applicationPort. * - * Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to supply - * the port for the load balancer pool member. + * The port to use for new load balancer pool members created by this instance group. + * + * This property must be specified if and only if `load_balancer_pool` has been specified. * * @return the applicationPort */ @@ -251,8 +259,10 @@ public Long applicationPort() { /** * Gets the loadBalancer. * - * The load balancer associated with the specified load balancer pool. - * Required if `load_balancer_pool` is specified. + * The load balancer associated with `load_balancer_pool`. + * + * This property must be specified if and only if `load_balancer_pool` has been + * specified. * * At present, only load balancers in the `application` family are supported. * @@ -265,10 +275,10 @@ public LoadBalancerIdentity loadBalancer() { /** * Gets the loadBalancerPool. * - * If specified, the load balancer pool will be managed by this - * group. Instances created by this group will have a new load - * balancer pool member in that pool created. Must be used with - * `application_port`. + * If specified, the load balancer pool this instance group will manage. A pool member + * will be created for each instance created by this group. + * + * If specified, `load_balancer` and `application_port` must also be specified. * * @return the loadBalancerPool */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceNetworkInterfaceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceNetworkInterfaceOptions.java index 607280beb7..23c3549e36 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceNetworkInterfaceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceNetworkInterfaceOptions.java @@ -40,6 +40,11 @@ public static class Builder { private NetworkInterfaceIPPrototype primaryIp; private List securityGroups; + /** + * Instantiates a new Builder from an existing CreateInstanceNetworkInterfaceOptions instance. + * + * @param createInstanceNetworkInterfaceOptions the instance to initialize the Builder with + */ private Builder(CreateInstanceNetworkInterfaceOptions createInstanceNetworkInterfaceOptions) { this.instanceId = createInstanceNetworkInterfaceOptions.instanceId; this.subnet = createInstanceNetworkInterfaceOptions.subnet; @@ -174,6 +179,8 @@ public Builder networkInterfacePrototype(NetworkInterfacePrototype networkInterf } } + protected CreateInstanceNetworkInterfaceOptions() { } + protected CreateInstanceNetworkInterfaceOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceOptions.java index 84011a0315..91c327904b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceOptions.java @@ -27,6 +27,11 @@ public class CreateInstanceOptions extends GenericModel { public static class Builder { private InstancePrototype instancePrototype; + /** + * Instantiates a new Builder from an existing CreateInstanceOptions instance. + * + * @param createInstanceOptions the instance to initialize the Builder with + */ private Builder(CreateInstanceOptions createInstanceOptions) { this.instancePrototype = createInstanceOptions.instancePrototype; } @@ -67,6 +72,8 @@ public Builder instancePrototype(InstancePrototype instancePrototype) { } } + protected CreateInstanceOptions() { } + protected CreateInstanceOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.instancePrototype, "instancePrototype cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceTemplateOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceTemplateOptions.java index 9a7c257be6..03b67efdb6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceTemplateOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceTemplateOptions.java @@ -27,6 +27,11 @@ public class CreateInstanceTemplateOptions extends GenericModel { public static class Builder { private InstanceTemplatePrototype instanceTemplatePrototype; + /** + * Instantiates a new Builder from an existing CreateInstanceTemplateOptions instance. + * + * @param createInstanceTemplateOptions the instance to initialize the Builder with + */ private Builder(CreateInstanceTemplateOptions createInstanceTemplateOptions) { this.instanceTemplatePrototype = createInstanceTemplateOptions.instanceTemplatePrototype; } @@ -67,6 +72,8 @@ public Builder instanceTemplatePrototype(InstanceTemplatePrototype instanceTempl } } + protected CreateInstanceTemplateOptions() { } + protected CreateInstanceTemplateOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.instanceTemplatePrototype, "instanceTemplatePrototype cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceVolumeAttachmentOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceVolumeAttachmentOptions.java index adb3e2c64a..74ef637935 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceVolumeAttachmentOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceVolumeAttachmentOptions.java @@ -33,6 +33,11 @@ public static class Builder { private Boolean deleteVolumeOnInstanceDelete; private String name; + /** + * Instantiates a new Builder from an existing CreateInstanceVolumeAttachmentOptions instance. + * + * @param createInstanceVolumeAttachmentOptions the instance to initialize the Builder with + */ private Builder(CreateInstanceVolumeAttachmentOptions createInstanceVolumeAttachmentOptions) { this.instanceId = createInstanceVolumeAttachmentOptions.instanceId; this.volume = createInstanceVolumeAttachmentOptions.volume; @@ -111,6 +116,8 @@ public Builder name(String name) { } } + protected CreateInstanceVolumeAttachmentOptions() { } + protected CreateInstanceVolumeAttachmentOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIpsecPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIpsecPolicyOptions.java index 6e6530aebd..cb23db57e4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIpsecPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIpsecPolicyOptions.java @@ -20,43 +20,88 @@ public class CreateIpsecPolicyOptions extends GenericModel { /** - * The authentication algorithm. + * The authentication algorithm + * + * The `md5` and `sha1` algorithms have been deprecated + * + * Must be `disabled` if and only if the `encryption_algorithm` is + * `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. */ public interface AuthenticationAlgorithm { + /** disabled. */ + String DISABLED = "disabled"; /** md5. */ String MD5 = "md5"; /** sha1. */ String SHA1 = "sha1"; /** sha256. */ String SHA256 = "sha256"; + /** sha384. */ + String SHA384 = "sha384"; /** sha512. */ String SHA512 = "sha512"; } /** - * The encryption algorithm. + * The encryption algorithm + * + * The `triple_des` algorithm has been deprecated + * + * The `authentication_algorithm` must be `disabled` if and only if + * `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + * `aes256gcm16`. */ public interface EncryptionAlgorithm { /** aes128. */ String AES128 = "aes128"; + /** aes128gcm16. */ + String AES128GCM16 = "aes128gcm16"; + /** aes192. */ + String AES192 = "aes192"; + /** aes192gcm16. */ + String AES192GCM16 = "aes192gcm16"; /** aes256. */ String AES256 = "aes256"; + /** aes256gcm16. */ + String AES256GCM16 = "aes256gcm16"; /** triple_des. */ String TRIPLE_DES = "triple_des"; } /** - * Perfect Forward Secrecy. + * Perfect Forward Secrecy + * + * Groups `group_2` and `group_5` have been deprecated. */ public interface Pfs { /** disabled. */ String DISABLED = "disabled"; /** group_14. */ String GROUP_14 = "group_14"; + /** group_15. */ + String GROUP_15 = "group_15"; + /** group_16. */ + String GROUP_16 = "group_16"; + /** group_17. */ + String GROUP_17 = "group_17"; + /** group_18. */ + String GROUP_18 = "group_18"; /** group_19. */ String GROUP_19 = "group_19"; /** group_2. */ String GROUP_2 = "group_2"; + /** group_20. */ + String GROUP_20 = "group_20"; + /** group_21. */ + String GROUP_21 = "group_21"; + /** group_22. */ + String GROUP_22 = "group_22"; + /** group_23. */ + String GROUP_23 = "group_23"; + /** group_24. */ + String GROUP_24 = "group_24"; + /** group_31. */ + String GROUP_31 = "group_31"; /** group_5. */ String GROUP_5 = "group_5"; } @@ -79,6 +124,11 @@ public static class Builder { private String name; private ResourceGroupIdentity resourceGroup; + /** + * Instantiates a new Builder from an existing CreateIpsecPolicyOptions instance. + * + * @param createIpsecPolicyOptions the instance to initialize the Builder with + */ private Builder(CreateIpsecPolicyOptions createIpsecPolicyOptions) { this.authenticationAlgorithm = createIpsecPolicyOptions.authenticationAlgorithm; this.encryptionAlgorithm = createIpsecPolicyOptions.encryptionAlgorithm; @@ -183,6 +233,8 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { } } + protected CreateIpsecPolicyOptions() { } + protected CreateIpsecPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.authenticationAlgorithm, "authenticationAlgorithm cannot be null"); @@ -210,7 +262,12 @@ public Builder newBuilder() { /** * Gets the authenticationAlgorithm. * - * The authentication algorithm. + * The authentication algorithm + * + * The `md5` and `sha1` algorithms have been deprecated + * + * Must be `disabled` if and only if the `encryption_algorithm` is + * `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. * * @return the authenticationAlgorithm */ @@ -221,7 +278,13 @@ public String authenticationAlgorithm() { /** * Gets the encryptionAlgorithm. * - * The encryption algorithm. + * The encryption algorithm + * + * The `triple_des` algorithm has been deprecated + * + * The `authentication_algorithm` must be `disabled` if and only if + * `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + * `aes256gcm16`. * * @return the encryptionAlgorithm */ @@ -232,7 +295,9 @@ public String encryptionAlgorithm() { /** * Gets the pfs. * - * Perfect Forward Secrecy. + * Perfect Forward Secrecy + * + * Groups `group_2` and `group_5` have been deprecated. * * @return the pfs */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateKeyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateKeyOptions.java index c0c868bdd0..d092029fc9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateKeyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateKeyOptions.java @@ -41,6 +41,11 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private String type; + /** + * Instantiates a new Builder from an existing CreateKeyOptions instance. + * + * @param createKeyOptions the instance to initialize the Builder with + */ private Builder(CreateKeyOptions createKeyOptions) { this.publicKey = createKeyOptions.publicKey; this.name = createKeyOptions.name; @@ -117,6 +122,8 @@ public Builder type(String type) { } } + protected CreateKeyOptions() { } + protected CreateKeyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.publicKey, "publicKey cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerOptions.java index 3bebef2d02..4492d1e327 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerOptions.java @@ -24,10 +24,15 @@ public class CreateLoadBalancerListenerOptions extends GenericModel { /** * The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. + * + * Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in + * the `application` family support `tcp`, `http` and + * `https`. + * * Additional restrictions: - * - If this load balancer is in the `network` family: - * - The protocol must be `tcp` or `udp` (if `udp_supported` is `true`). - * - If `default_pool` is set, the pool protocol must match. + * - If `default_pool` is set, the pool's protocol must match, or be compatible with + * the listener's protocol. At present, the compatible protocols are `http` and + * `https`. * - If `https_redirect` is set, the protocol must be `http`. */ public interface Protocol { @@ -69,6 +74,11 @@ public static class Builder { private Long portMax; private Long portMin; + /** + * Instantiates a new Builder from an existing CreateLoadBalancerListenerOptions instance. + * + * @param createLoadBalancerListenerOptions the instance to initialize the Builder with + */ private Builder(CreateLoadBalancerListenerOptions createLoadBalancerListenerOptions) { this.loadBalancerId = createLoadBalancerListenerOptions.loadBalancerId; this.protocol = createLoadBalancerListenerOptions.protocol; @@ -248,6 +258,8 @@ public Builder portMin(long portMin) { } } + protected CreateLoadBalancerListenerOptions() { } + protected CreateLoadBalancerListenerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); @@ -290,10 +302,15 @@ public String loadBalancerId() { * Gets the protocol. * * The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. + * + * Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in + * the `application` family support `tcp`, `http` and + * `https`. + * * Additional restrictions: - * - If this load balancer is in the `network` family: - * - The protocol must be `tcp` or `udp` (if `udp_supported` is `true`). - * - If `default_pool` is set, the pool protocol must match. + * - If `default_pool` is set, the pool's protocol must match, or be compatible with + * the listener's protocol. At present, the compatible protocols are `http` and + * `https`. * - If `https_redirect` is set, the protocol must be `http`. * * @return the protocol @@ -321,8 +338,8 @@ public Boolean acceptProxyProtocol() { /** * Gets the certificateInstance. * - * The certificate instance used for SSL termination. It is applicable only to `https` - * protocol. + * The certificate instance to use for SSL termination. The listener must have a + * `protocol` of `https`. * * @return the certificateInstance */ @@ -344,13 +361,15 @@ public Long connectionLimit() { /** * Gets the defaultPool. * - * The default pool for this listener. The specified pool must: - * - * - Belong to this load balancer + * The default pool for this listener. If specified, the pool must: + * - Belong to this load balancer. * - Have the same `protocol` as this listener, or have a compatible protocol. * At present, the compatible protocols are `http` and `https`. * - Not already be the `default_pool` for another listener. * + * If unspecified, this listener will be created with no default pool, but one may be + * subsequently set. + * * @return the defaultPool */ public LoadBalancerPoolIdentity defaultPool() { diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerPolicyOptions.java index 62aa1ee0fb..461b5f6bfe 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerPolicyOptions.java @@ -60,6 +60,11 @@ public static class Builder { private List rules; private LoadBalancerListenerPolicyTargetPrototype target; + /** + * Instantiates a new Builder from an existing CreateLoadBalancerListenerPolicyOptions instance. + * + * @param createLoadBalancerListenerPolicyOptions the instance to initialize the Builder with + */ private Builder(CreateLoadBalancerListenerPolicyOptions createLoadBalancerListenerPolicyOptions) { this.loadBalancerId = createLoadBalancerListenerPolicyOptions.loadBalancerId; this.listenerId = createLoadBalancerListenerPolicyOptions.listenerId; @@ -195,6 +200,8 @@ public Builder target(LoadBalancerListenerPolicyTargetPrototype target) { } } + protected CreateLoadBalancerListenerPolicyOptions() { } + protected CreateLoadBalancerListenerPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerPolicyRuleOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerPolicyRuleOptions.java index 884d91d4f8..8f3ece1a39 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerPolicyRuleOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerPolicyRuleOptions.java @@ -69,6 +69,11 @@ public static class Builder { private String value; private String field; + /** + * Instantiates a new Builder from an existing CreateLoadBalancerListenerPolicyRuleOptions instance. + * + * @param createLoadBalancerListenerPolicyRuleOptions the instance to initialize the Builder with + */ private Builder(CreateLoadBalancerListenerPolicyRuleOptions createLoadBalancerListenerPolicyRuleOptions) { this.loadBalancerId = createLoadBalancerListenerPolicyRuleOptions.loadBalancerId; this.listenerId = createLoadBalancerListenerPolicyRuleOptions.listenerId; @@ -191,6 +196,8 @@ public Builder field(String field) { } } + protected CreateLoadBalancerListenerPolicyRuleOptions() { } + protected CreateLoadBalancerListenerPolicyRuleOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerOptions.java index d6ea026f64..82521e4f86 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerOptions.java @@ -48,6 +48,11 @@ public static class Builder { private Boolean routeMode; private List securityGroups; + /** + * Instantiates a new Builder from an existing CreateLoadBalancerOptions instance. + * + * @param createLoadBalancerOptions the instance to initialize the Builder with + */ private Builder(CreateLoadBalancerOptions createLoadBalancerOptions) { this.isPublic = createLoadBalancerOptions.isPublic; this.subnets = createLoadBalancerOptions.subnets; @@ -266,6 +271,8 @@ public Builder securityGroups(List securityGroups) { } } + protected CreateLoadBalancerOptions() { } + protected CreateLoadBalancerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.isPublic, "isPublic cannot be null"); @@ -295,9 +302,9 @@ public Builder newBuilder() { /** * Gets the isPublic. * - * Indicates whether this load balancer is public or private. + * Indicates whether this load balancer is public. * - * At present, if route mode is enabled, the load balancer must be private. + * At present, if route mode is enabled, the load balancer must not be public. * * @return the isPublic */ @@ -308,8 +315,8 @@ public Boolean isPublic() { /** * Gets the subnets. * - * The subnets to provision this load balancer in. The load balancer's availability will depend on the availability - * of the zones the specified subnets reside in. + * The subnets to provision this load balancer in. The subnets must be in the same VPC. The load balancer's + * availability will depend on the availability of the zones that the subnets reside in. * * Load balancers in the `network` family allow only one subnet to be specified. * @@ -334,11 +341,10 @@ public List listeners() { * Gets the logging. * * The logging configuration to use for this load balancer. See [VPC Datapath - * Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) - * on the logging format, fields and permitted values. + * Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) on the logging + * format, fields and permitted values. * - * To activate logging, the load balancer profile must support the specified logging - * type. + * To activate logging, the load balancer profile must support the specified logging type. * * @return the logging */ @@ -372,7 +378,7 @@ public List pools() { /** * Gets the profile. * - * The profile to use for this load balancer + * The profile to use for this load balancer. * * If unspecified, `application` will be used. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerPoolMemberOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerPoolMemberOptions.java index acdc85fbc4..f698b7efe3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerPoolMemberOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerPoolMemberOptions.java @@ -35,6 +35,11 @@ public static class Builder { private LoadBalancerPoolMemberTargetPrototype target; private Long weight; + /** + * Instantiates a new Builder from an existing CreateLoadBalancerPoolMemberOptions instance. + * + * @param createLoadBalancerPoolMemberOptions the instance to initialize the Builder with + */ private Builder(CreateLoadBalancerPoolMemberOptions createLoadBalancerPoolMemberOptions) { this.loadBalancerId = createLoadBalancerPoolMemberOptions.loadBalancerId; this.poolId = createLoadBalancerPoolMemberOptions.poolId; @@ -129,6 +134,8 @@ public Builder weight(long weight) { } } + protected CreateLoadBalancerPoolMemberOptions() { } + protected CreateLoadBalancerPoolMemberOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerPoolOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerPoolOptions.java index 06f98fdf3c..df9897e394 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerPoolOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerPoolOptions.java @@ -89,6 +89,11 @@ public static class Builder { private String proxyProtocol; private LoadBalancerPoolSessionPersistencePrototype sessionPersistence; + /** + * Instantiates a new Builder from an existing CreateLoadBalancerPoolOptions instance. + * + * @param createLoadBalancerPoolOptions the instance to initialize the Builder with + */ private Builder(CreateLoadBalancerPoolOptions createLoadBalancerPoolOptions) { this.loadBalancerId = createLoadBalancerPoolOptions.loadBalancerId; this.algorithm = createLoadBalancerPoolOptions.algorithm; @@ -236,6 +241,8 @@ public Builder sessionPersistence(LoadBalancerPoolSessionPersistencePrototype se } } + protected CreateLoadBalancerPoolOptions() { } + protected CreateLoadBalancerPoolOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclOptions.java index 7a3718e153..35e3627193 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclOptions.java @@ -27,6 +27,11 @@ public class CreateNetworkAclOptions extends GenericModel { public static class Builder { private NetworkACLPrototype networkAclPrototype; + /** + * Instantiates a new Builder from an existing CreateNetworkAclOptions instance. + * + * @param createNetworkAclOptions the instance to initialize the Builder with + */ private Builder(CreateNetworkAclOptions createNetworkAclOptions) { this.networkAclPrototype = createNetworkAclOptions.networkAclPrototype; } @@ -58,6 +63,8 @@ public Builder networkAclPrototype(NetworkACLPrototype networkAclPrototype) { } } + protected CreateNetworkAclOptions() { } + protected CreateNetworkAclOptions(Builder builder) { networkAclPrototype = builder.networkAclPrototype; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclRuleOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclRuleOptions.java index 87b27d0d07..0cf3733b25 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclRuleOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclRuleOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String networkAclId; private NetworkACLRulePrototype networkAclRulePrototype; + /** + * Instantiates a new Builder from an existing CreateNetworkAclRuleOptions instance. + * + * @param createNetworkAclRuleOptions the instance to initialize the Builder with + */ private Builder(CreateNetworkAclRuleOptions createNetworkAclRuleOptions) { this.networkAclId = createNetworkAclRuleOptions.networkAclId; this.networkAclRulePrototype = createNetworkAclRuleOptions.networkAclRulePrototype; @@ -83,6 +88,8 @@ public Builder networkAclRulePrototype(NetworkACLRulePrototype networkAclRulePro } } + protected CreateNetworkAclRuleOptions() { } + protected CreateNetworkAclRuleOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.networkAclId, "networkAclId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreatePlacementGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreatePlacementGroupOptions.java index 72ed2b035f..6c3f2ff293 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreatePlacementGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreatePlacementGroupOptions.java @@ -47,6 +47,11 @@ public static class Builder { private String name; private ResourceGroupIdentity resourceGroup; + /** + * Instantiates a new Builder from an existing CreatePlacementGroupOptions instance. + * + * @param createPlacementGroupOptions the instance to initialize the Builder with + */ private Builder(CreatePlacementGroupOptions createPlacementGroupOptions) { this.strategy = createPlacementGroupOptions.strategy; this.name = createPlacementGroupOptions.name; @@ -111,6 +116,8 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { } } + protected CreatePlacementGroupOptions() { } + protected CreatePlacementGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.strategy, "strategy cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreatePublicGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreatePublicGatewayOptions.java index ffa6332fe1..e9bc371300 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreatePublicGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreatePublicGatewayOptions.java @@ -35,6 +35,11 @@ public static class Builder { private String name; private ResourceGroupIdentity resourceGroup; + /** + * Instantiates a new Builder from an existing CreatePublicGatewayOptions instance. + * + * @param createPublicGatewayOptions the instance to initialize the Builder with + */ private Builder(CreatePublicGatewayOptions createPublicGatewayOptions) { this.vpc = createPublicGatewayOptions.vpc; this.zone = createPublicGatewayOptions.zone; @@ -125,6 +130,8 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { } } + protected CreatePublicGatewayOptions() { } + protected CreatePublicGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.vpc, "vpc cannot be null"); @@ -149,7 +156,7 @@ public Builder newBuilder() { /** * Gets the vpc. * - * The VPC this public gateway will serve. + * The VPC this public gateway will reside in. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupOptions.java index a43e8884e0..064ee2b23b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupOptions.java @@ -36,6 +36,11 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private List rules; + /** + * Instantiates a new Builder from an existing CreateSecurityGroupOptions instance. + * + * @param createSecurityGroupOptions the instance to initialize the Builder with + */ private Builder(CreateSecurityGroupOptions createSecurityGroupOptions) { this.vpc = createSecurityGroupOptions.vpc; this.name = createSecurityGroupOptions.name; @@ -129,6 +134,8 @@ public Builder rules(List rules) { } } + protected CreateSecurityGroupOptions() { } + protected CreateSecurityGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.vpc, "vpc cannot be null"); @@ -150,7 +157,7 @@ public Builder newBuilder() { /** * Gets the vpc. * - * The VPC this security group is to be a part of. + * The VPC this security group will reside in. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupRuleOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupRuleOptions.java index ea90769208..9aa445067b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupRuleOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupRuleOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String securityGroupId; private SecurityGroupRulePrototype securityGroupRulePrototype; + /** + * Instantiates a new Builder from an existing CreateSecurityGroupRuleOptions instance. + * + * @param createSecurityGroupRuleOptions the instance to initialize the Builder with + */ private Builder(CreateSecurityGroupRuleOptions createSecurityGroupRuleOptions) { this.securityGroupId = createSecurityGroupRuleOptions.securityGroupId; this.securityGroupRulePrototype = createSecurityGroupRuleOptions.securityGroupRulePrototype; @@ -83,6 +88,8 @@ public Builder securityGroupRulePrototype(SecurityGroupRulePrototype securityGro } } + protected CreateSecurityGroupRuleOptions() { } + protected CreateSecurityGroupRuleOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.securityGroupId, "securityGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupTargetBindingOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupTargetBindingOptions.java index 155418c3e6..7d17972e8d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupTargetBindingOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupTargetBindingOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String securityGroupId; private String id; + /** + * Instantiates a new Builder from an existing CreateSecurityGroupTargetBindingOptions instance. + * + * @param createSecurityGroupTargetBindingOptions the instance to initialize the Builder with + */ private Builder(CreateSecurityGroupTargetBindingOptions createSecurityGroupTargetBindingOptions) { this.securityGroupId = createSecurityGroupTargetBindingOptions.securityGroupId; this.id = createSecurityGroupTargetBindingOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected CreateSecurityGroupTargetBindingOptions() { } + protected CreateSecurityGroupTargetBindingOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.securityGroupId, "securityGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotCloneOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotCloneOptions.java index 12b9751fdd..eff5e29df5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotCloneOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotCloneOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String id; private String zoneName; + /** + * Instantiates a new Builder from an existing CreateSnapshotCloneOptions instance. + * + * @param createSnapshotCloneOptions the instance to initialize the Builder with + */ private Builder(CreateSnapshotCloneOptions createSnapshotCloneOptions) { this.id = createSnapshotCloneOptions.id; this.zoneName = createSnapshotCloneOptions.zoneName; @@ -83,6 +88,8 @@ public Builder zoneName(String zoneName) { } } + protected CreateSnapshotCloneOptions() { } + protected CreateSnapshotCloneOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotOptions.java index ea51abb238..71ee041fd4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotOptions.java @@ -27,6 +27,11 @@ public class CreateSnapshotOptions extends GenericModel { public static class Builder { private SnapshotPrototype snapshotPrototype; + /** + * Instantiates a new Builder from an existing CreateSnapshotOptions instance. + * + * @param createSnapshotOptions the instance to initialize the Builder with + */ private Builder(CreateSnapshotOptions createSnapshotOptions) { this.snapshotPrototype = createSnapshotOptions.snapshotPrototype; } @@ -67,6 +72,8 @@ public Builder snapshotPrototype(SnapshotPrototype snapshotPrototype) { } } + protected CreateSnapshotOptions() { } + protected CreateSnapshotOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.snapshotPrototype, "snapshotPrototype cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSubnetOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSubnetOptions.java index 7e79f64185..5f337bc75a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSubnetOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSubnetOptions.java @@ -27,6 +27,11 @@ public class CreateSubnetOptions extends GenericModel { public static class Builder { private SubnetPrototype subnetPrototype; + /** + * Instantiates a new Builder from an existing CreateSubnetOptions instance. + * + * @param createSubnetOptions the instance to initialize the Builder with + */ private Builder(CreateSubnetOptions createSubnetOptions) { this.subnetPrototype = createSubnetOptions.subnetPrototype; } @@ -67,6 +72,8 @@ public Builder subnetPrototype(SubnetPrototype subnetPrototype) { } } + protected CreateSubnetOptions() { } + protected CreateSubnetOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.subnetPrototype, "subnetPrototype cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSubnetReservedIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSubnetReservedIpOptions.java index 91264543be..082460b2ab 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSubnetReservedIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateSubnetReservedIpOptions.java @@ -35,6 +35,11 @@ public static class Builder { private String name; private ReservedIPTargetPrototype target; + /** + * Instantiates a new Builder from an existing CreateSubnetReservedIpOptions instance. + * + * @param createSubnetReservedIpOptions the instance to initialize the Builder with + */ private Builder(CreateSubnetReservedIpOptions createSubnetReservedIpOptions) { this.subnetId = createSubnetReservedIpOptions.subnetId; this.address = createSubnetReservedIpOptions.address; @@ -123,6 +128,8 @@ public Builder target(ReservedIPTargetPrototype target) { } } + protected CreateSubnetReservedIpOptions() { } + protected CreateSubnetReservedIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.subnetId, "subnetId cannot be empty"); @@ -194,8 +201,12 @@ public String name() { /** * Gets the target. * - * The target this reserved IP is to be bound to. The target must be an endpoint gateway not - * already bound to a reserved IP in the subnet's zone. + * The target to bind this reserved IP to. The target must be in the same VPC. + * + * At present, only endpoint gateway targets are supported. The endpoint gateway must + * not be already bound to a reserved IP in the subnet's zone. + * + * If unspecified, the reserved IP will be created unbound. * * @return the target */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVolumeOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVolumeOptions.java index f844bb3adc..98f200b742 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVolumeOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVolumeOptions.java @@ -27,6 +27,11 @@ public class CreateVolumeOptions extends GenericModel { public static class Builder { private VolumePrototype volumePrototype; + /** + * Instantiates a new Builder from an existing CreateVolumeOptions instance. + * + * @param createVolumeOptions the instance to initialize the Builder with + */ private Builder(CreateVolumeOptions createVolumeOptions) { this.volumePrototype = createVolumeOptions.volumePrototype; } @@ -67,6 +72,8 @@ public Builder volumePrototype(VolumePrototype volumePrototype) { } } + protected CreateVolumeOptions() { } + protected CreateVolumeOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.volumePrototype, "volumePrototype cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcAddressPrefixOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcAddressPrefixOptions.java index a027ce9813..2304a5fbf7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcAddressPrefixOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcAddressPrefixOptions.java @@ -35,6 +35,11 @@ public static class Builder { private Boolean isDefault; private String name; + /** + * Instantiates a new Builder from an existing CreateVpcAddressPrefixOptions instance. + * + * @param createVpcAddressPrefixOptions the instance to initialize the Builder with + */ private Builder(CreateVpcAddressPrefixOptions createVpcAddressPrefixOptions) { this.vpcId = createVpcAddressPrefixOptions.vpcId; this.cidr = createVpcAddressPrefixOptions.cidr; @@ -127,6 +132,8 @@ public Builder name(String name) { } } + protected CreateVpcAddressPrefixOptions() { } + protected CreateVpcAddressPrefixOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcOptions.java index 82f87508e9..a67b695312 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcOptions.java @@ -47,6 +47,11 @@ public static class Builder { private String name; private ResourceGroupIdentity resourceGroup; + /** + * Instantiates a new Builder from an existing CreateVpcOptions instance. + * + * @param createVpcOptions the instance to initialize the Builder with + */ private Builder(CreateVpcOptions createVpcOptions) { this.addressPrefixManagement = createVpcOptions.addressPrefixManagement; this.classicAccess = createVpcOptions.classicAccess; @@ -114,6 +119,8 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { } } + protected CreateVpcOptions() { } + protected CreateVpcOptions(Builder builder) { addressPrefixManagement = builder.addressPrefixManagement; classicAccess = builder.classicAccess; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRouteOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRouteOptions.java index 09bf0dc435..5eebb99617 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRouteOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRouteOptions.java @@ -21,9 +21,8 @@ public class CreateVpcRouteOptions extends GenericModel { /** * The action to perform with a packet matching the route: - * - `delegate`: delegate to the system's built-in routes - * - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound - * routes + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes * - `deliver`: deliver the packet to the specified `next_hop` * - `drop`: drop the packet. */ @@ -56,6 +55,11 @@ public static class Builder { private String name; private RoutePrototypeNextHop nextHop; + /** + * Instantiates a new Builder from an existing CreateVpcRouteOptions instance. + * + * @param createVpcRouteOptions the instance to initialize the Builder with + */ private Builder(CreateVpcRouteOptions createVpcRouteOptions) { this.vpcId = createVpcRouteOptions.vpcId; this.destination = createVpcRouteOptions.destination; @@ -160,6 +164,8 @@ public Builder nextHop(RoutePrototypeNextHop nextHop) { } } + protected CreateVpcRouteOptions() { } + protected CreateVpcRouteOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); @@ -199,8 +205,7 @@ public String vpcId() { * Gets the destination. * * The destination of the route. At most two routes per `zone` in a table can have the same destination, and only if - * both routes have an `action` of `deliver` and the - * `next_hop` is an IP address. + * both routes have an `action` of `deliver` and the `next_hop` is an IP address. * * @return the destination */ @@ -224,9 +229,8 @@ public ZoneIdentity zone() { * Gets the action. * * The action to perform with a packet matching the route: - * - `delegate`: delegate to the system's built-in routes - * - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound - * routes + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes * - `deliver`: deliver the packet to the specified `next_hop` * - `drop`: drop the packet. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRoutingTableOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRoutingTableOptions.java index 4732d6e1fd..1580970031 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRoutingTableOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRoutingTableOptions.java @@ -42,6 +42,11 @@ public static class Builder { private Boolean routeVpcZoneIngress; private List routes; + /** + * Instantiates a new Builder from an existing CreateVpcRoutingTableOptions instance. + * + * @param createVpcRoutingTableOptions the instance to initialize the Builder with + */ private Builder(CreateVpcRoutingTableOptions createVpcRoutingTableOptions) { this.vpcId = createVpcRoutingTableOptions.vpcId; this.acceptRoutesFrom = createVpcRoutingTableOptions.acceptRoutesFrom; @@ -188,6 +193,8 @@ public Builder routes(List routes) { } } + protected CreateVpcRoutingTableOptions() { } + protected CreateVpcRoutingTableOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRoutingTableRouteOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRoutingTableRouteOptions.java index f442f4e46b..231d3f9588 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRoutingTableRouteOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRoutingTableRouteOptions.java @@ -21,9 +21,8 @@ public class CreateVpcRoutingTableRouteOptions extends GenericModel { /** * The action to perform with a packet matching the route: - * - `delegate`: delegate to the system's built-in routes - * - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound - * routes + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes * - `deliver`: deliver the packet to the specified `next_hop` * - `drop`: drop the packet. */ @@ -58,6 +57,11 @@ public static class Builder { private String name; private RoutePrototypeNextHop nextHop; + /** + * Instantiates a new Builder from an existing CreateVpcRoutingTableRouteOptions instance. + * + * @param createVpcRoutingTableRouteOptions the instance to initialize the Builder with + */ private Builder(CreateVpcRoutingTableRouteOptions createVpcRoutingTableRouteOptions) { this.vpcId = createVpcRoutingTableRouteOptions.vpcId; this.routingTableId = createVpcRoutingTableRouteOptions.routingTableId; @@ -176,6 +180,8 @@ public Builder nextHop(RoutePrototypeNextHop nextHop) { } } + protected CreateVpcRoutingTableRouteOptions() { } + protected CreateVpcRoutingTableRouteOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); @@ -229,8 +235,7 @@ public String routingTableId() { * Gets the destination. * * The destination of the route. At most two routes per `zone` in a table can have the same destination, and only if - * both routes have an `action` of `deliver` and the - * `next_hop` is an IP address. + * both routes have an `action` of `deliver` and the `next_hop` is an IP address. * * @return the destination */ @@ -254,9 +259,8 @@ public ZoneIdentity zone() { * Gets the action. * * The action to perform with a packet matching the route: - * - `delegate`: delegate to the system's built-in routes - * - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound - * routes + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes * - `deliver`: deliver the packet to the specified `next_hop` * - `drop`: drop the packet. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnGatewayConnectionOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnGatewayConnectionOptions.java index 6ccabc38f8..9d9071fb5b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnGatewayConnectionOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnGatewayConnectionOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpnGatewayId; private VPNGatewayConnectionPrototype vpnGatewayConnectionPrototype; + /** + * Instantiates a new Builder from an existing CreateVpnGatewayConnectionOptions instance. + * + * @param createVpnGatewayConnectionOptions the instance to initialize the Builder with + */ private Builder(CreateVpnGatewayConnectionOptions createVpnGatewayConnectionOptions) { this.vpnGatewayId = createVpnGatewayConnectionOptions.vpnGatewayId; this.vpnGatewayConnectionPrototype = createVpnGatewayConnectionOptions.vpnGatewayConnectionPrototype; @@ -83,6 +88,8 @@ public Builder vpnGatewayConnectionPrototype(VPNGatewayConnectionPrototype vpnGa } } + protected CreateVpnGatewayConnectionOptions() { } + protected CreateVpnGatewayConnectionOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, "vpnGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnGatewayOptions.java index 283149448f..edc0847371 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnGatewayOptions.java @@ -27,6 +27,11 @@ public class CreateVpnGatewayOptions extends GenericModel { public static class Builder { private VPNGatewayPrototype vpnGatewayPrototype; + /** + * Instantiates a new Builder from an existing CreateVpnGatewayOptions instance. + * + * @param createVpnGatewayOptions the instance to initialize the Builder with + */ private Builder(CreateVpnGatewayOptions createVpnGatewayOptions) { this.vpnGatewayPrototype = createVpnGatewayOptions.vpnGatewayPrototype; } @@ -67,6 +72,8 @@ public Builder vpnGatewayPrototype(VPNGatewayPrototype vpnGatewayPrototype) { } } + protected CreateVpnGatewayOptions() { } + protected CreateVpnGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.vpnGatewayPrototype, "vpnGatewayPrototype cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnServerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnServerOptions.java index b0e6cf0231..1a0bdf1087 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnServerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnServerOptions.java @@ -62,6 +62,11 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private List securityGroups; + /** + * Instantiates a new Builder from an existing CreateVpnServerOptions instance. + * + * @param createVpnServerOptions the instance to initialize the Builder with + */ private Builder(CreateVpnServerOptions createVpnServerOptions) { this.certificate = createVpnServerOptions.certificate; this.clientAuthentication = createVpnServerOptions.clientAuthentication; @@ -308,6 +313,8 @@ public Builder securityGroups(List securityGroups) { } } + protected CreateVpnServerOptions() { } + protected CreateVpnServerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.certificate, "certificate cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnServerRouteOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnServerRouteOptions.java index 85da2c579d..f420892126 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnServerRouteOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnServerRouteOptions.java @@ -53,6 +53,11 @@ public static class Builder { private String action; private String name; + /** + * Instantiates a new Builder from an existing CreateVpnServerRouteOptions instance. + * + * @param createVpnServerRouteOptions the instance to initialize the Builder with + */ private Builder(CreateVpnServerRouteOptions createVpnServerRouteOptions) { this.vpnServerId = createVpnServerRouteOptions.vpnServerId; this.destination = createVpnServerRouteOptions.destination; @@ -131,6 +136,8 @@ public Builder name(String name) { } } + protected CreateVpnServerRouteOptions() { } + protected CreateVpnServerRouteOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnServerId, "vpnServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHost.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHost.java index 3a1fe5dc6a..ca574d3e78 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHost.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHost.java @@ -101,6 +101,8 @@ public interface State { protected VCPU vcpu; protected ZoneReference zone; + protected DedicatedHost() { } + /** * Gets the availableMemory. * @@ -247,7 +249,8 @@ public String getName() { /** * Gets the profile. * - * The profile this dedicated host uses. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) for this + * dedicated host. * * @return the profile */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollection.java index 4fc044136d..2d145942a6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollection.java @@ -30,6 +30,8 @@ public class DedicatedHostCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected DedicatedHostCollection() { } + /** * Gets the dedicatedHosts. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollectionFirst.java index a4ab9f8d9d..c2b8e3f8c4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollectionFirst.java @@ -21,6 +21,8 @@ public class DedicatedHostCollectionFirst extends GenericModel { protected String href; + protected DedicatedHostCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollectionNext.java index 008d63b5fa..8b4739c13e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollectionNext.java @@ -21,6 +21,8 @@ public class DedicatedHostCollectionNext extends GenericModel { protected String href; + protected DedicatedHostCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDisk.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDisk.java index 1bdffd3966..405c3c2301 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDisk.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDisk.java @@ -96,6 +96,8 @@ public interface SupportedInstanceInterfaceTypes { @SerializedName("supported_instance_interface_types") protected List supportedInstanceInterfaceTypes; + protected DedicatedHostDisk() { } + /** * Gets the available. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDiskCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDiskCollection.java index f958c69ba3..17b31d18b0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDiskCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDiskCollection.java @@ -23,6 +23,8 @@ public class DedicatedHostDiskCollection extends GenericModel { protected List disks; + protected DedicatedHostDiskCollection() { } + /** * Gets the disks. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDiskPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDiskPatch.java index 231619eb61..c7dd070389 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDiskPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDiskPatch.java @@ -30,6 +30,11 @@ public class DedicatedHostDiskPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing DedicatedHostDiskPatch instance. + * + * @param dedicatedHostDiskPatch the instance to initialize the Builder with + */ private Builder(DedicatedHostDiskPatch dedicatedHostDiskPatch) { this.name = dedicatedHostDiskPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected DedicatedHostDiskPatch() { } + protected DedicatedHostDiskPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroup.java index fe7999272c..05b853d087 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroup.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroup.java @@ -62,6 +62,8 @@ public interface ResourceType { protected List supportedInstanceProfiles; protected ZoneReference zone; + protected DedicatedHostGroup() { } + /** * Gets the xClass. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollection.java index c80de7dc5c..02d91fdf34 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollection.java @@ -29,6 +29,8 @@ public class DedicatedHostGroupCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected DedicatedHostGroupCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollectionFirst.java index 7af8187d14..fac2cf63b1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollectionFirst.java @@ -21,6 +21,8 @@ public class DedicatedHostGroupCollectionFirst extends GenericModel { protected String href; + protected DedicatedHostGroupCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollectionNext.java index 2570fb09e0..39d1123c34 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollectionNext.java @@ -21,6 +21,8 @@ public class DedicatedHostGroupCollectionNext extends GenericModel { protected String href; + protected DedicatedHostGroupCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentity.java index 32eeb61cde..e2e7f66e51 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentity.java @@ -23,8 +23,7 @@ */ public class DedicatedHostGroupIdentity extends DedicatedHostPrototypeWrapper { - protected DedicatedHostGroupIdentity() { - } + protected DedicatedHostGroupIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentityByCRN.java index 72e5498330..d6ac0fde72 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentityByCRN.java @@ -24,6 +24,11 @@ public class DedicatedHostGroupIdentityByCRN extends DedicatedHostGroupIdentity public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing DedicatedHostGroupIdentityByCRN instance. + * + * @param dedicatedHostGroupIdentityByCrn the instance to initialize the Builder with + */ public Builder(DedicatedHostGroupIdentity dedicatedHostGroupIdentityByCrn) { this.crn = dedicatedHostGroupIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected DedicatedHostGroupIdentityByCRN() { } + protected DedicatedHostGroupIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentityByHref.java index 227f259099..c0108ed8ee 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentityByHref.java @@ -24,6 +24,11 @@ public class DedicatedHostGroupIdentityByHref extends DedicatedHostGroupIdentity public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing DedicatedHostGroupIdentityByHref instance. + * + * @param dedicatedHostGroupIdentityByHref the instance to initialize the Builder with + */ public Builder(DedicatedHostGroupIdentity dedicatedHostGroupIdentityByHref) { this.href = dedicatedHostGroupIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected DedicatedHostGroupIdentityByHref() { } + protected DedicatedHostGroupIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentityById.java index 69b711de97..bb6716b983 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupIdentityById.java @@ -24,6 +24,11 @@ public class DedicatedHostGroupIdentityById extends DedicatedHostGroupIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DedicatedHostGroupIdentityById instance. + * + * @param dedicatedHostGroupIdentityById the instance to initialize the Builder with + */ public Builder(DedicatedHostGroupIdentity dedicatedHostGroupIdentityById) { this.id = dedicatedHostGroupIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected DedicatedHostGroupIdentityById() { } + protected DedicatedHostGroupIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupPatch.java index eac51c8533..a2cbb7ce44 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupPatch.java @@ -30,6 +30,11 @@ public class DedicatedHostGroupPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing DedicatedHostGroupPatch instance. + * + * @param dedicatedHostGroupPatch the instance to initialize the Builder with + */ private Builder(DedicatedHostGroupPatch dedicatedHostGroupPatch) { this.name = dedicatedHostGroupPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected DedicatedHostGroupPatch() { } + protected DedicatedHostGroupPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupPrototypeDedicatedHostByZoneContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupPrototypeDedicatedHostByZoneContext.java index de5f239e82..1a9f23e021 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupPrototypeDedicatedHostByZoneContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupPrototypeDedicatedHostByZoneContext.java @@ -25,6 +25,11 @@ public static class Builder { private String name; private ResourceGroupIdentity resourceGroup; + /** + * Instantiates a new Builder from an existing DedicatedHostGroupPrototypeDedicatedHostByZoneContext instance. + * + * @param dedicatedHostGroupPrototypeDedicatedHostByZoneContext the instance to initialize the Builder with + */ private Builder(DedicatedHostGroupPrototypeDedicatedHostByZoneContext dedicatedHostGroupPrototypeDedicatedHostByZoneContext) { this.name = dedicatedHostGroupPrototypeDedicatedHostByZoneContext.name; this.resourceGroup = dedicatedHostGroupPrototypeDedicatedHostByZoneContext.resourceGroup; @@ -68,6 +73,8 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { } } + protected DedicatedHostGroupPrototypeDedicatedHostByZoneContext() { } + protected DedicatedHostGroupPrototypeDedicatedHostByZoneContext(Builder builder) { name = builder.name; resourceGroup = builder.resourceGroup; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupReference.java index a8e1f8b3fa..e68c9b9a03 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupReference.java @@ -36,6 +36,8 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected DedicatedHostGroupReference() { } + /** * Gets the crn. * @@ -50,7 +52,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupReferenceDeleted.java index 2a98a4cad0..27f3e3a6f9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class DedicatedHostGroupReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class DedicatedHostGroupReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected DedicatedHostGroupReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupsPager.java new file mode 100644 index 0000000000..c198b815a8 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * DedicatedHostGroupsPager can be used to simplify the use of the "listDedicatedHostGroups" method. + */ +public class DedicatedHostGroupsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListDedicatedHostGroupsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected DedicatedHostGroupsPager() { } + + /** + * Constructs a new DedicatedHostGroupsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listDedicatedHostGroups" method + * @param options the ListDedicatedHostGroupsOptions instance to be used to invoke the "listDedicatedHostGroups" method + */ + public DedicatedHostGroupsPager(Vpc client, ListDedicatedHostGroupsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<DedicatedHostGroup> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListDedicatedHostGroupsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + DedicatedHostGroupCollection result = client.listDedicatedHostGroups(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getGroups(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<DedicatedHostGroup> containing all results returned by the "listDedicatedHostGroups" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPatch.java index ac40e2ead6..ca541922c5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPatch.java @@ -34,6 +34,11 @@ public static class Builder { private Boolean instancePlacementEnabled; private String name; + /** + * Instantiates a new Builder from an existing DedicatedHostPatch instance. + * + * @param dedicatedHostPatch the instance to initialize the Builder with + */ private Builder(DedicatedHostPatch dedicatedHostPatch) { this.instancePlacementEnabled = dedicatedHostPatch.instancePlacementEnabled; this.name = dedicatedHostPatch.name; @@ -77,6 +82,8 @@ public Builder name(String name) { } } + protected DedicatedHostPatch() { } + protected DedicatedHostPatch(Builder builder) { instancePlacementEnabled = builder.instancePlacementEnabled; name = builder.name; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfile.java index c406cec9c4..f8a85847af 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfile.java @@ -54,6 +54,8 @@ public interface Family { @SerializedName("vcpu_count") protected DedicatedHostProfileVCPU vcpuCount; + protected DedicatedHostProfile() { } + /** * Gets the xClass. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollection.java index 2f68db0bfa..af358c0dc9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollection.java @@ -29,6 +29,8 @@ public class DedicatedHostProfileCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected DedicatedHostProfileCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollectionFirst.java index 1d1557e2d2..1d530e5b71 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollectionFirst.java @@ -21,6 +21,8 @@ public class DedicatedHostProfileCollectionFirst extends GenericModel { protected String href; + protected DedicatedHostProfileCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollectionNext.java index e6de3d91d2..333f21b99d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollectionNext.java @@ -21,6 +21,8 @@ public class DedicatedHostProfileCollectionNext extends GenericModel { protected String href; + protected DedicatedHostProfileCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDisk.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDisk.java index 328cfc8554..47f70f8845 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDisk.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDisk.java @@ -27,6 +27,8 @@ public class DedicatedHostProfileDisk extends GenericModel { @SerializedName("supported_instance_interface_types") protected DedicatedHostProfileDiskSupportedInterfaces supportedInstanceInterfaceTypes; + protected DedicatedHostProfileDisk() { } + /** * Gets the interfaceType. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskInterface.java index 1889740f85..20e5f73d8d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskInterface.java @@ -42,6 +42,8 @@ public interface Value { protected String type; protected String value; + protected DedicatedHostProfileDiskInterface() { } + /** * Gets the type. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskQuantity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskQuantity.java index f0ba92f0d3..c71a928e0b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskQuantity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskQuantity.java @@ -30,6 +30,8 @@ public interface Type { protected String type; protected Long value; + protected DedicatedHostProfileDiskQuantity() { } + /** * Gets the type. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskSize.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskSize.java index debee77f9d..34fbdc5ea4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskSize.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskSize.java @@ -30,6 +30,8 @@ public interface Type { protected String type; protected Long value; + protected DedicatedHostProfileDiskSize() { } + /** * Gets the type. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskSupportedInterfaces.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskSupportedInterfaces.java index d3406675e6..9d534f7a25 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskSupportedInterfaces.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskSupportedInterfaces.java @@ -46,6 +46,8 @@ public interface Value { protected String type; protected List value; + protected DedicatedHostProfileDiskSupportedInterfaces() { } + /** * Gets the type. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileIdentity.java index bcafacd949..d0f09e8a95 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileIdentity.java @@ -26,8 +26,7 @@ public class DedicatedHostProfileIdentity extends GenericModel { protected String name; protected String href; - protected DedicatedHostProfileIdentity() { - } + protected DedicatedHostProfileIdentity() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileIdentityByHref.java index 8b00d146e0..8519507f4e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileIdentityByHref.java @@ -24,6 +24,11 @@ public class DedicatedHostProfileIdentityByHref extends DedicatedHostProfileIden public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing DedicatedHostProfileIdentityByHref instance. + * + * @param dedicatedHostProfileIdentityByHref the instance to initialize the Builder with + */ public Builder(DedicatedHostProfileIdentity dedicatedHostProfileIdentityByHref) { this.href = dedicatedHostProfileIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected DedicatedHostProfileIdentityByHref() { } + protected DedicatedHostProfileIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileIdentityByName.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileIdentityByName.java index 02b159a7c2..4833ef6a0d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileIdentityByName.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileIdentityByName.java @@ -24,6 +24,11 @@ public class DedicatedHostProfileIdentityByName extends DedicatedHostProfileIden public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing DedicatedHostProfileIdentityByName instance. + * + * @param dedicatedHostProfileIdentityByName the instance to initialize the Builder with + */ public Builder(DedicatedHostProfileIdentity dedicatedHostProfileIdentityByName) { this.name = dedicatedHostProfileIdentityByName.name; } @@ -64,6 +69,8 @@ public Builder name(String name) { } } + protected DedicatedHostProfileIdentityByName() { } + protected DedicatedHostProfileIdentityByName(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemory.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemory.java index aed4c0e036..2ba5eaf09a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemory.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemory.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected DedicatedHostProfileMemory() { - } + protected DedicatedHostProfileMemory() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryDependent.java index 487a7a7b66..2567a02154 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected DedicatedHostProfileMemoryDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryEnum.java index 6691c1e209..acc0be6b38 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected DedicatedHostProfileMemoryEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryFixed.java index 48fbb1b5d4..0b5ee3cdf7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected DedicatedHostProfileMemoryFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryRange.java index dc47d64a38..1e4e9b10c0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileMemoryRange.java @@ -25,5 +25,7 @@ public interface Type { String RANGE = "range"; } + + protected DedicatedHostProfileMemoryRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileReference.java index d316a82d01..f98aa122b9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileReference.java @@ -22,6 +22,8 @@ public class DedicatedHostProfileReference extends GenericModel { protected String href; protected String name; + protected DedicatedHostProfileReference() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocket.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocket.java index 8685714f42..d5b57dd4ae 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocket.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocket.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected DedicatedHostProfileSocket() { - } + protected DedicatedHostProfileSocket() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketDependent.java index 05d6d0d982..05c4593f9f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected DedicatedHostProfileSocketDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketEnum.java index bba33a62f5..7966ead443 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected DedicatedHostProfileSocketEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketFixed.java index cf4c511888..5a65632f7d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected DedicatedHostProfileSocketFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketRange.java index eb2807bd1f..8067a197f1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileSocketRange.java @@ -25,5 +25,7 @@ public interface Type { String RANGE = "range"; } + + protected DedicatedHostProfileSocketRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPU.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPU.java index 4ee0526e33..0e58ad639b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPU.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPU.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected DedicatedHostProfileVCPU() { - } + protected DedicatedHostProfileVCPU() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUArchitecture.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUArchitecture.java index d41909de71..c419700d33 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUArchitecture.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUArchitecture.java @@ -30,6 +30,8 @@ public interface Type { protected String type; protected String value; + protected DedicatedHostProfileVCPUArchitecture() { } + /** * Gets the type. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUDependent.java index 30e04727a0..3c22eb9b23 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected DedicatedHostProfileVCPUDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUEnum.java index b5622b58a6..c9cd2bea71 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected DedicatedHostProfileVCPUEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUFixed.java index 0aaf1fa514..c9e9f61e9d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPUFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected DedicatedHostProfileVCPUFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPURange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPURange.java index cf12b17269..b40f7fe105 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPURange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileVCPURange.java @@ -25,5 +25,7 @@ public interface Type { String RANGE = "range"; } + + protected DedicatedHostProfileVCPURange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfilesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfilesPager.java new file mode 100644 index 0000000000..a54e60ac80 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfilesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * DedicatedHostProfilesPager can be used to simplify the use of the "listDedicatedHostProfiles" method. + */ +public class DedicatedHostProfilesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListDedicatedHostProfilesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected DedicatedHostProfilesPager() { } + + /** + * Constructs a new DedicatedHostProfilesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listDedicatedHostProfiles" method + * @param options the ListDedicatedHostProfilesOptions instance to be used to invoke the "listDedicatedHostProfiles" method + */ + public DedicatedHostProfilesPager(Vpc client, ListDedicatedHostProfilesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<DedicatedHostProfile> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListDedicatedHostProfilesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + DedicatedHostProfileCollection result = client.listDedicatedHostProfiles(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getProfiles(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<DedicatedHostProfile> containing all results returned by the "listDedicatedHostProfiles" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPrototype.java index 8651f7c0c5..5ed4ec5730 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPrototype.java @@ -33,8 +33,7 @@ public class DedicatedHostPrototype extends GenericModel { protected DedicatedHostPrototypeWrapper group; protected ZoneIdentity zone; - protected DedicatedHostPrototype() { - } + protected DedicatedHostPrototype() { } /** * Gets the instancePlacementEnabled. @@ -62,7 +61,8 @@ public String name() { /** * Gets the profile. * - * The profile to use for this dedicated host. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this + * dedicated host. * * @return the profile */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPrototypeDedicatedHostByGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPrototypeDedicatedHostByGroup.java index 01325b4894..5790cd268a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPrototypeDedicatedHostByGroup.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPrototypeDedicatedHostByGroup.java @@ -28,6 +28,11 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private DedicatedHostGroupIdentity group; + /** + * Instantiates a new Builder from an existing DedicatedHostPrototypeDedicatedHostByGroup instance. + * + * @param dedicatedHostPrototypeDedicatedHostByGroup the instance to initialize the Builder with + */ public Builder(DedicatedHostPrototype dedicatedHostPrototypeDedicatedHostByGroup) { this.instancePlacementEnabled = dedicatedHostPrototypeDedicatedHostByGroup.instancePlacementEnabled; this.name = dedicatedHostPrototypeDedicatedHostByGroup.name; @@ -118,6 +123,8 @@ public Builder group(DedicatedHostGroupIdentity group) { } } + protected DedicatedHostPrototypeDedicatedHostByGroup() { } + protected DedicatedHostPrototypeDedicatedHostByGroup(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profile, "profile cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPrototypeDedicatedHostByZone.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPrototypeDedicatedHostByZone.java index 02dd32de65..eeda3d5ac1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPrototypeDedicatedHostByZone.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostPrototypeDedicatedHostByZone.java @@ -29,6 +29,11 @@ public static class Builder { private DedicatedHostGroupPrototypeDedicatedHostByZoneContext group; private ZoneIdentity zone; + /** + * Instantiates a new Builder from an existing DedicatedHostPrototypeDedicatedHostByZone instance. + * + * @param dedicatedHostPrototypeDedicatedHostByZone the instance to initialize the Builder with + */ public Builder(DedicatedHostPrototype dedicatedHostPrototypeDedicatedHostByZone) { this.instancePlacementEnabled = dedicatedHostPrototypeDedicatedHostByZone.instancePlacementEnabled; this.name = dedicatedHostPrototypeDedicatedHostByZone.name; @@ -131,6 +136,8 @@ public Builder zone(ZoneIdentity zone) { } } + protected DedicatedHostPrototypeDedicatedHostByZone() { } + protected DedicatedHostPrototypeDedicatedHostByZone(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profile, "profile cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostReference.java index ba02288e92..e72ab30e10 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostReference.java @@ -36,6 +36,8 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected DedicatedHostReference() { } + /** * Gets the crn. * @@ -50,7 +52,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostReferenceDeleted.java index fdec26fef4..28e4c8c2a3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class DedicatedHostReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class DedicatedHostReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected DedicatedHostReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostsPager.java new file mode 100644 index 0000000000..7f38f8a6b0 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * DedicatedHostsPager can be used to simplify the use of the "listDedicatedHosts" method. + */ +public class DedicatedHostsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListDedicatedHostsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected DedicatedHostsPager() { } + + /** + * Constructs a new DedicatedHostsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listDedicatedHosts" method + * @param options the ListDedicatedHostsOptions instance to be used to invoke the "listDedicatedHosts" method + */ + public DedicatedHostsPager(Vpc client, ListDedicatedHostsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<DedicatedHost> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListDedicatedHostsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + DedicatedHostCollection result = client.listDedicatedHosts(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getDedicatedHosts(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<DedicatedHost> containing all results returned by the "listDedicatedHosts" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultNetworkACL.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultNetworkACL.java index 06eb802e5c..61c6feb4b5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultNetworkACL.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultNetworkACL.java @@ -35,6 +35,8 @@ public class DefaultNetworkACL extends GenericModel { protected List subnets; protected VPCReference vpc; + protected DefaultNetworkACL() { } + /** * Gets the createdAt. * @@ -129,7 +131,7 @@ public List getSubnets() { /** * Gets the vpc. * - * The VPC this network ACL is a part of. + * The VPC this network ACL resides in. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultRoutingTable.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultRoutingTable.java index e3cad08802..174520a13a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultRoutingTable.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultRoutingTable.java @@ -73,6 +73,8 @@ public interface ResourceType { protected List routes; protected List subnets; + protected DefaultRoutingTable() { } + /** * Gets the acceptRoutesFrom. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultSecurityGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultSecurityGroup.java index 6c15312d9f..f4fc22f68a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultSecurityGroup.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultSecurityGroup.java @@ -35,6 +35,8 @@ public class DefaultSecurityGroup extends GenericModel { protected List targets; protected VPCReference vpc; + protected DefaultSecurityGroup() { } + /** * Gets the createdAt. * @@ -129,7 +131,7 @@ public List getTargets() { /** * Gets the vpc. * - * The VPC this security group is a part of. + * The VPC this security group resides in. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBackupPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBackupPolicyOptions.java index 474ff6d42e..a83cf70bd7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBackupPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBackupPolicyOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String id; private String ifMatch; + /** + * Instantiates a new Builder from an existing DeleteBackupPolicyOptions instance. + * + * @param deleteBackupPolicyOptions the instance to initialize the Builder with + */ private Builder(DeleteBackupPolicyOptions deleteBackupPolicyOptions) { this.id = deleteBackupPolicyOptions.id; this.ifMatch = deleteBackupPolicyOptions.ifMatch; @@ -81,6 +86,8 @@ public Builder ifMatch(String ifMatch) { } } + protected DeleteBackupPolicyOptions() { } + protected DeleteBackupPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBackupPolicyPlanOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBackupPolicyPlanOptions.java index 4812cdc129..e1067becf5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBackupPolicyPlanOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBackupPolicyPlanOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private String ifMatch; + /** + * Instantiates a new Builder from an existing DeleteBackupPolicyPlanOptions instance. + * + * @param deleteBackupPolicyPlanOptions the instance to initialize the Builder with + */ private Builder(DeleteBackupPolicyPlanOptions deleteBackupPolicyPlanOptions) { this.backupPolicyId = deleteBackupPolicyPlanOptions.backupPolicyId; this.id = deleteBackupPolicyPlanOptions.id; @@ -97,6 +102,8 @@ public Builder ifMatch(String ifMatch) { } } + protected DeleteBackupPolicyPlanOptions() { } + protected DeleteBackupPolicyPlanOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.backupPolicyId, "backupPolicyId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBareMetalServerNetworkInterfaceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBareMetalServerNetworkInterfaceOptions.java index f4012d5889..d1929af687 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBareMetalServerNetworkInterfaceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBareMetalServerNetworkInterfaceOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String bareMetalServerId; private String id; + /** + * Instantiates a new Builder from an existing DeleteBareMetalServerNetworkInterfaceOptions instance. + * + * @param deleteBareMetalServerNetworkInterfaceOptions the instance to initialize the Builder with + */ private Builder(DeleteBareMetalServerNetworkInterfaceOptions deleteBareMetalServerNetworkInterfaceOptions) { this.bareMetalServerId = deleteBareMetalServerNetworkInterfaceOptions.bareMetalServerId; this.id = deleteBareMetalServerNetworkInterfaceOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteBareMetalServerNetworkInterfaceOptions() { } + protected DeleteBareMetalServerNetworkInterfaceOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBareMetalServerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBareMetalServerOptions.java index 505c4d57b0..14f56b5aba 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBareMetalServerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteBareMetalServerOptions.java @@ -27,6 +27,11 @@ public class DeleteBareMetalServerOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteBareMetalServerOptions instance. + * + * @param deleteBareMetalServerOptions the instance to initialize the Builder with + */ private Builder(DeleteBareMetalServerOptions deleteBareMetalServerOptions) { this.id = deleteBareMetalServerOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteBareMetalServerOptions() { } + protected DeleteBareMetalServerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteDedicatedHostGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteDedicatedHostGroupOptions.java index 5bead05992..6ba8ceb67e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteDedicatedHostGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteDedicatedHostGroupOptions.java @@ -27,6 +27,11 @@ public class DeleteDedicatedHostGroupOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteDedicatedHostGroupOptions instance. + * + * @param deleteDedicatedHostGroupOptions the instance to initialize the Builder with + */ private Builder(DeleteDedicatedHostGroupOptions deleteDedicatedHostGroupOptions) { this.id = deleteDedicatedHostGroupOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteDedicatedHostGroupOptions() { } + protected DeleteDedicatedHostGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteDedicatedHostOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteDedicatedHostOptions.java index 94dfa199e5..2ddcedf25b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteDedicatedHostOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteDedicatedHostOptions.java @@ -27,6 +27,11 @@ public class DeleteDedicatedHostOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteDedicatedHostOptions instance. + * + * @param deleteDedicatedHostOptions the instance to initialize the Builder with + */ private Builder(DeleteDedicatedHostOptions deleteDedicatedHostOptions) { this.id = deleteDedicatedHostOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteDedicatedHostOptions() { } + protected DeleteDedicatedHostOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteEndpointGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteEndpointGatewayOptions.java index 95faf38d2d..c6e2e0a564 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteEndpointGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteEndpointGatewayOptions.java @@ -27,6 +27,11 @@ public class DeleteEndpointGatewayOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteEndpointGatewayOptions instance. + * + * @param deleteEndpointGatewayOptions the instance to initialize the Builder with + */ private Builder(DeleteEndpointGatewayOptions deleteEndpointGatewayOptions) { this.id = deleteEndpointGatewayOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteEndpointGatewayOptions() { } + protected DeleteEndpointGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteFloatingIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteFloatingIpOptions.java index e052fc11e0..a5eb9cfa06 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteFloatingIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteFloatingIpOptions.java @@ -27,6 +27,11 @@ public class DeleteFloatingIpOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteFloatingIpOptions instance. + * + * @param deleteFloatingIpOptions the instance to initialize the Builder with + */ private Builder(DeleteFloatingIpOptions deleteFloatingIpOptions) { this.id = deleteFloatingIpOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteFloatingIpOptions() { } + protected DeleteFloatingIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteFlowLogCollectorOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteFlowLogCollectorOptions.java index 51ad5029f0..acfb3f0875 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteFlowLogCollectorOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteFlowLogCollectorOptions.java @@ -27,6 +27,11 @@ public class DeleteFlowLogCollectorOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteFlowLogCollectorOptions instance. + * + * @param deleteFlowLogCollectorOptions the instance to initialize the Builder with + */ private Builder(DeleteFlowLogCollectorOptions deleteFlowLogCollectorOptions) { this.id = deleteFlowLogCollectorOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteFlowLogCollectorOptions() { } + protected DeleteFlowLogCollectorOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteIkePolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteIkePolicyOptions.java index 59a458f6df..2744aea7f3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteIkePolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteIkePolicyOptions.java @@ -27,6 +27,11 @@ public class DeleteIkePolicyOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteIkePolicyOptions instance. + * + * @param deleteIkePolicyOptions the instance to initialize the Builder with + */ private Builder(DeleteIkePolicyOptions deleteIkePolicyOptions) { this.id = deleteIkePolicyOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteIkePolicyOptions() { } + protected DeleteIkePolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteImageOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteImageOptions.java index fd5aaf84f6..6ce69bf3d8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteImageOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteImageOptions.java @@ -27,6 +27,11 @@ public class DeleteImageOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteImageOptions instance. + * + * @param deleteImageOptions the instance to initialize the Builder with + */ private Builder(DeleteImageOptions deleteImageOptions) { this.id = deleteImageOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteImageOptions() { } + protected DeleteImageOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupLoadBalancerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupLoadBalancerOptions.java index 9206f44f86..bc794602a1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupLoadBalancerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupLoadBalancerOptions.java @@ -27,6 +27,11 @@ public class DeleteInstanceGroupLoadBalancerOptions extends GenericModel { public static class Builder { private String instanceGroupId; + /** + * Instantiates a new Builder from an existing DeleteInstanceGroupLoadBalancerOptions instance. + * + * @param deleteInstanceGroupLoadBalancerOptions the instance to initialize the Builder with + */ private Builder(DeleteInstanceGroupLoadBalancerOptions deleteInstanceGroupLoadBalancerOptions) { this.instanceGroupId = deleteInstanceGroupLoadBalancerOptions.instanceGroupId; } @@ -67,6 +72,8 @@ public Builder instanceGroupId(String instanceGroupId) { } } + protected DeleteInstanceGroupLoadBalancerOptions() { } + protected DeleteInstanceGroupLoadBalancerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupManagerActionOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupManagerActionOptions.java index 34ed08760a..c016001f98 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupManagerActionOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupManagerActionOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String instanceGroupManagerId; private String id; + /** + * Instantiates a new Builder from an existing DeleteInstanceGroupManagerActionOptions instance. + * + * @param deleteInstanceGroupManagerActionOptions the instance to initialize the Builder with + */ private Builder(DeleteInstanceGroupManagerActionOptions deleteInstanceGroupManagerActionOptions) { this.instanceGroupId = deleteInstanceGroupManagerActionOptions.instanceGroupId; this.instanceGroupManagerId = deleteInstanceGroupManagerActionOptions.instanceGroupManagerId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected DeleteInstanceGroupManagerActionOptions() { } + protected DeleteInstanceGroupManagerActionOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupManagerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupManagerOptions.java index d4efa17072..8cbccabb99 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupManagerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupManagerOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String instanceGroupId; private String id; + /** + * Instantiates a new Builder from an existing DeleteInstanceGroupManagerOptions instance. + * + * @param deleteInstanceGroupManagerOptions the instance to initialize the Builder with + */ private Builder(DeleteInstanceGroupManagerOptions deleteInstanceGroupManagerOptions) { this.instanceGroupId = deleteInstanceGroupManagerOptions.instanceGroupId; this.id = deleteInstanceGroupManagerOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteInstanceGroupManagerOptions() { } + protected DeleteInstanceGroupManagerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupManagerPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupManagerPolicyOptions.java index 200efd9468..b55996077b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupManagerPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupManagerPolicyOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String instanceGroupManagerId; private String id; + /** + * Instantiates a new Builder from an existing DeleteInstanceGroupManagerPolicyOptions instance. + * + * @param deleteInstanceGroupManagerPolicyOptions the instance to initialize the Builder with + */ private Builder(DeleteInstanceGroupManagerPolicyOptions deleteInstanceGroupManagerPolicyOptions) { this.instanceGroupId = deleteInstanceGroupManagerPolicyOptions.instanceGroupId; this.instanceGroupManagerId = deleteInstanceGroupManagerPolicyOptions.instanceGroupManagerId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected DeleteInstanceGroupManagerPolicyOptions() { } + protected DeleteInstanceGroupManagerPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupMembershipOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupMembershipOptions.java index 720fb13876..e885ba8918 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupMembershipOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupMembershipOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String instanceGroupId; private String id; + /** + * Instantiates a new Builder from an existing DeleteInstanceGroupMembershipOptions instance. + * + * @param deleteInstanceGroupMembershipOptions the instance to initialize the Builder with + */ private Builder(DeleteInstanceGroupMembershipOptions deleteInstanceGroupMembershipOptions) { this.instanceGroupId = deleteInstanceGroupMembershipOptions.instanceGroupId; this.id = deleteInstanceGroupMembershipOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteInstanceGroupMembershipOptions() { } + protected DeleteInstanceGroupMembershipOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupMembershipsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupMembershipsOptions.java index 5ce3679741..ae2da2c735 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupMembershipsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupMembershipsOptions.java @@ -27,6 +27,11 @@ public class DeleteInstanceGroupMembershipsOptions extends GenericModel { public static class Builder { private String instanceGroupId; + /** + * Instantiates a new Builder from an existing DeleteInstanceGroupMembershipsOptions instance. + * + * @param deleteInstanceGroupMembershipsOptions the instance to initialize the Builder with + */ private Builder(DeleteInstanceGroupMembershipsOptions deleteInstanceGroupMembershipsOptions) { this.instanceGroupId = deleteInstanceGroupMembershipsOptions.instanceGroupId; } @@ -67,6 +72,8 @@ public Builder instanceGroupId(String instanceGroupId) { } } + protected DeleteInstanceGroupMembershipsOptions() { } + protected DeleteInstanceGroupMembershipsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupOptions.java index 080d73b3f4..f272df876c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceGroupOptions.java @@ -27,6 +27,11 @@ public class DeleteInstanceGroupOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteInstanceGroupOptions instance. + * + * @param deleteInstanceGroupOptions the instance to initialize the Builder with + */ private Builder(DeleteInstanceGroupOptions deleteInstanceGroupOptions) { this.id = deleteInstanceGroupOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteInstanceGroupOptions() { } + protected DeleteInstanceGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceNetworkInterfaceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceNetworkInterfaceOptions.java index 8ae7f73ec8..0acf9f506a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceNetworkInterfaceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceNetworkInterfaceOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String instanceId; private String id; + /** + * Instantiates a new Builder from an existing DeleteInstanceNetworkInterfaceOptions instance. + * + * @param deleteInstanceNetworkInterfaceOptions the instance to initialize the Builder with + */ private Builder(DeleteInstanceNetworkInterfaceOptions deleteInstanceNetworkInterfaceOptions) { this.instanceId = deleteInstanceNetworkInterfaceOptions.instanceId; this.id = deleteInstanceNetworkInterfaceOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteInstanceNetworkInterfaceOptions() { } + protected DeleteInstanceNetworkInterfaceOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceOptions.java index 51f9ea86d1..fa3012ee22 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceOptions.java @@ -27,6 +27,11 @@ public class DeleteInstanceOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteInstanceOptions instance. + * + * @param deleteInstanceOptions the instance to initialize the Builder with + */ private Builder(DeleteInstanceOptions deleteInstanceOptions) { this.id = deleteInstanceOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteInstanceOptions() { } + protected DeleteInstanceOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceTemplateOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceTemplateOptions.java index 860fd03599..c87518b9b4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceTemplateOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceTemplateOptions.java @@ -27,6 +27,11 @@ public class DeleteInstanceTemplateOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteInstanceTemplateOptions instance. + * + * @param deleteInstanceTemplateOptions the instance to initialize the Builder with + */ private Builder(DeleteInstanceTemplateOptions deleteInstanceTemplateOptions) { this.id = deleteInstanceTemplateOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteInstanceTemplateOptions() { } + protected DeleteInstanceTemplateOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceVolumeAttachmentOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceVolumeAttachmentOptions.java index 281881c3c3..bd5bdd258c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceVolumeAttachmentOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteInstanceVolumeAttachmentOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String instanceId; private String id; + /** + * Instantiates a new Builder from an existing DeleteInstanceVolumeAttachmentOptions instance. + * + * @param deleteInstanceVolumeAttachmentOptions the instance to initialize the Builder with + */ private Builder(DeleteInstanceVolumeAttachmentOptions deleteInstanceVolumeAttachmentOptions) { this.instanceId = deleteInstanceVolumeAttachmentOptions.instanceId; this.id = deleteInstanceVolumeAttachmentOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteInstanceVolumeAttachmentOptions() { } + protected DeleteInstanceVolumeAttachmentOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteIpsecPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteIpsecPolicyOptions.java index 4525cea7b9..263a67dfb5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteIpsecPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteIpsecPolicyOptions.java @@ -27,6 +27,11 @@ public class DeleteIpsecPolicyOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteIpsecPolicyOptions instance. + * + * @param deleteIpsecPolicyOptions the instance to initialize the Builder with + */ private Builder(DeleteIpsecPolicyOptions deleteIpsecPolicyOptions) { this.id = deleteIpsecPolicyOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteIpsecPolicyOptions() { } + protected DeleteIpsecPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteKeyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteKeyOptions.java index 2cad5e2d1e..805bc8eb00 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteKeyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteKeyOptions.java @@ -27,6 +27,11 @@ public class DeleteKeyOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteKeyOptions instance. + * + * @param deleteKeyOptions the instance to initialize the Builder with + */ private Builder(DeleteKeyOptions deleteKeyOptions) { this.id = deleteKeyOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteKeyOptions() { } + protected DeleteKeyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerListenerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerListenerOptions.java index e865c6df27..3e01a72cc7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerListenerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerListenerOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String loadBalancerId; private String id; + /** + * Instantiates a new Builder from an existing DeleteLoadBalancerListenerOptions instance. + * + * @param deleteLoadBalancerListenerOptions the instance to initialize the Builder with + */ private Builder(DeleteLoadBalancerListenerOptions deleteLoadBalancerListenerOptions) { this.loadBalancerId = deleteLoadBalancerListenerOptions.loadBalancerId; this.id = deleteLoadBalancerListenerOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteLoadBalancerListenerOptions() { } + protected DeleteLoadBalancerListenerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerListenerPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerListenerPolicyOptions.java index 92a98ef39f..375604abd6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerListenerPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerListenerPolicyOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String listenerId; private String id; + /** + * Instantiates a new Builder from an existing DeleteLoadBalancerListenerPolicyOptions instance. + * + * @param deleteLoadBalancerListenerPolicyOptions the instance to initialize the Builder with + */ private Builder(DeleteLoadBalancerListenerPolicyOptions deleteLoadBalancerListenerPolicyOptions) { this.loadBalancerId = deleteLoadBalancerListenerPolicyOptions.loadBalancerId; this.listenerId = deleteLoadBalancerListenerPolicyOptions.listenerId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected DeleteLoadBalancerListenerPolicyOptions() { } + protected DeleteLoadBalancerListenerPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerListenerPolicyRuleOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerListenerPolicyRuleOptions.java index ae350b48ed..d475ac9005 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerListenerPolicyRuleOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerListenerPolicyRuleOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String policyId; private String id; + /** + * Instantiates a new Builder from an existing DeleteLoadBalancerListenerPolicyRuleOptions instance. + * + * @param deleteLoadBalancerListenerPolicyRuleOptions the instance to initialize the Builder with + */ private Builder(DeleteLoadBalancerListenerPolicyRuleOptions deleteLoadBalancerListenerPolicyRuleOptions) { this.loadBalancerId = deleteLoadBalancerListenerPolicyRuleOptions.loadBalancerId; this.listenerId = deleteLoadBalancerListenerPolicyRuleOptions.listenerId; @@ -115,6 +120,8 @@ public Builder id(String id) { } } + protected DeleteLoadBalancerListenerPolicyRuleOptions() { } + protected DeleteLoadBalancerListenerPolicyRuleOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerOptions.java index 640d1f7ecf..ae81607b2b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerOptions.java @@ -20,15 +20,23 @@ public class DeleteLoadBalancerOptions extends GenericModel { protected String id; + protected String ifMatch; /** * Builder. */ public static class Builder { private String id; + private String ifMatch; + /** + * Instantiates a new Builder from an existing DeleteLoadBalancerOptions instance. + * + * @param deleteLoadBalancerOptions the instance to initialize the Builder with + */ private Builder(DeleteLoadBalancerOptions deleteLoadBalancerOptions) { this.id = deleteLoadBalancerOptions.id; + this.ifMatch = deleteLoadBalancerOptions.ifMatch; } /** @@ -65,12 +73,26 @@ public Builder id(String id) { this.id = id; return this; } + + /** + * Set the ifMatch. + * + * @param ifMatch the ifMatch + * @return the DeleteLoadBalancerOptions builder + */ + public Builder ifMatch(String ifMatch) { + this.ifMatch = ifMatch; + return this; + } } + protected DeleteLoadBalancerOptions() { } + protected DeleteLoadBalancerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); id = builder.id; + ifMatch = builder.ifMatch; } /** @@ -92,5 +114,16 @@ public Builder newBuilder() { public String id() { return id; } + + /** + * Gets the ifMatch. + * + * If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + * + * @return the ifMatch + */ + public String ifMatch() { + return ifMatch; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerPoolMemberOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerPoolMemberOptions.java index bcd18c29de..6c6b64ef98 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerPoolMemberOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerPoolMemberOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String poolId; private String id; + /** + * Instantiates a new Builder from an existing DeleteLoadBalancerPoolMemberOptions instance. + * + * @param deleteLoadBalancerPoolMemberOptions the instance to initialize the Builder with + */ private Builder(DeleteLoadBalancerPoolMemberOptions deleteLoadBalancerPoolMemberOptions) { this.loadBalancerId = deleteLoadBalancerPoolMemberOptions.loadBalancerId; this.poolId = deleteLoadBalancerPoolMemberOptions.poolId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected DeleteLoadBalancerPoolMemberOptions() { } + protected DeleteLoadBalancerPoolMemberOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerPoolOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerPoolOptions.java index 8dda7bec94..9ac6875baa 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerPoolOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerPoolOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String loadBalancerId; private String id; + /** + * Instantiates a new Builder from an existing DeleteLoadBalancerPoolOptions instance. + * + * @param deleteLoadBalancerPoolOptions the instance to initialize the Builder with + */ private Builder(DeleteLoadBalancerPoolOptions deleteLoadBalancerPoolOptions) { this.loadBalancerId = deleteLoadBalancerPoolOptions.loadBalancerId; this.id = deleteLoadBalancerPoolOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteLoadBalancerPoolOptions() { } + protected DeleteLoadBalancerPoolOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteNetworkAclOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteNetworkAclOptions.java index 19705f444a..4c775d3675 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteNetworkAclOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteNetworkAclOptions.java @@ -27,6 +27,11 @@ public class DeleteNetworkAclOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteNetworkAclOptions instance. + * + * @param deleteNetworkAclOptions the instance to initialize the Builder with + */ private Builder(DeleteNetworkAclOptions deleteNetworkAclOptions) { this.id = deleteNetworkAclOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteNetworkAclOptions() { } + protected DeleteNetworkAclOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteNetworkAclRuleOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteNetworkAclRuleOptions.java index 034f015073..58eb2aa71a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteNetworkAclRuleOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteNetworkAclRuleOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String networkAclId; private String id; + /** + * Instantiates a new Builder from an existing DeleteNetworkAclRuleOptions instance. + * + * @param deleteNetworkAclRuleOptions the instance to initialize the Builder with + */ private Builder(DeleteNetworkAclRuleOptions deleteNetworkAclRuleOptions) { this.networkAclId = deleteNetworkAclRuleOptions.networkAclId; this.id = deleteNetworkAclRuleOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteNetworkAclRuleOptions() { } + protected DeleteNetworkAclRuleOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.networkAclId, "networkAclId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeletePlacementGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeletePlacementGroupOptions.java index 4ca0255d7d..3149628397 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeletePlacementGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeletePlacementGroupOptions.java @@ -27,6 +27,11 @@ public class DeletePlacementGroupOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeletePlacementGroupOptions instance. + * + * @param deletePlacementGroupOptions the instance to initialize the Builder with + */ private Builder(DeletePlacementGroupOptions deletePlacementGroupOptions) { this.id = deletePlacementGroupOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeletePlacementGroupOptions() { } + protected DeletePlacementGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeletePublicGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeletePublicGatewayOptions.java index 1708166a0a..07874d4e17 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeletePublicGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeletePublicGatewayOptions.java @@ -27,6 +27,11 @@ public class DeletePublicGatewayOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeletePublicGatewayOptions instance. + * + * @param deletePublicGatewayOptions the instance to initialize the Builder with + */ private Builder(DeletePublicGatewayOptions deletePublicGatewayOptions) { this.id = deletePublicGatewayOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeletePublicGatewayOptions() { } + protected DeletePublicGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSecurityGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSecurityGroupOptions.java index 571d8f31c2..8427a7397a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSecurityGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSecurityGroupOptions.java @@ -27,6 +27,11 @@ public class DeleteSecurityGroupOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteSecurityGroupOptions instance. + * + * @param deleteSecurityGroupOptions the instance to initialize the Builder with + */ private Builder(DeleteSecurityGroupOptions deleteSecurityGroupOptions) { this.id = deleteSecurityGroupOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteSecurityGroupOptions() { } + protected DeleteSecurityGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSecurityGroupRuleOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSecurityGroupRuleOptions.java index 71b66f7815..fd39b4d46b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSecurityGroupRuleOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSecurityGroupRuleOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String securityGroupId; private String id; + /** + * Instantiates a new Builder from an existing DeleteSecurityGroupRuleOptions instance. + * + * @param deleteSecurityGroupRuleOptions the instance to initialize the Builder with + */ private Builder(DeleteSecurityGroupRuleOptions deleteSecurityGroupRuleOptions) { this.securityGroupId = deleteSecurityGroupRuleOptions.securityGroupId; this.id = deleteSecurityGroupRuleOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteSecurityGroupRuleOptions() { } + protected DeleteSecurityGroupRuleOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.securityGroupId, "securityGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSecurityGroupTargetBindingOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSecurityGroupTargetBindingOptions.java index 90f60497d7..285a1a7b28 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSecurityGroupTargetBindingOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSecurityGroupTargetBindingOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String securityGroupId; private String id; + /** + * Instantiates a new Builder from an existing DeleteSecurityGroupTargetBindingOptions instance. + * + * @param deleteSecurityGroupTargetBindingOptions the instance to initialize the Builder with + */ private Builder(DeleteSecurityGroupTargetBindingOptions deleteSecurityGroupTargetBindingOptions) { this.securityGroupId = deleteSecurityGroupTargetBindingOptions.securityGroupId; this.id = deleteSecurityGroupTargetBindingOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteSecurityGroupTargetBindingOptions() { } + protected DeleteSecurityGroupTargetBindingOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.securityGroupId, "securityGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotCloneOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotCloneOptions.java index 3842e4d2da..f30bf21bde 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotCloneOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotCloneOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String id; private String zoneName; + /** + * Instantiates a new Builder from an existing DeleteSnapshotCloneOptions instance. + * + * @param deleteSnapshotCloneOptions the instance to initialize the Builder with + */ private Builder(DeleteSnapshotCloneOptions deleteSnapshotCloneOptions) { this.id = deleteSnapshotCloneOptions.id; this.zoneName = deleteSnapshotCloneOptions.zoneName; @@ -83,6 +88,8 @@ public Builder zoneName(String zoneName) { } } + protected DeleteSnapshotCloneOptions() { } + protected DeleteSnapshotCloneOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotOptions.java index 8b03be168b..438e2f4632 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String id; private String ifMatch; + /** + * Instantiates a new Builder from an existing DeleteSnapshotOptions instance. + * + * @param deleteSnapshotOptions the instance to initialize the Builder with + */ private Builder(DeleteSnapshotOptions deleteSnapshotOptions) { this.id = deleteSnapshotOptions.id; this.ifMatch = deleteSnapshotOptions.ifMatch; @@ -81,6 +86,8 @@ public Builder ifMatch(String ifMatch) { } } + protected DeleteSnapshotOptions() { } + protected DeleteSnapshotOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotsOptions.java index bee205d94d..309b574b06 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotsOptions.java @@ -27,6 +27,11 @@ public class DeleteSnapshotsOptions extends GenericModel { public static class Builder { private String sourceVolumeId; + /** + * Instantiates a new Builder from an existing DeleteSnapshotsOptions instance. + * + * @param deleteSnapshotsOptions the instance to initialize the Builder with + */ private Builder(DeleteSnapshotsOptions deleteSnapshotsOptions) { this.sourceVolumeId = deleteSnapshotsOptions.sourceVolumeId; } @@ -67,6 +72,8 @@ public Builder sourceVolumeId(String sourceVolumeId) { } } + protected DeleteSnapshotsOptions() { } + protected DeleteSnapshotsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.sourceVolumeId, "sourceVolumeId cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSubnetOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSubnetOptions.java index 0e18bd24a6..dd9111aba6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSubnetOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSubnetOptions.java @@ -27,6 +27,11 @@ public class DeleteSubnetOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteSubnetOptions instance. + * + * @param deleteSubnetOptions the instance to initialize the Builder with + */ private Builder(DeleteSubnetOptions deleteSubnetOptions) { this.id = deleteSubnetOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteSubnetOptions() { } + protected DeleteSubnetOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSubnetReservedIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSubnetReservedIpOptions.java index a6ce8db87c..d5e2e9d605 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSubnetReservedIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSubnetReservedIpOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String subnetId; private String id; + /** + * Instantiates a new Builder from an existing DeleteSubnetReservedIpOptions instance. + * + * @param deleteSubnetReservedIpOptions the instance to initialize the Builder with + */ private Builder(DeleteSubnetReservedIpOptions deleteSubnetReservedIpOptions) { this.subnetId = deleteSubnetReservedIpOptions.subnetId; this.id = deleteSubnetReservedIpOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteSubnetReservedIpOptions() { } + protected DeleteSubnetReservedIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.subnetId, "subnetId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVolumeOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVolumeOptions.java index 77241e77ba..c59837165a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVolumeOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVolumeOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String id; private String ifMatch; + /** + * Instantiates a new Builder from an existing DeleteVolumeOptions instance. + * + * @param deleteVolumeOptions the instance to initialize the Builder with + */ private Builder(DeleteVolumeOptions deleteVolumeOptions) { this.id = deleteVolumeOptions.id; this.ifMatch = deleteVolumeOptions.ifMatch; @@ -81,6 +86,8 @@ public Builder ifMatch(String ifMatch) { } } + protected DeleteVolumeOptions() { } + protected DeleteVolumeOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcAddressPrefixOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcAddressPrefixOptions.java index f02c75ba05..adc14aae77 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcAddressPrefixOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcAddressPrefixOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpcId; private String id; + /** + * Instantiates a new Builder from an existing DeleteVpcAddressPrefixOptions instance. + * + * @param deleteVpcAddressPrefixOptions the instance to initialize the Builder with + */ private Builder(DeleteVpcAddressPrefixOptions deleteVpcAddressPrefixOptions) { this.vpcId = deleteVpcAddressPrefixOptions.vpcId; this.id = deleteVpcAddressPrefixOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteVpcAddressPrefixOptions() { } + protected DeleteVpcAddressPrefixOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcOptions.java index 18b73dab29..06d0e6dd34 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcOptions.java @@ -27,6 +27,11 @@ public class DeleteVpcOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteVpcOptions instance. + * + * @param deleteVpcOptions the instance to initialize the Builder with + */ private Builder(DeleteVpcOptions deleteVpcOptions) { this.id = deleteVpcOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteVpcOptions() { } + protected DeleteVpcOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcRouteOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcRouteOptions.java index 3c437be49e..2380fbe3dc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcRouteOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcRouteOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpcId; private String id; + /** + * Instantiates a new Builder from an existing DeleteVpcRouteOptions instance. + * + * @param deleteVpcRouteOptions the instance to initialize the Builder with + */ private Builder(DeleteVpcRouteOptions deleteVpcRouteOptions) { this.vpcId = deleteVpcRouteOptions.vpcId; this.id = deleteVpcRouteOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteVpcRouteOptions() { } + protected DeleteVpcRouteOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcRoutingTableOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcRoutingTableOptions.java index 7ca0b2621e..8a82a79413 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcRoutingTableOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcRoutingTableOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private String ifMatch; + /** + * Instantiates a new Builder from an existing DeleteVpcRoutingTableOptions instance. + * + * @param deleteVpcRoutingTableOptions the instance to initialize the Builder with + */ private Builder(DeleteVpcRoutingTableOptions deleteVpcRoutingTableOptions) { this.vpcId = deleteVpcRoutingTableOptions.vpcId; this.id = deleteVpcRoutingTableOptions.id; @@ -97,6 +102,8 @@ public Builder ifMatch(String ifMatch) { } } + protected DeleteVpcRoutingTableOptions() { } + protected DeleteVpcRoutingTableOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcRoutingTableRouteOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcRoutingTableRouteOptions.java index 0c67426387..8429f8a987 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcRoutingTableRouteOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpcRoutingTableRouteOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String routingTableId; private String id; + /** + * Instantiates a new Builder from an existing DeleteVpcRoutingTableRouteOptions instance. + * + * @param deleteVpcRoutingTableRouteOptions the instance to initialize the Builder with + */ private Builder(DeleteVpcRoutingTableRouteOptions deleteVpcRoutingTableRouteOptions) { this.vpcId = deleteVpcRoutingTableRouteOptions.vpcId; this.routingTableId = deleteVpcRoutingTableRouteOptions.routingTableId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected DeleteVpcRoutingTableRouteOptions() { } + protected DeleteVpcRoutingTableRouteOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayConnectionOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayConnectionOptions.java index fe16a3f803..5c31a93b5a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayConnectionOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayConnectionOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpnGatewayId; private String id; + /** + * Instantiates a new Builder from an existing DeleteVpnGatewayConnectionOptions instance. + * + * @param deleteVpnGatewayConnectionOptions the instance to initialize the Builder with + */ private Builder(DeleteVpnGatewayConnectionOptions deleteVpnGatewayConnectionOptions) { this.vpnGatewayId = deleteVpnGatewayConnectionOptions.vpnGatewayId; this.id = deleteVpnGatewayConnectionOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteVpnGatewayConnectionOptions() { } + protected DeleteVpnGatewayConnectionOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, "vpnGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayOptions.java index 0556d21d89..26c96710df 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayOptions.java @@ -27,6 +27,11 @@ public class DeleteVpnGatewayOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing DeleteVpnGatewayOptions instance. + * + * @param deleteVpnGatewayOptions the instance to initialize the Builder with + */ private Builder(DeleteVpnGatewayOptions deleteVpnGatewayOptions) { this.id = deleteVpnGatewayOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected DeleteVpnGatewayOptions() { } + protected DeleteVpnGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnServerClientOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnServerClientOptions.java index 9cb8978475..3130ee8f60 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnServerClientOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnServerClientOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpnServerId; private String id; + /** + * Instantiates a new Builder from an existing DeleteVpnServerClientOptions instance. + * + * @param deleteVpnServerClientOptions the instance to initialize the Builder with + */ private Builder(DeleteVpnServerClientOptions deleteVpnServerClientOptions) { this.vpnServerId = deleteVpnServerClientOptions.vpnServerId; this.id = deleteVpnServerClientOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteVpnServerClientOptions() { } + protected DeleteVpnServerClientOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnServerId, "vpnServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnServerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnServerOptions.java index 928a6199bc..28bc94e424 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnServerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnServerOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String id; private String ifMatch; + /** + * Instantiates a new Builder from an existing DeleteVpnServerOptions instance. + * + * @param deleteVpnServerOptions the instance to initialize the Builder with + */ private Builder(DeleteVpnServerOptions deleteVpnServerOptions) { this.id = deleteVpnServerOptions.id; this.ifMatch = deleteVpnServerOptions.ifMatch; @@ -81,6 +86,8 @@ public Builder ifMatch(String ifMatch) { } } + protected DeleteVpnServerOptions() { } + protected DeleteVpnServerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnServerRouteOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnServerRouteOptions.java index a71fd91362..3d2d0cd5a5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnServerRouteOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnServerRouteOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpnServerId; private String id; + /** + * Instantiates a new Builder from an existing DeleteVpnServerRouteOptions instance. + * + * @param deleteVpnServerRouteOptions the instance to initialize the Builder with + */ private Builder(DeleteVpnServerRouteOptions deleteVpnServerRouteOptions) { this.vpnServerId = deleteVpnServerRouteOptions.vpnServerId; this.id = deleteVpnServerRouteOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DeleteVpnServerRouteOptions() { } + protected DeleteVpnServerRouteOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnServerId, "vpnServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DisconnectVpnClientOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DisconnectVpnClientOptions.java index a35243436e..7b0e561053 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DisconnectVpnClientOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DisconnectVpnClientOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpnServerId; private String id; + /** + * Instantiates a new Builder from an existing DisconnectVpnClientOptions instance. + * + * @param disconnectVpnClientOptions the instance to initialize the Builder with + */ private Builder(DisconnectVpnClientOptions disconnectVpnClientOptions) { this.vpnServerId = disconnectVpnClientOptions.vpnServerId; this.id = disconnectVpnClientOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected DisconnectVpnClientOptions() { } + protected DisconnectVpnClientOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnServerId, "vpnServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EncryptionKeyIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EncryptionKeyIdentity.java index 59cfbee2e9..f0089c9803 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EncryptionKeyIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EncryptionKeyIdentity.java @@ -24,8 +24,7 @@ public class EncryptionKeyIdentity extends GenericModel { protected String crn; - protected EncryptionKeyIdentity() { - } + protected EncryptionKeyIdentity() { } /** * Gets the crn. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EncryptionKeyIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EncryptionKeyIdentityByCRN.java index ac91c0d7da..8576b2c3f9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EncryptionKeyIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EncryptionKeyIdentityByCRN.java @@ -24,6 +24,11 @@ public class EncryptionKeyIdentityByCRN extends EncryptionKeyIdentity { public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing EncryptionKeyIdentityByCRN instance. + * + * @param encryptionKeyIdentityByCrn the instance to initialize the Builder with + */ public Builder(EncryptionKeyIdentity encryptionKeyIdentityByCrn) { this.crn = encryptionKeyIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected EncryptionKeyIdentityByCRN() { } + protected EncryptionKeyIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EncryptionKeyReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EncryptionKeyReference.java index c1f1c08b3c..ccb547d47c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EncryptionKeyReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EncryptionKeyReference.java @@ -21,6 +21,8 @@ public class EncryptionKeyReference extends GenericModel { protected String crn; + protected EncryptionKeyReference() { } + /** * Gets the crn. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGateway.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGateway.java index 9a05ed394e..46477ff10b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGateway.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGateway.java @@ -95,6 +95,8 @@ public interface ResourceType { protected EndpointGatewayTarget target; protected VPCReference vpc; + protected EndpointGateway() { } + /** * Gets the createdAt. * @@ -258,7 +260,7 @@ public EndpointGatewayTarget getTarget() { /** * Gets the vpc. * - * The VPC this endpoint gateway is serving. + * The VPC this endpoint gateway resides in. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollection.java index 3bd1c705d2..5193f605d2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollection.java @@ -30,6 +30,8 @@ public class EndpointGatewayCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected EndpointGatewayCollection() { } + /** * Gets the endpointGateways. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollectionFirst.java index 066fbeaf86..0bdcc2fa31 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollectionFirst.java @@ -21,6 +21,8 @@ public class EndpointGatewayCollectionFirst extends GenericModel { protected String href; + protected EndpointGatewayCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollectionNext.java index 8b4871f719..f401a3d0b6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollectionNext.java @@ -21,6 +21,8 @@ public class EndpointGatewayCollectionNext extends GenericModel { protected String href; + protected EndpointGatewayCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayIpsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayIpsPager.java new file mode 100644 index 0000000000..03cf34fb2d --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayIpsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * EndpointGatewayIpsPager can be used to simplify the use of the "listEndpointGatewayIps" method. + */ +public class EndpointGatewayIpsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListEndpointGatewayIpsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected EndpointGatewayIpsPager() { } + + /** + * Constructs a new EndpointGatewayIpsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listEndpointGatewayIps" method + * @param options the ListEndpointGatewayIpsOptions instance to be used to invoke the "listEndpointGatewayIps" method + */ + public EndpointGatewayIpsPager(Vpc client, ListEndpointGatewayIpsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<ReservedIP> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListEndpointGatewayIpsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + ReservedIPCollectionEndpointGatewayContext result = client.listEndpointGatewayIps(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getIps(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<ReservedIP> containing all results returned by the "listEndpointGatewayIps" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayPatch.java index 40eef9ccb9..4f6b15d09d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayPatch.java @@ -30,6 +30,11 @@ public class EndpointGatewayPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing EndpointGatewayPatch instance. + * + * @param endpointGatewayPatch the instance to initialize the Builder with + */ private Builder(EndpointGatewayPatch endpointGatewayPatch) { this.name = endpointGatewayPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected EndpointGatewayPatch() { } + protected EndpointGatewayPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReferenceDeleted.java index b9d083b105..0f3c16678e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class EndpointGatewayReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class EndpointGatewayReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected EndpointGatewayReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIP.java index f12837b91b..d7b1095ed0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIP.java @@ -34,8 +34,7 @@ public class EndpointGatewayReservedIP extends GenericModel { protected String name; protected SubnetIdentity subnet; - protected EndpointGatewayReservedIP() { - } + protected EndpointGatewayReservedIP() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPIdentity.java index d76e7286a0..cac93a389b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPIdentity.java @@ -22,7 +22,6 @@ public class EndpointGatewayReservedIPReservedIPIdentity extends EndpointGatewayReservedIP { - protected EndpointGatewayReservedIPReservedIPIdentity() { - } + protected EndpointGatewayReservedIPReservedIPIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref.java index 4e969a4ae0..c490d6edf4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref.java @@ -24,6 +24,11 @@ public class EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref instance. + * + * @param endpointGatewayReservedIpReservedIpIdentityReservedIpIdentityByHref the instance to initialize the Builder with + */ public Builder(EndpointGatewayReservedIPReservedIPIdentity endpointGatewayReservedIpReservedIpIdentityReservedIpIdentityByHref) { this.href = endpointGatewayReservedIpReservedIpIdentityReservedIpIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref() { } + protected EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById.java index f671a55e15..78f0f9fb75 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById.java @@ -24,6 +24,11 @@ public class EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById e public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById instance. + * + * @param endpointGatewayReservedIpReservedIpIdentityReservedIpIdentityById the instance to initialize the Builder with + */ public Builder(EndpointGatewayReservedIPReservedIPIdentity endpointGatewayReservedIpReservedIpIdentityReservedIpIdentityById) { this.id = endpointGatewayReservedIpReservedIpIdentityReservedIpIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById() { } + protected EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPPrototypeTargetContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPPrototypeTargetContext.java index 24ae2df703..428745e1a1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPPrototypeTargetContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayReservedIPReservedIPPrototypeTargetContext.java @@ -27,6 +27,11 @@ public static class Builder { private String name; private SubnetIdentity subnet; + /** + * Instantiates a new Builder from an existing EndpointGatewayReservedIPReservedIPPrototypeTargetContext instance. + * + * @param endpointGatewayReservedIpReservedIpPrototypeTargetContext the instance to initialize the Builder with + */ public Builder(EndpointGatewayReservedIP endpointGatewayReservedIpReservedIpPrototypeTargetContext) { this.address = endpointGatewayReservedIpReservedIpPrototypeTargetContext.address; this.autoDelete = endpointGatewayReservedIpReservedIpPrototypeTargetContext.autoDelete; @@ -103,6 +108,8 @@ public Builder subnet(SubnetIdentity subnet) { } } + protected EndpointGatewayReservedIPReservedIPPrototypeTargetContext() { } + protected EndpointGatewayReservedIPReservedIPPrototypeTargetContext(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.subnet, "subnet cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTarget.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTarget.java index 3300e1100d..156714cc7f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTarget.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTarget.java @@ -37,8 +37,7 @@ public interface ResourceType { protected String resourceType; protected String name; - protected EndpointGatewayTarget() { - } + protected EndpointGatewayTarget() { } /** * Gets the crn. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototype.java index 747533afe4..0574728141 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototype.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * The target for this endpoint gateway. + * The target to use for this endpoint gateway. Must not already be the target of another endpoint gateway in the VPC. * * Classes which extend this class: * - EndpointGatewayTargetPrototypeProviderCloudServiceIdentity @@ -47,8 +47,7 @@ public interface ResourceType { protected String crn; protected String name; - protected EndpointGatewayTargetPrototype() { - } + protected EndpointGatewayTargetPrototype() { } /** * Gets the resourceType. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderCloudServiceIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderCloudServiceIdentity.java index 76f387a70f..62417bb3cf 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderCloudServiceIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderCloudServiceIdentity.java @@ -31,7 +31,6 @@ public interface ResourceType { } - protected EndpointGatewayTargetPrototypeProviderCloudServiceIdentity() { - } + protected EndpointGatewayTargetPrototypeProviderCloudServiceIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.java index 370e3d12e8..68ec7abbfa 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.java @@ -35,6 +35,11 @@ public static class Builder { private String resourceType; private String crn; + /** + * Instantiates a new Builder from an existing EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN instance. + * + * @param endpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCrn the instance to initialize the Builder with + */ public Builder(EndpointGatewayTargetPrototypeProviderCloudServiceIdentity endpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCrn) { this.resourceType = endpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCrn.resourceType; this.crn = endpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCrn.crn; @@ -89,6 +94,8 @@ public Builder crn(String crn) { } } + protected EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN() { } + protected EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.resourceType, "resourceType cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity.java index 19cfd2514e..1f3d0a5de8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity.java @@ -31,7 +31,6 @@ public interface ResourceType { } - protected EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity() { - } + protected EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.java index cddfbd6174..1f810dee15 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.java @@ -35,6 +35,11 @@ public static class Builder { private String resourceType; private String name; + /** + * Instantiates a new Builder from an existing EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName instance. + * + * @param endpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName the instance to initialize the Builder with + */ public Builder(EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity endpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName) { this.resourceType = endpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.resourceType; this.name = endpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.name; @@ -89,6 +94,8 @@ public Builder name(String name) { } } + protected EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName() { } + protected EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.resourceType, "resourceType cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetProviderCloudServiceReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetProviderCloudServiceReference.java index db5be1e210..74aa2dac02 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetProviderCloudServiceReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetProviderCloudServiceReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String PROVIDER_CLOUD_SERVICE = "provider_cloud_service"; } + + protected EndpointGatewayTargetProviderCloudServiceReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetProviderInfrastructureServiceReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetProviderInfrastructureServiceReference.java index a617955bd4..a25249d476 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetProviderInfrastructureServiceReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetProviderInfrastructureServiceReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String PROVIDER_INFRASTRUCTURE_SERVICE = "provider_infrastructure_service"; } + + protected EndpointGatewayTargetProviderInfrastructureServiceReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewaysPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewaysPager.java new file mode 100644 index 0000000000..9b74544ff0 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewaysPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * EndpointGatewaysPager can be used to simplify the use of the "listEndpointGateways" method. + */ +public class EndpointGatewaysPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListEndpointGatewaysOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected EndpointGatewaysPager() { } + + /** + * Constructs a new EndpointGatewaysPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listEndpointGateways" method + * @param options the ListEndpointGatewaysOptions instance to be used to invoke the "listEndpointGateways" method + */ + public EndpointGatewaysPager(Vpc client, ListEndpointGatewaysOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<EndpointGateway> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListEndpointGatewaysOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + EndpointGatewayCollection result = client.listEndpointGateways(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getEndpointGateways(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<EndpointGateway> containing all results returned by the "listEndpointGateways" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIP.java index 10c68bc63e..6f887c1cf6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIP.java @@ -49,6 +49,8 @@ public interface Status { protected FloatingIPTarget target; protected ZoneReference zone; + protected FloatingIP() { } + /** * Gets the address. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPByTargetNetworkInterfaceIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPByTargetNetworkInterfaceIdentity.java index e56d60186e..ee030d1ff0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPByTargetNetworkInterfaceIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPByTargetNetworkInterfaceIdentity.java @@ -26,8 +26,7 @@ public class FloatingIPByTargetNetworkInterfaceIdentity extends GenericModel { protected String id; protected String href; - protected FloatingIPByTargetNetworkInterfaceIdentity() { - } + protected FloatingIPByTargetNetworkInterfaceIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.java index dc3da7014c..a5b59584c4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.java @@ -24,6 +24,11 @@ public class FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityB public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref instance. + * + * @param floatingIpByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref the instance to initialize the Builder with + */ public Builder(FloatingIPByTargetNetworkInterfaceIdentity floatingIpByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) { this.href = floatingIpByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref() { } + protected FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.java index 48fc8c8f9e..eaa9726cc4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.java @@ -24,6 +24,11 @@ public class FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityB public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById instance. + * + * @param floatingIpByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById the instance to initialize the Builder with + */ public Builder(FloatingIPByTargetNetworkInterfaceIdentity floatingIpByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById) { this.id = floatingIpByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById() { } + protected FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPCollection.java index 3eaae2beeb..26b85f0086 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPCollection.java @@ -30,6 +30,8 @@ public class FloatingIPCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected FloatingIPCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPCollectionFirst.java index 843dbad3bf..9b2d6993e8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPCollectionFirst.java @@ -21,6 +21,8 @@ public class FloatingIPCollectionFirst extends GenericModel { protected String href; + protected FloatingIPCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPCollectionNext.java index eca7a25507..7d7a5fd5ae 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPCollectionNext.java @@ -21,6 +21,8 @@ public class FloatingIPCollectionNext extends GenericModel { protected String href; + protected FloatingIPCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPatch.java index f887629c11..6e7d02bab3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPatch.java @@ -32,6 +32,11 @@ public static class Builder { private String name; private FloatingIPTargetPatch target; + /** + * Instantiates a new Builder from an existing FloatingIPPatch instance. + * + * @param floatingIpPatch the instance to initialize the Builder with + */ private Builder(FloatingIPPatch floatingIpPatch) { this.name = floatingIpPatch.name; this.target = floatingIpPatch.target; @@ -75,6 +80,8 @@ public Builder target(FloatingIPTargetPatch target) { } } + protected FloatingIPPatch() { } + protected FloatingIPPatch(Builder builder) { name = builder.name; target = builder.target; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPrototype.java index ec99c67aad..4e299b6e8f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPrototype.java @@ -30,8 +30,7 @@ public class FloatingIPPrototype extends GenericModel { protected ZoneIdentity zone; protected FloatingIPByTargetNetworkInterfaceIdentity target; - protected FloatingIPPrototype() { - } + protected FloatingIPPrototype() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPrototypeFloatingIPByTarget.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPrototypeFloatingIPByTarget.java index 4de6128240..37b3949d73 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPrototypeFloatingIPByTarget.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPrototypeFloatingIPByTarget.java @@ -26,6 +26,11 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private FloatingIPByTargetNetworkInterfaceIdentity target; + /** + * Instantiates a new Builder from an existing FloatingIPPrototypeFloatingIPByTarget instance. + * + * @param floatingIpPrototypeFloatingIpByTarget the instance to initialize the Builder with + */ public Builder(FloatingIPPrototype floatingIpPrototypeFloatingIpByTarget) { this.name = floatingIpPrototypeFloatingIpByTarget.name; this.resourceGroup = floatingIpPrototypeFloatingIpByTarget.resourceGroup; @@ -90,6 +95,8 @@ public Builder target(FloatingIPByTargetNetworkInterfaceIdentity target) { } } + protected FloatingIPPrototypeFloatingIPByTarget() { } + protected FloatingIPPrototypeFloatingIPByTarget(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.target, "target cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPrototypeFloatingIPByZone.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPrototypeFloatingIPByZone.java index 05e757fd46..d6ce363958 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPrototypeFloatingIPByZone.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPPrototypeFloatingIPByZone.java @@ -26,6 +26,11 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private ZoneIdentity zone; + /** + * Instantiates a new Builder from an existing FloatingIPPrototypeFloatingIPByZone instance. + * + * @param floatingIpPrototypeFloatingIpByZone the instance to initialize the Builder with + */ public Builder(FloatingIPPrototype floatingIpPrototypeFloatingIpByZone) { this.name = floatingIpPrototypeFloatingIpByZone.name; this.resourceGroup = floatingIpPrototypeFloatingIpByZone.resourceGroup; @@ -90,6 +95,8 @@ public Builder zone(ZoneIdentity zone) { } } + protected FloatingIPPrototypeFloatingIPByZone() { } + protected FloatingIPPrototypeFloatingIPByZone(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.zone, "zone cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPReference.java index 5e3dd21d93..39d255b5fd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPReference.java @@ -26,6 +26,8 @@ public class FloatingIPReference extends GenericModel { protected String id; protected String name; + protected FloatingIPReference() { } + /** * Gets the address. * @@ -51,7 +53,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPReferenceDeleted.java index 4bf0d52329..954a2308f0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class FloatingIPReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class FloatingIPReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected FloatingIPReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTarget.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTarget.java index b311d55396..d08ffaa93b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTarget.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTarget.java @@ -42,13 +42,12 @@ public interface ResourceType { protected String resourceType; protected String crn; - protected FloatingIPTarget() { - } + protected FloatingIPTarget() { } /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetNetworkInterfaceReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetNetworkInterfaceReference.java index 2e8e3f413d..5e1db6a835 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetNetworkInterfaceReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetNetworkInterfaceReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String NETWORK_INTERFACE = "network_interface"; } + + protected FloatingIPTargetNetworkInterfaceReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPatch.java index 22434618a0..fbab5dcd7f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPatch.java @@ -27,8 +27,7 @@ public class FloatingIPTargetPatch extends GenericModel { protected String id; protected String href; - protected FloatingIPTargetPatch() { - } + protected FloatingIPTargetPatch() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPatchNetworkInterfaceIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPatchNetworkInterfaceIdentityByHref.java index 5b87965160..bd32f9f43b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPatchNetworkInterfaceIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPatchNetworkInterfaceIdentityByHref.java @@ -24,6 +24,11 @@ public class FloatingIPTargetPatchNetworkInterfaceIdentityByHref extends Floatin public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing FloatingIPTargetPatchNetworkInterfaceIdentityByHref instance. + * + * @param floatingIpTargetPatchNetworkInterfaceIdentityByHref the instance to initialize the Builder with + */ public Builder(FloatingIPTargetPatch floatingIpTargetPatchNetworkInterfaceIdentityByHref) { this.href = floatingIpTargetPatchNetworkInterfaceIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected FloatingIPTargetPatchNetworkInterfaceIdentityByHref() { } + protected FloatingIPTargetPatchNetworkInterfaceIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPatchNetworkInterfaceIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPatchNetworkInterfaceIdentityById.java index 6985655de7..429374b4b2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPatchNetworkInterfaceIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPatchNetworkInterfaceIdentityById.java @@ -24,6 +24,11 @@ public class FloatingIPTargetPatchNetworkInterfaceIdentityById extends FloatingI public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing FloatingIPTargetPatchNetworkInterfaceIdentityById instance. + * + * @param floatingIpTargetPatchNetworkInterfaceIdentityById the instance to initialize the Builder with + */ public Builder(FloatingIPTargetPatch floatingIpTargetPatchNetworkInterfaceIdentityById) { this.id = floatingIpTargetPatchNetworkInterfaceIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected FloatingIPTargetPatchNetworkInterfaceIdentityById() { } + protected FloatingIPTargetPatchNetworkInterfaceIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPublicGatewayReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPublicGatewayReference.java index 3ad8f58e17..345b96a178 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPublicGatewayReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPTargetPublicGatewayReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String PUBLIC_GATEWAY = "public_gateway"; } + + protected FloatingIPTargetPublicGatewayReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPUnpaginatedCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPUnpaginatedCollection.java index b685175a1d..9b80803d77 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPUnpaginatedCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIPUnpaginatedCollection.java @@ -25,6 +25,8 @@ public class FloatingIPUnpaginatedCollection extends GenericModel { @SerializedName("floating_ips") protected List floatingIps; + protected FloatingIPUnpaginatedCollection() { } + /** * Gets the floatingIps. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIpsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIpsPager.java new file mode 100644 index 0000000000..87537e36db --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FloatingIpsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * FloatingIpsPager can be used to simplify the use of the "listFloatingIps" method. + */ +public class FloatingIpsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListFloatingIpsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected FloatingIpsPager() { } + + /** + * Constructs a new FloatingIpsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listFloatingIps" method + * @param options the ListFloatingIpsOptions instance to be used to invoke the "listFloatingIps" method + */ + public FloatingIpsPager(Vpc client, ListFloatingIpsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<FloatingIP> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListFloatingIpsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + FloatingIPCollection result = client.listFloatingIps(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getFloatingIps(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<FloatingIP> containing all results returned by the "listFloatingIps" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollector.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollector.java index a8c6be5aa9..5ea4c0e675 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollector.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollector.java @@ -60,6 +60,8 @@ public interface LifecycleState { protected FlowLogCollectorTarget target; protected VPCReference vpc; + protected FlowLogCollector() { } + /** * Gets the active. * @@ -187,7 +189,7 @@ public FlowLogCollectorTarget getTarget() { /** * Gets the vpc. * - * The VPC this flow log collector is associated with. + * The VPC this flow log collector resides in. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorCollection.java index 085cbd6c57..00a8f36f8e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorCollection.java @@ -30,6 +30,8 @@ public class FlowLogCollectorCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected FlowLogCollectorCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorCollectionFirst.java index de31a1fc47..a3bf0c85e1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorCollectionFirst.java @@ -21,6 +21,8 @@ public class FlowLogCollectorCollectionFirst extends GenericModel { protected String href; + protected FlowLogCollectorCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorCollectionNext.java index ffe48da36a..7b5bc3abd4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorCollectionNext.java @@ -21,6 +21,8 @@ public class FlowLogCollectorCollectionNext extends GenericModel { protected String href; + protected FlowLogCollectorCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorPatch.java index 28000f0f8d..cc855cafe4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorPatch.java @@ -32,6 +32,11 @@ public static class Builder { private Boolean active; private String name; + /** + * Instantiates a new Builder from an existing FlowLogCollectorPatch instance. + * + * @param flowLogCollectorPatch the instance to initialize the Builder with + */ private Builder(FlowLogCollectorPatch flowLogCollectorPatch) { this.active = flowLogCollectorPatch.active; this.name = flowLogCollectorPatch.name; @@ -75,6 +80,8 @@ public Builder name(String name) { } } + protected FlowLogCollectorPatch() { } + protected FlowLogCollectorPatch(Builder builder) { active = builder.active; name = builder.name; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTarget.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTarget.java index 46471b58bf..688ddf6ecc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTarget.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTarget.java @@ -44,13 +44,12 @@ public interface ResourceType { protected String resourceType; protected String crn; - protected FlowLogCollectorTarget() { - } + protected FlowLogCollectorTarget() { } /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetInstanceReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetInstanceReference.java index f221c58f8c..daa6f195be 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetInstanceReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetInstanceReference.java @@ -17,5 +17,7 @@ */ public class FlowLogCollectorTargetInstanceReference extends FlowLogCollectorTarget { + + protected FlowLogCollectorTargetInstanceReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.java index 0e424d611c..bb3a2ad011 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.java @@ -25,5 +25,7 @@ public interface ResourceType { String NETWORK_INTERFACE = "network_interface"; } + + protected FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototype.java index ef9aad32f1..6e82f7ff9b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototype.java @@ -31,8 +31,7 @@ public class FlowLogCollectorTargetPrototype extends GenericModel { protected String href; protected String crn; - protected FlowLogCollectorTargetPrototype() { - } + protected FlowLogCollectorTargetPrototype() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentity.java index 72c80550b5..d279df7b39 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentity.java @@ -23,7 +23,6 @@ public class FlowLogCollectorTargetPrototypeInstanceIdentity extends FlowLogCollectorTargetPrototype { - protected FlowLogCollectorTargetPrototypeInstanceIdentity() { - } + protected FlowLogCollectorTargetPrototypeInstanceIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.java index 644747c848..c3a8ac1dde 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.java @@ -24,6 +24,11 @@ public class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCR public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN instance. + * + * @param flowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCrn the instance to initialize the Builder with + */ public Builder(FlowLogCollectorTargetPrototypeInstanceIdentity flowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCrn) { this.crn = flowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN() { } + protected FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.java index 18f55d42d1..8cee99d3e4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.java @@ -24,6 +24,11 @@ public class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHr public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref instance. + * + * @param flowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref the instance to initialize the Builder with + */ public Builder(FlowLogCollectorTargetPrototypeInstanceIdentity flowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref) { this.href = flowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref() { } + protected FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.java index 571aa7b34d..dd32a9c213 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.java @@ -24,6 +24,11 @@ public class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById instance. + * + * @param flowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById the instance to initialize the Builder with + */ public Builder(FlowLogCollectorTargetPrototypeInstanceIdentity flowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById) { this.id = flowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById() { } + protected FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity.java index 95b5c6e386..604d2da7e6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity.java @@ -22,7 +22,6 @@ public class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity extends FlowLogCollectorTargetPrototype { - protected FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() { - } + protected FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.java index 09c50de06c..592ee2acef 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.java @@ -24,6 +24,11 @@ public class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInter public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref instance. + * + * @param flowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref the instance to initialize the Builder with + */ public Builder(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity flowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) { this.href = flowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref() { } + protected FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById.java index ab458dd797..acd60a702c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById.java @@ -24,6 +24,11 @@ public class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInter public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById instance. + * + * @param flowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById the instance to initialize the Builder with + */ public Builder(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity flowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById) { this.id = flowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById() { } + protected FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentity.java index f00dfacc99..e815901805 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentity.java @@ -23,7 +23,6 @@ public class FlowLogCollectorTargetPrototypeSubnetIdentity extends FlowLogCollectorTargetPrototype { - protected FlowLogCollectorTargetPrototypeSubnetIdentity() { - } + protected FlowLogCollectorTargetPrototypeSubnetIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.java index bbfb6d4d6f..083fde6043 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.java @@ -24,6 +24,11 @@ public class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN ex public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN instance. + * + * @param flowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCrn the instance to initialize the Builder with + */ public Builder(FlowLogCollectorTargetPrototypeSubnetIdentity flowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCrn) { this.crn = flowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN() { } + protected FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.java index db51cce707..2e7f4f04da 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.java @@ -24,6 +24,11 @@ public class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref e public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref instance. + * + * @param flowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref the instance to initialize the Builder with + */ public Builder(FlowLogCollectorTargetPrototypeSubnetIdentity flowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref) { this.href = flowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref() { } + protected FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.java index 66de70e9c6..16067da3a8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.java @@ -24,6 +24,11 @@ public class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById ext public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById instance. + * + * @param flowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById the instance to initialize the Builder with + */ public Builder(FlowLogCollectorTargetPrototypeSubnetIdentity flowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById) { this.id = flowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById() { } + protected FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentity.java index 6a3aaec5fc..4a21d30d2c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentity.java @@ -23,7 +23,6 @@ public class FlowLogCollectorTargetPrototypeVPCIdentity extends FlowLogCollectorTargetPrototype { - protected FlowLogCollectorTargetPrototypeVPCIdentity() { - } + protected FlowLogCollectorTargetPrototypeVPCIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.java index 608be01858..b77575cdba 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.java @@ -24,6 +24,11 @@ public class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN extends public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN instance. + * + * @param flowLogCollectorTargetPrototypeVpcIdentityVpcIdentityByCrn the instance to initialize the Builder with + */ public Builder(FlowLogCollectorTargetPrototypeVPCIdentity flowLogCollectorTargetPrototypeVpcIdentityVpcIdentityByCrn) { this.crn = flowLogCollectorTargetPrototypeVpcIdentityVpcIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN() { } + protected FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.java index 76776f95af..d742010a3b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.java @@ -24,6 +24,11 @@ public class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref extends public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref instance. + * + * @param flowLogCollectorTargetPrototypeVpcIdentityVpcIdentityByHref the instance to initialize the Builder with + */ public Builder(FlowLogCollectorTargetPrototypeVPCIdentity flowLogCollectorTargetPrototypeVpcIdentityVpcIdentityByHref) { this.href = flowLogCollectorTargetPrototypeVpcIdentityVpcIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref() { } + protected FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.java index 48c070ae16..301e609112 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.java @@ -24,6 +24,11 @@ public class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById extends F public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById instance. + * + * @param flowLogCollectorTargetPrototypeVpcIdentityVpcIdentityById the instance to initialize the Builder with + */ public Builder(FlowLogCollectorTargetPrototypeVPCIdentity flowLogCollectorTargetPrototypeVpcIdentityVpcIdentityById) { this.id = flowLogCollectorTargetPrototypeVpcIdentityVpcIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById() { } + protected FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetSubnetReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetSubnetReference.java index 38806cbab3..740f1c82ad 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetSubnetReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetSubnetReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String SUBNET = "subnet"; } + + protected FlowLogCollectorTargetSubnetReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetVPCReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetVPCReference.java index b09b86ce82..63ec3381a3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetVPCReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetVPCReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String VPC = "vpc"; } + + protected FlowLogCollectorTargetVPCReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorsPager.java new file mode 100644 index 0000000000..bc740d7382 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * FlowLogCollectorsPager can be used to simplify the use of the "listFlowLogCollectors" method. + */ +public class FlowLogCollectorsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListFlowLogCollectorsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected FlowLogCollectorsPager() { } + + /** + * Constructs a new FlowLogCollectorsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listFlowLogCollectors" method + * @param options the ListFlowLogCollectorsOptions instance to be used to invoke the "listFlowLogCollectors" method + */ + public FlowLogCollectorsPager(Vpc client, ListFlowLogCollectorsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<FlowLogCollector> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListFlowLogCollectorsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + FlowLogCollectorCollection result = client.listFlowLogCollectors(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getFlowLogCollectors(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<FlowLogCollector> containing all results returned by the "listFlowLogCollectors" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GenericResourceReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GenericResourceReferenceDeleted.java index a178fb7caf..dee3be760e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GenericResourceReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GenericResourceReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class GenericResourceReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class GenericResourceReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected GenericResourceReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBackupPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBackupPolicyOptions.java index 5bf7ea4114..8a112d16cc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBackupPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBackupPolicyOptions.java @@ -27,6 +27,11 @@ public class GetBackupPolicyOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetBackupPolicyOptions instance. + * + * @param getBackupPolicyOptions the instance to initialize the Builder with + */ private Builder(GetBackupPolicyOptions getBackupPolicyOptions) { this.id = getBackupPolicyOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetBackupPolicyOptions() { } + protected GetBackupPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBackupPolicyPlanOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBackupPolicyPlanOptions.java index e3f8866f7e..82216c2899 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBackupPolicyPlanOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBackupPolicyPlanOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String backupPolicyId; private String id; + /** + * Instantiates a new Builder from an existing GetBackupPolicyPlanOptions instance. + * + * @param getBackupPolicyPlanOptions the instance to initialize the Builder with + */ private Builder(GetBackupPolicyPlanOptions getBackupPolicyPlanOptions) { this.backupPolicyId = getBackupPolicyPlanOptions.backupPolicyId; this.id = getBackupPolicyPlanOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetBackupPolicyPlanOptions() { } + protected GetBackupPolicyPlanOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.backupPolicyId, "backupPolicyId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerDiskOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerDiskOptions.java index 4fbd8b8f10..b8c1a91ef8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerDiskOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerDiskOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String bareMetalServerId; private String id; + /** + * Instantiates a new Builder from an existing GetBareMetalServerDiskOptions instance. + * + * @param getBareMetalServerDiskOptions the instance to initialize the Builder with + */ private Builder(GetBareMetalServerDiskOptions getBareMetalServerDiskOptions) { this.bareMetalServerId = getBareMetalServerDiskOptions.bareMetalServerId; this.id = getBareMetalServerDiskOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetBareMetalServerDiskOptions() { } + protected GetBareMetalServerDiskOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerInitializationOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerInitializationOptions.java index d54cbf49ba..a169fe952a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerInitializationOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerInitializationOptions.java @@ -27,6 +27,11 @@ public class GetBareMetalServerInitializationOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetBareMetalServerInitializationOptions instance. + * + * @param getBareMetalServerInitializationOptions the instance to initialize the Builder with + */ private Builder(GetBareMetalServerInitializationOptions getBareMetalServerInitializationOptions) { this.id = getBareMetalServerInitializationOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetBareMetalServerInitializationOptions() { } + protected GetBareMetalServerInitializationOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerNetworkInterfaceFloatingIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerNetworkInterfaceFloatingIpOptions.java index 1c40a33ee9..5e8adca5d8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerNetworkInterfaceFloatingIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerNetworkInterfaceFloatingIpOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String networkInterfaceId; private String id; + /** + * Instantiates a new Builder from an existing GetBareMetalServerNetworkInterfaceFloatingIpOptions instance. + * + * @param getBareMetalServerNetworkInterfaceFloatingIpOptions the instance to initialize the Builder with + */ private Builder(GetBareMetalServerNetworkInterfaceFloatingIpOptions getBareMetalServerNetworkInterfaceFloatingIpOptions) { this.bareMetalServerId = getBareMetalServerNetworkInterfaceFloatingIpOptions.bareMetalServerId; this.networkInterfaceId = getBareMetalServerNetworkInterfaceFloatingIpOptions.networkInterfaceId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected GetBareMetalServerNetworkInterfaceFloatingIpOptions() { } + protected GetBareMetalServerNetworkInterfaceFloatingIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerNetworkInterfaceIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerNetworkInterfaceIpOptions.java index fbefcf2eca..e83bc3b5db 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerNetworkInterfaceIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerNetworkInterfaceIpOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String networkInterfaceId; private String id; + /** + * Instantiates a new Builder from an existing GetBareMetalServerNetworkInterfaceIpOptions instance. + * + * @param getBareMetalServerNetworkInterfaceIpOptions the instance to initialize the Builder with + */ private Builder(GetBareMetalServerNetworkInterfaceIpOptions getBareMetalServerNetworkInterfaceIpOptions) { this.bareMetalServerId = getBareMetalServerNetworkInterfaceIpOptions.bareMetalServerId; this.networkInterfaceId = getBareMetalServerNetworkInterfaceIpOptions.networkInterfaceId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected GetBareMetalServerNetworkInterfaceIpOptions() { } + protected GetBareMetalServerNetworkInterfaceIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerNetworkInterfaceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerNetworkInterfaceOptions.java index ba40fd7e65..f32a524558 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerNetworkInterfaceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerNetworkInterfaceOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String bareMetalServerId; private String id; + /** + * Instantiates a new Builder from an existing GetBareMetalServerNetworkInterfaceOptions instance. + * + * @param getBareMetalServerNetworkInterfaceOptions the instance to initialize the Builder with + */ private Builder(GetBareMetalServerNetworkInterfaceOptions getBareMetalServerNetworkInterfaceOptions) { this.bareMetalServerId = getBareMetalServerNetworkInterfaceOptions.bareMetalServerId; this.id = getBareMetalServerNetworkInterfaceOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetBareMetalServerNetworkInterfaceOptions() { } + protected GetBareMetalServerNetworkInterfaceOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerOptions.java index 8126a4e983..3f09dc3a6b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerOptions.java @@ -27,6 +27,11 @@ public class GetBareMetalServerOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetBareMetalServerOptions instance. + * + * @param getBareMetalServerOptions the instance to initialize the Builder with + */ private Builder(GetBareMetalServerOptions getBareMetalServerOptions) { this.id = getBareMetalServerOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetBareMetalServerOptions() { } + protected GetBareMetalServerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerProfileOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerProfileOptions.java index 7af3fd7a05..d440839b14 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerProfileOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetBareMetalServerProfileOptions.java @@ -27,6 +27,11 @@ public class GetBareMetalServerProfileOptions extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing GetBareMetalServerProfileOptions instance. + * + * @param getBareMetalServerProfileOptions the instance to initialize the Builder with + */ private Builder(GetBareMetalServerProfileOptions getBareMetalServerProfileOptions) { this.name = getBareMetalServerProfileOptions.name; } @@ -67,6 +72,8 @@ public Builder name(String name) { } } + protected GetBareMetalServerProfileOptions() { } + protected GetBareMetalServerProfileOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.name, "name cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostDiskOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostDiskOptions.java index c002076212..a2eafcc2a8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostDiskOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostDiskOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String dedicatedHostId; private String id; + /** + * Instantiates a new Builder from an existing GetDedicatedHostDiskOptions instance. + * + * @param getDedicatedHostDiskOptions the instance to initialize the Builder with + */ private Builder(GetDedicatedHostDiskOptions getDedicatedHostDiskOptions) { this.dedicatedHostId = getDedicatedHostDiskOptions.dedicatedHostId; this.id = getDedicatedHostDiskOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetDedicatedHostDiskOptions() { } + protected GetDedicatedHostDiskOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.dedicatedHostId, "dedicatedHostId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostGroupOptions.java index 2c34fa80f3..2874c66ffc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostGroupOptions.java @@ -27,6 +27,11 @@ public class GetDedicatedHostGroupOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetDedicatedHostGroupOptions instance. + * + * @param getDedicatedHostGroupOptions the instance to initialize the Builder with + */ private Builder(GetDedicatedHostGroupOptions getDedicatedHostGroupOptions) { this.id = getDedicatedHostGroupOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetDedicatedHostGroupOptions() { } + protected GetDedicatedHostGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostOptions.java index 6ecb995b6d..dc05c227c2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostOptions.java @@ -27,6 +27,11 @@ public class GetDedicatedHostOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetDedicatedHostOptions instance. + * + * @param getDedicatedHostOptions the instance to initialize the Builder with + */ private Builder(GetDedicatedHostOptions getDedicatedHostOptions) { this.id = getDedicatedHostOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetDedicatedHostOptions() { } + protected GetDedicatedHostOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostProfileOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostProfileOptions.java index 0102942639..f42e89647b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostProfileOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetDedicatedHostProfileOptions.java @@ -27,6 +27,11 @@ public class GetDedicatedHostProfileOptions extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing GetDedicatedHostProfileOptions instance. + * + * @param getDedicatedHostProfileOptions the instance to initialize the Builder with + */ private Builder(GetDedicatedHostProfileOptions getDedicatedHostProfileOptions) { this.name = getDedicatedHostProfileOptions.name; } @@ -67,6 +72,8 @@ public Builder name(String name) { } } + protected GetDedicatedHostProfileOptions() { } + protected GetDedicatedHostProfileOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.name, "name cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayIpOptions.java index c39a079e08..d3ab640258 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayIpOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String endpointGatewayId; private String id; + /** + * Instantiates a new Builder from an existing GetEndpointGatewayIpOptions instance. + * + * @param getEndpointGatewayIpOptions the instance to initialize the Builder with + */ private Builder(GetEndpointGatewayIpOptions getEndpointGatewayIpOptions) { this.endpointGatewayId = getEndpointGatewayIpOptions.endpointGatewayId; this.id = getEndpointGatewayIpOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetEndpointGatewayIpOptions() { } + protected GetEndpointGatewayIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.endpointGatewayId, "endpointGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayOptions.java index b0fde33f10..e850443a49 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayOptions.java @@ -27,6 +27,11 @@ public class GetEndpointGatewayOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetEndpointGatewayOptions instance. + * + * @param getEndpointGatewayOptions the instance to initialize the Builder with + */ private Builder(GetEndpointGatewayOptions getEndpointGatewayOptions) { this.id = getEndpointGatewayOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetEndpointGatewayOptions() { } + protected GetEndpointGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetFloatingIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetFloatingIpOptions.java index f7e030ab99..915437d96e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetFloatingIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetFloatingIpOptions.java @@ -27,6 +27,11 @@ public class GetFloatingIpOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetFloatingIpOptions instance. + * + * @param getFloatingIpOptions the instance to initialize the Builder with + */ private Builder(GetFloatingIpOptions getFloatingIpOptions) { this.id = getFloatingIpOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetFloatingIpOptions() { } + protected GetFloatingIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetFlowLogCollectorOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetFlowLogCollectorOptions.java index 9da5e2d0ba..08e88ee647 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetFlowLogCollectorOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetFlowLogCollectorOptions.java @@ -27,6 +27,11 @@ public class GetFlowLogCollectorOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetFlowLogCollectorOptions instance. + * + * @param getFlowLogCollectorOptions the instance to initialize the Builder with + */ private Builder(GetFlowLogCollectorOptions getFlowLogCollectorOptions) { this.id = getFlowLogCollectorOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetFlowLogCollectorOptions() { } + protected GetFlowLogCollectorOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetIkePolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetIkePolicyOptions.java index e3f6540fe1..57c33428b4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetIkePolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetIkePolicyOptions.java @@ -27,6 +27,11 @@ public class GetIkePolicyOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetIkePolicyOptions instance. + * + * @param getIkePolicyOptions the instance to initialize the Builder with + */ private Builder(GetIkePolicyOptions getIkePolicyOptions) { this.id = getIkePolicyOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetIkePolicyOptions() { } + protected GetIkePolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetImageOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetImageOptions.java index 8af26ec721..7c8328f57d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetImageOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetImageOptions.java @@ -27,6 +27,11 @@ public class GetImageOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetImageOptions instance. + * + * @param getImageOptions the instance to initialize the Builder with + */ private Builder(GetImageOptions getImageOptions) { this.id = getImageOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetImageOptions() { } + protected GetImageOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceDiskOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceDiskOptions.java index 44456f70a7..f5d7f93883 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceDiskOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceDiskOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String instanceId; private String id; + /** + * Instantiates a new Builder from an existing GetInstanceDiskOptions instance. + * + * @param getInstanceDiskOptions the instance to initialize the Builder with + */ private Builder(GetInstanceDiskOptions getInstanceDiskOptions) { this.instanceId = getInstanceDiskOptions.instanceId; this.id = getInstanceDiskOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetInstanceDiskOptions() { } + protected GetInstanceDiskOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupManagerActionOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupManagerActionOptions.java index c20e1eb912..3bbc3f8d47 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupManagerActionOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupManagerActionOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String instanceGroupManagerId; private String id; + /** + * Instantiates a new Builder from an existing GetInstanceGroupManagerActionOptions instance. + * + * @param getInstanceGroupManagerActionOptions the instance to initialize the Builder with + */ private Builder(GetInstanceGroupManagerActionOptions getInstanceGroupManagerActionOptions) { this.instanceGroupId = getInstanceGroupManagerActionOptions.instanceGroupId; this.instanceGroupManagerId = getInstanceGroupManagerActionOptions.instanceGroupManagerId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected GetInstanceGroupManagerActionOptions() { } + protected GetInstanceGroupManagerActionOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupManagerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupManagerOptions.java index c85c2c9e78..6ce99572c6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupManagerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupManagerOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String instanceGroupId; private String id; + /** + * Instantiates a new Builder from an existing GetInstanceGroupManagerOptions instance. + * + * @param getInstanceGroupManagerOptions the instance to initialize the Builder with + */ private Builder(GetInstanceGroupManagerOptions getInstanceGroupManagerOptions) { this.instanceGroupId = getInstanceGroupManagerOptions.instanceGroupId; this.id = getInstanceGroupManagerOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetInstanceGroupManagerOptions() { } + protected GetInstanceGroupManagerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupManagerPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupManagerPolicyOptions.java index ef4df1fa88..56a27588d1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupManagerPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupManagerPolicyOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String instanceGroupManagerId; private String id; + /** + * Instantiates a new Builder from an existing GetInstanceGroupManagerPolicyOptions instance. + * + * @param getInstanceGroupManagerPolicyOptions the instance to initialize the Builder with + */ private Builder(GetInstanceGroupManagerPolicyOptions getInstanceGroupManagerPolicyOptions) { this.instanceGroupId = getInstanceGroupManagerPolicyOptions.instanceGroupId; this.instanceGroupManagerId = getInstanceGroupManagerPolicyOptions.instanceGroupManagerId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected GetInstanceGroupManagerPolicyOptions() { } + protected GetInstanceGroupManagerPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupMembershipOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupMembershipOptions.java index 45d1d3a623..674fcdec4f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupMembershipOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupMembershipOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String instanceGroupId; private String id; + /** + * Instantiates a new Builder from an existing GetInstanceGroupMembershipOptions instance. + * + * @param getInstanceGroupMembershipOptions the instance to initialize the Builder with + */ private Builder(GetInstanceGroupMembershipOptions getInstanceGroupMembershipOptions) { this.instanceGroupId = getInstanceGroupMembershipOptions.instanceGroupId; this.id = getInstanceGroupMembershipOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetInstanceGroupMembershipOptions() { } + protected GetInstanceGroupMembershipOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupOptions.java index 6b4660a051..6b16f6ad3e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceGroupOptions.java @@ -27,6 +27,11 @@ public class GetInstanceGroupOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetInstanceGroupOptions instance. + * + * @param getInstanceGroupOptions the instance to initialize the Builder with + */ private Builder(GetInstanceGroupOptions getInstanceGroupOptions) { this.id = getInstanceGroupOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetInstanceGroupOptions() { } + protected GetInstanceGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceInitializationOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceInitializationOptions.java index 0e067fb9af..eeca9351c7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceInitializationOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceInitializationOptions.java @@ -27,6 +27,11 @@ public class GetInstanceInitializationOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetInstanceInitializationOptions instance. + * + * @param getInstanceInitializationOptions the instance to initialize the Builder with + */ private Builder(GetInstanceInitializationOptions getInstanceInitializationOptions) { this.id = getInstanceInitializationOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetInstanceInitializationOptions() { } + protected GetInstanceInitializationOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceNetworkInterfaceFloatingIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceNetworkInterfaceFloatingIpOptions.java index ff8413fa94..7fcea244e9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceNetworkInterfaceFloatingIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceNetworkInterfaceFloatingIpOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String networkInterfaceId; private String id; + /** + * Instantiates a new Builder from an existing GetInstanceNetworkInterfaceFloatingIpOptions instance. + * + * @param getInstanceNetworkInterfaceFloatingIpOptions the instance to initialize the Builder with + */ private Builder(GetInstanceNetworkInterfaceFloatingIpOptions getInstanceNetworkInterfaceFloatingIpOptions) { this.instanceId = getInstanceNetworkInterfaceFloatingIpOptions.instanceId; this.networkInterfaceId = getInstanceNetworkInterfaceFloatingIpOptions.networkInterfaceId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected GetInstanceNetworkInterfaceFloatingIpOptions() { } + protected GetInstanceNetworkInterfaceFloatingIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceNetworkInterfaceIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceNetworkInterfaceIpOptions.java index d464731597..e046652f5e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceNetworkInterfaceIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceNetworkInterfaceIpOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String networkInterfaceId; private String id; + /** + * Instantiates a new Builder from an existing GetInstanceNetworkInterfaceIpOptions instance. + * + * @param getInstanceNetworkInterfaceIpOptions the instance to initialize the Builder with + */ private Builder(GetInstanceNetworkInterfaceIpOptions getInstanceNetworkInterfaceIpOptions) { this.instanceId = getInstanceNetworkInterfaceIpOptions.instanceId; this.networkInterfaceId = getInstanceNetworkInterfaceIpOptions.networkInterfaceId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected GetInstanceNetworkInterfaceIpOptions() { } + protected GetInstanceNetworkInterfaceIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceNetworkInterfaceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceNetworkInterfaceOptions.java index ed0ce868b9..45028c5330 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceNetworkInterfaceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceNetworkInterfaceOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String instanceId; private String id; + /** + * Instantiates a new Builder from an existing GetInstanceNetworkInterfaceOptions instance. + * + * @param getInstanceNetworkInterfaceOptions the instance to initialize the Builder with + */ private Builder(GetInstanceNetworkInterfaceOptions getInstanceNetworkInterfaceOptions) { this.instanceId = getInstanceNetworkInterfaceOptions.instanceId; this.id = getInstanceNetworkInterfaceOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetInstanceNetworkInterfaceOptions() { } + protected GetInstanceNetworkInterfaceOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceOptions.java index 3dfa443657..18170a759f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceOptions.java @@ -27,6 +27,11 @@ public class GetInstanceOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetInstanceOptions instance. + * + * @param getInstanceOptions the instance to initialize the Builder with + */ private Builder(GetInstanceOptions getInstanceOptions) { this.id = getInstanceOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetInstanceOptions() { } + protected GetInstanceOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceProfileOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceProfileOptions.java index 87b4ba4dcb..79d0f8cd47 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceProfileOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceProfileOptions.java @@ -27,6 +27,11 @@ public class GetInstanceProfileOptions extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing GetInstanceProfileOptions instance. + * + * @param getInstanceProfileOptions the instance to initialize the Builder with + */ private Builder(GetInstanceProfileOptions getInstanceProfileOptions) { this.name = getInstanceProfileOptions.name; } @@ -67,6 +72,8 @@ public Builder name(String name) { } } + protected GetInstanceProfileOptions() { } + protected GetInstanceProfileOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.name, "name cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceTemplateOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceTemplateOptions.java index a7955fa3a5..ebd23c49d5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceTemplateOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceTemplateOptions.java @@ -27,6 +27,11 @@ public class GetInstanceTemplateOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetInstanceTemplateOptions instance. + * + * @param getInstanceTemplateOptions the instance to initialize the Builder with + */ private Builder(GetInstanceTemplateOptions getInstanceTemplateOptions) { this.id = getInstanceTemplateOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetInstanceTemplateOptions() { } + protected GetInstanceTemplateOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceVolumeAttachmentOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceVolumeAttachmentOptions.java index c0ae2456ba..ed644fa722 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceVolumeAttachmentOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetInstanceVolumeAttachmentOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String instanceId; private String id; + /** + * Instantiates a new Builder from an existing GetInstanceVolumeAttachmentOptions instance. + * + * @param getInstanceVolumeAttachmentOptions the instance to initialize the Builder with + */ private Builder(GetInstanceVolumeAttachmentOptions getInstanceVolumeAttachmentOptions) { this.instanceId = getInstanceVolumeAttachmentOptions.instanceId; this.id = getInstanceVolumeAttachmentOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetInstanceVolumeAttachmentOptions() { } + protected GetInstanceVolumeAttachmentOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetIpsecPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetIpsecPolicyOptions.java index 1e831ce220..c67fc67d88 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetIpsecPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetIpsecPolicyOptions.java @@ -27,6 +27,11 @@ public class GetIpsecPolicyOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetIpsecPolicyOptions instance. + * + * @param getIpsecPolicyOptions the instance to initialize the Builder with + */ private Builder(GetIpsecPolicyOptions getIpsecPolicyOptions) { this.id = getIpsecPolicyOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetIpsecPolicyOptions() { } + protected GetIpsecPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetKeyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetKeyOptions.java index 905cf4a2c9..a632e7c168 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetKeyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetKeyOptions.java @@ -27,6 +27,11 @@ public class GetKeyOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetKeyOptions instance. + * + * @param getKeyOptions the instance to initialize the Builder with + */ private Builder(GetKeyOptions getKeyOptions) { this.id = getKeyOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetKeyOptions() { } + protected GetKeyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerListenerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerListenerOptions.java index b865810cfe..e8ef645849 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerListenerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerListenerOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String loadBalancerId; private String id; + /** + * Instantiates a new Builder from an existing GetLoadBalancerListenerOptions instance. + * + * @param getLoadBalancerListenerOptions the instance to initialize the Builder with + */ private Builder(GetLoadBalancerListenerOptions getLoadBalancerListenerOptions) { this.loadBalancerId = getLoadBalancerListenerOptions.loadBalancerId; this.id = getLoadBalancerListenerOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetLoadBalancerListenerOptions() { } + protected GetLoadBalancerListenerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerListenerPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerListenerPolicyOptions.java index 1a9a8e1a1e..1c67197d27 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerListenerPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerListenerPolicyOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String listenerId; private String id; + /** + * Instantiates a new Builder from an existing GetLoadBalancerListenerPolicyOptions instance. + * + * @param getLoadBalancerListenerPolicyOptions the instance to initialize the Builder with + */ private Builder(GetLoadBalancerListenerPolicyOptions getLoadBalancerListenerPolicyOptions) { this.loadBalancerId = getLoadBalancerListenerPolicyOptions.loadBalancerId; this.listenerId = getLoadBalancerListenerPolicyOptions.listenerId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected GetLoadBalancerListenerPolicyOptions() { } + protected GetLoadBalancerListenerPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerListenerPolicyRuleOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerListenerPolicyRuleOptions.java index 6f4c5fa995..162103ea50 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerListenerPolicyRuleOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerListenerPolicyRuleOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String policyId; private String id; + /** + * Instantiates a new Builder from an existing GetLoadBalancerListenerPolicyRuleOptions instance. + * + * @param getLoadBalancerListenerPolicyRuleOptions the instance to initialize the Builder with + */ private Builder(GetLoadBalancerListenerPolicyRuleOptions getLoadBalancerListenerPolicyRuleOptions) { this.loadBalancerId = getLoadBalancerListenerPolicyRuleOptions.loadBalancerId; this.listenerId = getLoadBalancerListenerPolicyRuleOptions.listenerId; @@ -115,6 +120,8 @@ public Builder id(String id) { } } + protected GetLoadBalancerListenerPolicyRuleOptions() { } + protected GetLoadBalancerListenerPolicyRuleOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerOptions.java index a6ba0bb530..7c4f663ca0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerOptions.java @@ -27,6 +27,11 @@ public class GetLoadBalancerOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetLoadBalancerOptions instance. + * + * @param getLoadBalancerOptions the instance to initialize the Builder with + */ private Builder(GetLoadBalancerOptions getLoadBalancerOptions) { this.id = getLoadBalancerOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetLoadBalancerOptions() { } + protected GetLoadBalancerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerPoolMemberOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerPoolMemberOptions.java index 90c2ae6db9..fc2a9065fe 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerPoolMemberOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerPoolMemberOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String poolId; private String id; + /** + * Instantiates a new Builder from an existing GetLoadBalancerPoolMemberOptions instance. + * + * @param getLoadBalancerPoolMemberOptions the instance to initialize the Builder with + */ private Builder(GetLoadBalancerPoolMemberOptions getLoadBalancerPoolMemberOptions) { this.loadBalancerId = getLoadBalancerPoolMemberOptions.loadBalancerId; this.poolId = getLoadBalancerPoolMemberOptions.poolId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected GetLoadBalancerPoolMemberOptions() { } + protected GetLoadBalancerPoolMemberOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerPoolOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerPoolOptions.java index a0a1bef273..da23c40c52 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerPoolOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerPoolOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String loadBalancerId; private String id; + /** + * Instantiates a new Builder from an existing GetLoadBalancerPoolOptions instance. + * + * @param getLoadBalancerPoolOptions the instance to initialize the Builder with + */ private Builder(GetLoadBalancerPoolOptions getLoadBalancerPoolOptions) { this.loadBalancerId = getLoadBalancerPoolOptions.loadBalancerId; this.id = getLoadBalancerPoolOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetLoadBalancerPoolOptions() { } + protected GetLoadBalancerPoolOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerProfileOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerProfileOptions.java index 526f2a28dc..2f29b92887 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerProfileOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerProfileOptions.java @@ -27,6 +27,11 @@ public class GetLoadBalancerProfileOptions extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing GetLoadBalancerProfileOptions instance. + * + * @param getLoadBalancerProfileOptions the instance to initialize the Builder with + */ private Builder(GetLoadBalancerProfileOptions getLoadBalancerProfileOptions) { this.name = getLoadBalancerProfileOptions.name; } @@ -67,6 +72,8 @@ public Builder name(String name) { } } + protected GetLoadBalancerProfileOptions() { } + protected GetLoadBalancerProfileOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.name, "name cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerStatisticsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerStatisticsOptions.java index 01e5abfd9e..e68306b89f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerStatisticsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetLoadBalancerStatisticsOptions.java @@ -27,6 +27,11 @@ public class GetLoadBalancerStatisticsOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetLoadBalancerStatisticsOptions instance. + * + * @param getLoadBalancerStatisticsOptions the instance to initialize the Builder with + */ private Builder(GetLoadBalancerStatisticsOptions getLoadBalancerStatisticsOptions) { this.id = getLoadBalancerStatisticsOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetLoadBalancerStatisticsOptions() { } + protected GetLoadBalancerStatisticsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetNetworkAclOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetNetworkAclOptions.java index 7b1fe4d2c8..80ea7ac6bb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetNetworkAclOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetNetworkAclOptions.java @@ -27,6 +27,11 @@ public class GetNetworkAclOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetNetworkAclOptions instance. + * + * @param getNetworkAclOptions the instance to initialize the Builder with + */ private Builder(GetNetworkAclOptions getNetworkAclOptions) { this.id = getNetworkAclOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetNetworkAclOptions() { } + protected GetNetworkAclOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetNetworkAclRuleOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetNetworkAclRuleOptions.java index 72a276bbff..0495b77272 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetNetworkAclRuleOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetNetworkAclRuleOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String networkAclId; private String id; + /** + * Instantiates a new Builder from an existing GetNetworkAclRuleOptions instance. + * + * @param getNetworkAclRuleOptions the instance to initialize the Builder with + */ private Builder(GetNetworkAclRuleOptions getNetworkAclRuleOptions) { this.networkAclId = getNetworkAclRuleOptions.networkAclId; this.id = getNetworkAclRuleOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetNetworkAclRuleOptions() { } + protected GetNetworkAclRuleOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.networkAclId, "networkAclId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetOperatingSystemOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetOperatingSystemOptions.java index 89a2856460..d809973bf2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetOperatingSystemOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetOperatingSystemOptions.java @@ -27,6 +27,11 @@ public class GetOperatingSystemOptions extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing GetOperatingSystemOptions instance. + * + * @param getOperatingSystemOptions the instance to initialize the Builder with + */ private Builder(GetOperatingSystemOptions getOperatingSystemOptions) { this.name = getOperatingSystemOptions.name; } @@ -67,6 +72,8 @@ public Builder name(String name) { } } + protected GetOperatingSystemOptions() { } + protected GetOperatingSystemOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.name, "name cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetPlacementGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetPlacementGroupOptions.java index 295ff0c783..0a89d37d2e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetPlacementGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetPlacementGroupOptions.java @@ -27,6 +27,11 @@ public class GetPlacementGroupOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetPlacementGroupOptions instance. + * + * @param getPlacementGroupOptions the instance to initialize the Builder with + */ private Builder(GetPlacementGroupOptions getPlacementGroupOptions) { this.id = getPlacementGroupOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetPlacementGroupOptions() { } + protected GetPlacementGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetPublicGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetPublicGatewayOptions.java index 596550916e..f2e90a4e41 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetPublicGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetPublicGatewayOptions.java @@ -27,6 +27,11 @@ public class GetPublicGatewayOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetPublicGatewayOptions instance. + * + * @param getPublicGatewayOptions the instance to initialize the Builder with + */ private Builder(GetPublicGatewayOptions getPublicGatewayOptions) { this.id = getPublicGatewayOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetPublicGatewayOptions() { } + protected GetPublicGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetRegionOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetRegionOptions.java index f06ebd5f63..ca4f7c0444 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetRegionOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetRegionOptions.java @@ -27,6 +27,11 @@ public class GetRegionOptions extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing GetRegionOptions instance. + * + * @param getRegionOptions the instance to initialize the Builder with + */ private Builder(GetRegionOptions getRegionOptions) { this.name = getRegionOptions.name; } @@ -67,6 +72,8 @@ public Builder name(String name) { } } + protected GetRegionOptions() { } + protected GetRegionOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.name, "name cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetRegionZoneOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetRegionZoneOptions.java index 3ff1b60a50..f05a2a1f9c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetRegionZoneOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetRegionZoneOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String regionName; private String name; + /** + * Instantiates a new Builder from an existing GetRegionZoneOptions instance. + * + * @param getRegionZoneOptions the instance to initialize the Builder with + */ private Builder(GetRegionZoneOptions getRegionZoneOptions) { this.regionName = getRegionZoneOptions.regionName; this.name = getRegionZoneOptions.name; @@ -83,6 +88,8 @@ public Builder name(String name) { } } + protected GetRegionZoneOptions() { } + protected GetRegionZoneOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.regionName, "regionName cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSecurityGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSecurityGroupOptions.java index 21fd330d55..392f55b8b5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSecurityGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSecurityGroupOptions.java @@ -27,6 +27,11 @@ public class GetSecurityGroupOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetSecurityGroupOptions instance. + * + * @param getSecurityGroupOptions the instance to initialize the Builder with + */ private Builder(GetSecurityGroupOptions getSecurityGroupOptions) { this.id = getSecurityGroupOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetSecurityGroupOptions() { } + protected GetSecurityGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSecurityGroupRuleOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSecurityGroupRuleOptions.java index 9010607288..50fc820a1c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSecurityGroupRuleOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSecurityGroupRuleOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String securityGroupId; private String id; + /** + * Instantiates a new Builder from an existing GetSecurityGroupRuleOptions instance. + * + * @param getSecurityGroupRuleOptions the instance to initialize the Builder with + */ private Builder(GetSecurityGroupRuleOptions getSecurityGroupRuleOptions) { this.securityGroupId = getSecurityGroupRuleOptions.securityGroupId; this.id = getSecurityGroupRuleOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetSecurityGroupRuleOptions() { } + protected GetSecurityGroupRuleOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.securityGroupId, "securityGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSecurityGroupTargetOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSecurityGroupTargetOptions.java index 97083971f6..833bafacfd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSecurityGroupTargetOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSecurityGroupTargetOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String securityGroupId; private String id; + /** + * Instantiates a new Builder from an existing GetSecurityGroupTargetOptions instance. + * + * @param getSecurityGroupTargetOptions the instance to initialize the Builder with + */ private Builder(GetSecurityGroupTargetOptions getSecurityGroupTargetOptions) { this.securityGroupId = getSecurityGroupTargetOptions.securityGroupId; this.id = getSecurityGroupTargetOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetSecurityGroupTargetOptions() { } + protected GetSecurityGroupTargetOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.securityGroupId, "securityGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSnapshotCloneOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSnapshotCloneOptions.java index ef10bab281..70af8bdd3b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSnapshotCloneOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSnapshotCloneOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String id; private String zoneName; + /** + * Instantiates a new Builder from an existing GetSnapshotCloneOptions instance. + * + * @param getSnapshotCloneOptions the instance to initialize the Builder with + */ private Builder(GetSnapshotCloneOptions getSnapshotCloneOptions) { this.id = getSnapshotCloneOptions.id; this.zoneName = getSnapshotCloneOptions.zoneName; @@ -83,6 +88,8 @@ public Builder zoneName(String zoneName) { } } + protected GetSnapshotCloneOptions() { } + protected GetSnapshotCloneOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSnapshotOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSnapshotOptions.java index 829a067f2a..3b2eabc160 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSnapshotOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSnapshotOptions.java @@ -27,6 +27,11 @@ public class GetSnapshotOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetSnapshotOptions instance. + * + * @param getSnapshotOptions the instance to initialize the Builder with + */ private Builder(GetSnapshotOptions getSnapshotOptions) { this.id = getSnapshotOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetSnapshotOptions() { } + protected GetSnapshotOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetNetworkAclOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetNetworkAclOptions.java index 3016e6897c..daa3b787a5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetNetworkAclOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetNetworkAclOptions.java @@ -27,6 +27,11 @@ public class GetSubnetNetworkAclOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetSubnetNetworkAclOptions instance. + * + * @param getSubnetNetworkAclOptions the instance to initialize the Builder with + */ private Builder(GetSubnetNetworkAclOptions getSubnetNetworkAclOptions) { this.id = getSubnetNetworkAclOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetSubnetNetworkAclOptions() { } + protected GetSubnetNetworkAclOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetOptions.java index 59e09e6f8b..2b8a4fc607 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetOptions.java @@ -27,6 +27,11 @@ public class GetSubnetOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetSubnetOptions instance. + * + * @param getSubnetOptions the instance to initialize the Builder with + */ private Builder(GetSubnetOptions getSubnetOptions) { this.id = getSubnetOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetSubnetOptions() { } + protected GetSubnetOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetPublicGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetPublicGatewayOptions.java index 1746d59bad..20653a2d59 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetPublicGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetPublicGatewayOptions.java @@ -27,6 +27,11 @@ public class GetSubnetPublicGatewayOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetSubnetPublicGatewayOptions instance. + * + * @param getSubnetPublicGatewayOptions the instance to initialize the Builder with + */ private Builder(GetSubnetPublicGatewayOptions getSubnetPublicGatewayOptions) { this.id = getSubnetPublicGatewayOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetSubnetPublicGatewayOptions() { } + protected GetSubnetPublicGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetReservedIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetReservedIpOptions.java index c40322d42e..a1ae95c272 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetReservedIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetReservedIpOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String subnetId; private String id; + /** + * Instantiates a new Builder from an existing GetSubnetReservedIpOptions instance. + * + * @param getSubnetReservedIpOptions the instance to initialize the Builder with + */ private Builder(GetSubnetReservedIpOptions getSubnetReservedIpOptions) { this.subnetId = getSubnetReservedIpOptions.subnetId; this.id = getSubnetReservedIpOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetSubnetReservedIpOptions() { } + protected GetSubnetReservedIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.subnetId, "subnetId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetRoutingTableOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetRoutingTableOptions.java index 12aeafd562..ef2ce8974b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetRoutingTableOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetSubnetRoutingTableOptions.java @@ -27,6 +27,11 @@ public class GetSubnetRoutingTableOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetSubnetRoutingTableOptions instance. + * + * @param getSubnetRoutingTableOptions the instance to initialize the Builder with + */ private Builder(GetSubnetRoutingTableOptions getSubnetRoutingTableOptions) { this.id = getSubnetRoutingTableOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetSubnetRoutingTableOptions() { } + protected GetSubnetRoutingTableOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVolumeOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVolumeOptions.java index 676477481b..5af0c072f4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVolumeOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVolumeOptions.java @@ -27,6 +27,11 @@ public class GetVolumeOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetVolumeOptions instance. + * + * @param getVolumeOptions the instance to initialize the Builder with + */ private Builder(GetVolumeOptions getVolumeOptions) { this.id = getVolumeOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetVolumeOptions() { } + protected GetVolumeOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVolumeProfileOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVolumeProfileOptions.java index 0209bdd575..5d8242aa8f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVolumeProfileOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVolumeProfileOptions.java @@ -27,6 +27,11 @@ public class GetVolumeProfileOptions extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing GetVolumeProfileOptions instance. + * + * @param getVolumeProfileOptions the instance to initialize the Builder with + */ private Builder(GetVolumeProfileOptions getVolumeProfileOptions) { this.name = getVolumeProfileOptions.name; } @@ -67,6 +72,8 @@ public Builder name(String name) { } } + protected GetVolumeProfileOptions() { } + protected GetVolumeProfileOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.name, "name cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcAddressPrefixOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcAddressPrefixOptions.java index 6fe092db1c..4b6805d36a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcAddressPrefixOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcAddressPrefixOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpcId; private String id; + /** + * Instantiates a new Builder from an existing GetVpcAddressPrefixOptions instance. + * + * @param getVpcAddressPrefixOptions the instance to initialize the Builder with + */ private Builder(GetVpcAddressPrefixOptions getVpcAddressPrefixOptions) { this.vpcId = getVpcAddressPrefixOptions.vpcId; this.id = getVpcAddressPrefixOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetVpcAddressPrefixOptions() { } + protected GetVpcAddressPrefixOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcDefaultNetworkAclOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcDefaultNetworkAclOptions.java index 4dab5b8359..11979724db 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcDefaultNetworkAclOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcDefaultNetworkAclOptions.java @@ -27,6 +27,11 @@ public class GetVpcDefaultNetworkAclOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetVpcDefaultNetworkAclOptions instance. + * + * @param getVpcDefaultNetworkAclOptions the instance to initialize the Builder with + */ private Builder(GetVpcDefaultNetworkAclOptions getVpcDefaultNetworkAclOptions) { this.id = getVpcDefaultNetworkAclOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetVpcDefaultNetworkAclOptions() { } + protected GetVpcDefaultNetworkAclOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcDefaultRoutingTableOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcDefaultRoutingTableOptions.java index a9be8078ef..0fedb3fb45 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcDefaultRoutingTableOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcDefaultRoutingTableOptions.java @@ -27,6 +27,11 @@ public class GetVpcDefaultRoutingTableOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetVpcDefaultRoutingTableOptions instance. + * + * @param getVpcDefaultRoutingTableOptions the instance to initialize the Builder with + */ private Builder(GetVpcDefaultRoutingTableOptions getVpcDefaultRoutingTableOptions) { this.id = getVpcDefaultRoutingTableOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetVpcDefaultRoutingTableOptions() { } + protected GetVpcDefaultRoutingTableOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcDefaultSecurityGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcDefaultSecurityGroupOptions.java index 047837e3c1..e3ade50c0c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcDefaultSecurityGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcDefaultSecurityGroupOptions.java @@ -27,6 +27,11 @@ public class GetVpcDefaultSecurityGroupOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetVpcDefaultSecurityGroupOptions instance. + * + * @param getVpcDefaultSecurityGroupOptions the instance to initialize the Builder with + */ private Builder(GetVpcDefaultSecurityGroupOptions getVpcDefaultSecurityGroupOptions) { this.id = getVpcDefaultSecurityGroupOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetVpcDefaultSecurityGroupOptions() { } + protected GetVpcDefaultSecurityGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcOptions.java index 188f38e694..b96f5960c4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcOptions.java @@ -27,6 +27,11 @@ public class GetVpcOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetVpcOptions instance. + * + * @param getVpcOptions the instance to initialize the Builder with + */ private Builder(GetVpcOptions getVpcOptions) { this.id = getVpcOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetVpcOptions() { } + protected GetVpcOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRouteOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRouteOptions.java index 7ebc96784f..33a1c0a8a4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRouteOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRouteOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpcId; private String id; + /** + * Instantiates a new Builder from an existing GetVpcRouteOptions instance. + * + * @param getVpcRouteOptions the instance to initialize the Builder with + */ private Builder(GetVpcRouteOptions getVpcRouteOptions) { this.vpcId = getVpcRouteOptions.vpcId; this.id = getVpcRouteOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetVpcRouteOptions() { } + protected GetVpcRouteOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRoutingTableOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRoutingTableOptions.java index da352df3d3..d41d3f799c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRoutingTableOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRoutingTableOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpcId; private String id; + /** + * Instantiates a new Builder from an existing GetVpcRoutingTableOptions instance. + * + * @param getVpcRoutingTableOptions the instance to initialize the Builder with + */ private Builder(GetVpcRoutingTableOptions getVpcRoutingTableOptions) { this.vpcId = getVpcRoutingTableOptions.vpcId; this.id = getVpcRoutingTableOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetVpcRoutingTableOptions() { } + protected GetVpcRoutingTableOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRoutingTableRouteOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRoutingTableRouteOptions.java index b79d947cca..4825bf2087 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRoutingTableRouteOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRoutingTableRouteOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String routingTableId; private String id; + /** + * Instantiates a new Builder from an existing GetVpcRoutingTableRouteOptions instance. + * + * @param getVpcRoutingTableRouteOptions the instance to initialize the Builder with + */ private Builder(GetVpcRoutingTableRouteOptions getVpcRoutingTableRouteOptions) { this.vpcId = getVpcRoutingTableRouteOptions.vpcId; this.routingTableId = getVpcRoutingTableRouteOptions.routingTableId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected GetVpcRoutingTableRouteOptions() { } + protected GetVpcRoutingTableRouteOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayConnectionOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayConnectionOptions.java index 13862c66ea..3eda92cd65 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayConnectionOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayConnectionOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpnGatewayId; private String id; + /** + * Instantiates a new Builder from an existing GetVpnGatewayConnectionOptions instance. + * + * @param getVpnGatewayConnectionOptions the instance to initialize the Builder with + */ private Builder(GetVpnGatewayConnectionOptions getVpnGatewayConnectionOptions) { this.vpnGatewayId = getVpnGatewayConnectionOptions.vpnGatewayId; this.id = getVpnGatewayConnectionOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetVpnGatewayConnectionOptions() { } + protected GetVpnGatewayConnectionOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, "vpnGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayOptions.java index fe7a3635ae..9802324480 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayOptions.java @@ -27,6 +27,11 @@ public class GetVpnGatewayOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetVpnGatewayOptions instance. + * + * @param getVpnGatewayOptions the instance to initialize the Builder with + */ private Builder(GetVpnGatewayOptions getVpnGatewayOptions) { this.id = getVpnGatewayOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetVpnGatewayOptions() { } + protected GetVpnGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerClientConfigurationOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerClientConfigurationOptions.java index 1139ceaa89..0b041cabab 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerClientConfigurationOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerClientConfigurationOptions.java @@ -27,6 +27,11 @@ public class GetVpnServerClientConfigurationOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetVpnServerClientConfigurationOptions instance. + * + * @param getVpnServerClientConfigurationOptions the instance to initialize the Builder with + */ private Builder(GetVpnServerClientConfigurationOptions getVpnServerClientConfigurationOptions) { this.id = getVpnServerClientConfigurationOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetVpnServerClientConfigurationOptions() { } + protected GetVpnServerClientConfigurationOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerClientOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerClientOptions.java index 7c3849e4b3..143d9b2950 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerClientOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerClientOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpnServerId; private String id; + /** + * Instantiates a new Builder from an existing GetVpnServerClientOptions instance. + * + * @param getVpnServerClientOptions the instance to initialize the Builder with + */ private Builder(GetVpnServerClientOptions getVpnServerClientOptions) { this.vpnServerId = getVpnServerClientOptions.vpnServerId; this.id = getVpnServerClientOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetVpnServerClientOptions() { } + protected GetVpnServerClientOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnServerId, "vpnServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerOptions.java index e8c87e2311..d3193e4fcb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerOptions.java @@ -27,6 +27,11 @@ public class GetVpnServerOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing GetVpnServerOptions instance. + * + * @param getVpnServerOptions the instance to initialize the Builder with + */ private Builder(GetVpnServerOptions getVpnServerOptions) { this.id = getVpnServerOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected GetVpnServerOptions() { } + protected GetVpnServerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerRouteOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerRouteOptions.java index 36827cec2c..90e01c4291 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerRouteOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnServerRouteOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpnServerId; private String id; + /** + * Instantiates a new Builder from an existing GetVpnServerRouteOptions instance. + * + * @param getVpnServerRouteOptions the instance to initialize the Builder with + */ private Builder(GetVpnServerRouteOptions getVpnServerRouteOptions) { this.vpnServerId = getVpnServerRouteOptions.vpnServerId; this.id = getVpnServerRouteOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected GetVpnServerRouteOptions() { } + protected GetVpnServerRouteOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnServerId, "vpnServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicy.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicy.java index 6afd5ab456..6fa640d290 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicy.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicy.java @@ -24,7 +24,9 @@ public class IKEPolicy extends GenericModel { /** - * The authentication algorithm. + * The authentication algorithm + * + * The `md5` and `sha1` algorithms have been deprecated. */ public interface AuthenticationAlgorithm { /** md5. */ @@ -33,16 +35,22 @@ public interface AuthenticationAlgorithm { String SHA1 = "sha1"; /** sha256. */ String SHA256 = "sha256"; + /** sha384. */ + String SHA384 = "sha384"; /** sha512. */ String SHA512 = "sha512"; } /** - * The encryption algorithm. + * The encryption algorithm + * + * The `triple_des` algorithm has been deprecated. */ public interface EncryptionAlgorithm { /** aes128. */ String AES128 = "aes128"; + /** aes192. */ + String AES192 = "aes192"; /** aes256. */ String AES256 = "aes256"; /** triple_des. */ @@ -88,10 +96,14 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected IKEPolicy() { } + /** * Gets the authenticationAlgorithm. * - * The authentication algorithm. + * The authentication algorithm + * + * The `md5` and `sha1` algorithms have been deprecated. * * @return the authenticationAlgorithm */ @@ -124,7 +136,9 @@ public Date getCreatedAt() { /** * Gets the dhGroup. * - * The Diffie-Hellman group. + * The Diffie-Hellman group + * + * Groups `2` and `5` have been deprecated. * * @return the dhGroup */ @@ -135,7 +149,9 @@ public Long getDhGroup() { /** * Gets the encryptionAlgorithm. * - * The encryption algorithm. + * The encryption algorithm + * + * The `triple_des` algorithm has been deprecated. * * @return the encryptionAlgorithm */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollection.java index 86101150b5..6c6f46f90b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollection.java @@ -30,6 +30,8 @@ public class IKEPolicyCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected IKEPolicyCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollectionFirst.java index 77458c8c8a..c618a78aa9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollectionFirst.java @@ -21,6 +21,8 @@ public class IKEPolicyCollectionFirst extends GenericModel { protected String href; + protected IKEPolicyCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollectionNext.java index 90df33a5d6..505e308d8d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollectionNext.java @@ -21,6 +21,8 @@ public class IKEPolicyCollectionNext extends GenericModel { protected String href; + protected IKEPolicyCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyPatch.java index 052d8c922d..29668b4151 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyPatch.java @@ -24,7 +24,9 @@ public class IKEPolicyPatch extends GenericModel { /** - * The authentication algorithm. + * The authentication algorithm + * + * The `md5` and `sha1` algorithms have been deprecated. */ public interface AuthenticationAlgorithm { /** md5. */ @@ -33,16 +35,22 @@ public interface AuthenticationAlgorithm { String SHA1 = "sha1"; /** sha256. */ String SHA256 = "sha256"; + /** sha384. */ + String SHA384 = "sha384"; /** sha512. */ String SHA512 = "sha512"; } /** - * The encryption algorithm. + * The encryption algorithm + * + * The `triple_des` algorithm has been deprecated. */ public interface EncryptionAlgorithm { /** aes128. */ String AES128 = "aes128"; + /** aes192. */ + String AES192 = "aes192"; /** aes256. */ String AES256 = "aes256"; /** triple_des. */ @@ -72,6 +80,11 @@ public static class Builder { private Long keyLifetime; private String name; + /** + * Instantiates a new Builder from an existing IKEPolicyPatch instance. + * + * @param ikePolicyPatch the instance to initialize the Builder with + */ private Builder(IKEPolicyPatch ikePolicyPatch) { this.authenticationAlgorithm = ikePolicyPatch.authenticationAlgorithm; this.dhGroup = ikePolicyPatch.dhGroup; @@ -163,6 +176,8 @@ public Builder name(String name) { } } + protected IKEPolicyPatch() { } + protected IKEPolicyPatch(Builder builder) { authenticationAlgorithm = builder.authenticationAlgorithm; dhGroup = builder.dhGroup; @@ -184,7 +199,9 @@ public Builder newBuilder() { /** * Gets the authenticationAlgorithm. * - * The authentication algorithm. + * The authentication algorithm + * + * The `md5` and `sha1` algorithms have been deprecated. * * @return the authenticationAlgorithm */ @@ -195,7 +212,9 @@ public String authenticationAlgorithm() { /** * Gets the dhGroup. * - * The Diffie-Hellman group. + * The Diffie-Hellman group + * + * Groups `2` and `5` have been deprecated. * * @return the dhGroup */ @@ -206,7 +225,9 @@ public Long dhGroup() { /** * Gets the encryptionAlgorithm. * - * The encryption algorithm. + * The encryption algorithm + * + * The `triple_des` algorithm has been deprecated. * * @return the encryptionAlgorithm */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyReference.java index bf8e191d43..a124606733 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyReference.java @@ -35,10 +35,12 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected IKEPolicyReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyReferenceDeleted.java index c242661169..049e8d73c8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class IKEPolicyReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class IKEPolicyReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected IKEPolicyReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IP.java index ba2f8e5c2b..291f0d4610 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IP.java @@ -27,6 +27,11 @@ public class IP extends GenericModel { public static class Builder { private String address; + /** + * Instantiates a new Builder from an existing IP instance. + * + * @param ip the instance to initialize the Builder with + */ private Builder(IP ip) { this.address = ip.address; } @@ -67,6 +72,8 @@ public Builder address(String address) { } } + protected IP() { } + protected IP(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.address, "address cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicy.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicy.java index fae93068be..7ee032f40b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicy.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicy.java @@ -24,15 +24,24 @@ public class IPsecPolicy extends GenericModel { /** - * The authentication algorithm. + * The authentication algorithm + * + * The `md5` and `sha1` algorithms have been deprecated + * + * Must be `disabled` if and only if the `encryption_algorithm` is + * `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. */ public interface AuthenticationAlgorithm { + /** disabled. */ + String DISABLED = "disabled"; /** md5. */ String MD5 = "md5"; /** sha1. */ String SHA1 = "sha1"; /** sha256. */ String SHA256 = "sha256"; + /** sha384. */ + String SHA384 = "sha384"; /** sha512. */ String SHA512 = "sha512"; } @@ -46,29 +55,65 @@ public interface EncapsulationMode { } /** - * The encryption algorithm. + * The encryption algorithm + * + * The `triple_des` algorithm has been deprecated + * + * The `authentication_algorithm` must be `disabled` if and only if + * `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + * `aes256gcm16`. */ public interface EncryptionAlgorithm { /** aes128. */ String AES128 = "aes128"; + /** aes128gcm16. */ + String AES128GCM16 = "aes128gcm16"; + /** aes192. */ + String AES192 = "aes192"; + /** aes192gcm16. */ + String AES192GCM16 = "aes192gcm16"; /** aes256. */ String AES256 = "aes256"; + /** aes256gcm16. */ + String AES256GCM16 = "aes256gcm16"; /** triple_des. */ String TRIPLE_DES = "triple_des"; } /** - * Perfect Forward Secrecy. + * Perfect Forward Secrecy + * + * Groups `group_2` and `group_5` have been deprecated. */ public interface Pfs { /** disabled. */ String DISABLED = "disabled"; /** group_14. */ String GROUP_14 = "group_14"; + /** group_15. */ + String GROUP_15 = "group_15"; + /** group_16. */ + String GROUP_16 = "group_16"; + /** group_17. */ + String GROUP_17 = "group_17"; + /** group_18. */ + String GROUP_18 = "group_18"; /** group_19. */ String GROUP_19 = "group_19"; /** group_2. */ String GROUP_2 = "group_2"; + /** group_20. */ + String GROUP_20 = "group_20"; + /** group_21. */ + String GROUP_21 = "group_21"; + /** group_22. */ + String GROUP_22 = "group_22"; + /** group_23. */ + String GROUP_23 = "group_23"; + /** group_24. */ + String GROUP_24 = "group_24"; + /** group_31. */ + String GROUP_31 = "group_31"; /** group_5. */ String GROUP_5 = "group_5"; } @@ -111,10 +156,17 @@ public interface TransformProtocol { @SerializedName("transform_protocol") protected String transformProtocol; + protected IPsecPolicy() { } + /** * Gets the authenticationAlgorithm. * - * The authentication algorithm. + * The authentication algorithm + * + * The `md5` and `sha1` algorithms have been deprecated + * + * Must be `disabled` if and only if the `encryption_algorithm` is + * `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. * * @return the authenticationAlgorithm */ @@ -158,7 +210,13 @@ public String getEncapsulationMode() { /** * Gets the encryptionAlgorithm. * - * The encryption algorithm. + * The encryption algorithm + * + * The `triple_des` algorithm has been deprecated + * + * The `authentication_algorithm` must be `disabled` if and only if + * `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + * `aes256gcm16`. * * @return the encryptionAlgorithm */ @@ -213,7 +271,9 @@ public String getName() { /** * Gets the pfs. * - * Perfect Forward Secrecy. + * Perfect Forward Secrecy + * + * Groups `group_2` and `group_5` have been deprecated. * * @return the pfs */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollection.java index da1fc5a645..e9382d0c02 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollection.java @@ -30,6 +30,8 @@ public class IPsecPolicyCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected IPsecPolicyCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollectionFirst.java index 0c8db98699..923800ee7d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollectionFirst.java @@ -21,6 +21,8 @@ public class IPsecPolicyCollectionFirst extends GenericModel { protected String href; + protected IPsecPolicyCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollectionNext.java index 0b7fc9f297..6834ee9da2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollectionNext.java @@ -21,6 +21,8 @@ public class IPsecPolicyCollectionNext extends GenericModel { protected String href; + protected IPsecPolicyCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyPatch.java index bd99408e62..249ea8e274 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyPatch.java @@ -24,43 +24,88 @@ public class IPsecPolicyPatch extends GenericModel { /** - * The authentication algorithm. + * The authentication algorithm + * + * The `md5` and `sha1` algorithms have been deprecated + * + * Must be `disabled` if and only if the `encryption_algorithm` is + * `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. */ public interface AuthenticationAlgorithm { + /** disabled. */ + String DISABLED = "disabled"; /** md5. */ String MD5 = "md5"; /** sha1. */ String SHA1 = "sha1"; /** sha256. */ String SHA256 = "sha256"; + /** sha384. */ + String SHA384 = "sha384"; /** sha512. */ String SHA512 = "sha512"; } /** - * The encryption algorithm. + * The encryption algorithm + * + * The `triple_des` algorithm has been deprecated + * + * The `authentication_algorithm` must be `disabled` if and only if + * `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + * `aes256gcm16`. */ public interface EncryptionAlgorithm { /** aes128. */ String AES128 = "aes128"; + /** aes128gcm16. */ + String AES128GCM16 = "aes128gcm16"; + /** aes192. */ + String AES192 = "aes192"; + /** aes192gcm16. */ + String AES192GCM16 = "aes192gcm16"; /** aes256. */ String AES256 = "aes256"; + /** aes256gcm16. */ + String AES256GCM16 = "aes256gcm16"; /** triple_des. */ String TRIPLE_DES = "triple_des"; } /** - * Perfect Forward Secrecy. + * Perfect Forward Secrecy + * + * Groups `group_2` and `group_5` have been deprecated. */ public interface Pfs { /** disabled. */ String DISABLED = "disabled"; /** group_14. */ String GROUP_14 = "group_14"; + /** group_15. */ + String GROUP_15 = "group_15"; + /** group_16. */ + String GROUP_16 = "group_16"; + /** group_17. */ + String GROUP_17 = "group_17"; + /** group_18. */ + String GROUP_18 = "group_18"; /** group_19. */ String GROUP_19 = "group_19"; /** group_2. */ String GROUP_2 = "group_2"; + /** group_20. */ + String GROUP_20 = "group_20"; + /** group_21. */ + String GROUP_21 = "group_21"; + /** group_22. */ + String GROUP_22 = "group_22"; + /** group_23. */ + String GROUP_23 = "group_23"; + /** group_24. */ + String GROUP_24 = "group_24"; + /** group_31. */ + String GROUP_31 = "group_31"; /** group_5. */ String GROUP_5 = "group_5"; } @@ -84,6 +129,11 @@ public static class Builder { private String name; private String pfs; + /** + * Instantiates a new Builder from an existing IPsecPolicyPatch instance. + * + * @param iPsecPolicyPatch the instance to initialize the Builder with + */ private Builder(IPsecPolicyPatch iPsecPolicyPatch) { this.authenticationAlgorithm = iPsecPolicyPatch.authenticationAlgorithm; this.encryptionAlgorithm = iPsecPolicyPatch.encryptionAlgorithm; @@ -163,6 +213,8 @@ public Builder pfs(String pfs) { } } + protected IPsecPolicyPatch() { } + protected IPsecPolicyPatch(Builder builder) { authenticationAlgorithm = builder.authenticationAlgorithm; encryptionAlgorithm = builder.encryptionAlgorithm; @@ -183,7 +235,12 @@ public Builder newBuilder() { /** * Gets the authenticationAlgorithm. * - * The authentication algorithm. + * The authentication algorithm + * + * The `md5` and `sha1` algorithms have been deprecated + * + * Must be `disabled` if and only if the `encryption_algorithm` is + * `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. * * @return the authenticationAlgorithm */ @@ -194,7 +251,13 @@ public String authenticationAlgorithm() { /** * Gets the encryptionAlgorithm. * - * The encryption algorithm. + * The encryption algorithm + * + * The `triple_des` algorithm has been deprecated + * + * The `authentication_algorithm` must be `disabled` if and only if + * `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + * `aes256gcm16`. * * @return the encryptionAlgorithm */ @@ -227,7 +290,9 @@ public String name() { /** * Gets the pfs. * - * Perfect Forward Secrecy. + * Perfect Forward Secrecy + * + * Groups `group_2` and `group_5` have been deprecated. * * @return the pfs */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyReference.java index b734743160..f65df023bb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyReference.java @@ -35,10 +35,12 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected IPsecPolicyReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyReferenceDeleted.java index a35f271df1..d1df3e259e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class IPsecPolicyReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class IPsecPolicyReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected IPsecPolicyReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IkePoliciesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IkePoliciesPager.java new file mode 100644 index 0000000000..9e0467ffc0 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IkePoliciesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * IkePoliciesPager can be used to simplify the use of the "listIkePolicies" method. + */ +public class IkePoliciesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListIkePoliciesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected IkePoliciesPager() { } + + /** + * Constructs a new IkePoliciesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listIkePolicies" method + * @param options the ListIkePoliciesOptions instance to be used to invoke the "listIkePolicies" method + */ + public IkePoliciesPager(Vpc client, ListIkePoliciesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<IKEPolicy> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListIkePoliciesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + IKEPolicyCollection result = client.listIkePolicies(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getIkePolicies(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<IKEPolicy> containing all results returned by the "listIkePolicies" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Image.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Image.java index 1bfc7bcef9..86ac2be0d4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Image.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Image.java @@ -38,9 +38,8 @@ public interface Encryption { * - available: image can be used (provisionable) * - deleting: image is being deleted, and can no longer be used to provision new * resources - * - deprecated: image can be used, but is slated to become `obsolete` (provisionable) + * - deprecated: image is administratively slated to be deleted * - failed: image is corrupt or did not pass validation - * - obsolete: image can no longer be used to provision new resources * - pending: image is being imported and is not yet `available` * - tentative: image import has timed out (contact support) * - unusable: image cannot be used (see `status_reasons[]` for possible remediation) @@ -76,6 +75,8 @@ public interface Visibility { String X_PUBLIC = "public"; } + @SerializedName("catalog_offering") + protected ImageCatalogOffering catalogOffering; @SerializedName("created_at") protected Date createdAt; protected String crn; @@ -99,6 +100,17 @@ public interface Visibility { protected List statusReasons; protected String visibility; + protected Image() { } + + /** + * Gets the catalogOffering. + * + * @return the catalogOffering + */ + public ImageCatalogOffering getCatalogOffering() { + return catalogOffering; + } + /** * Gets the createdAt. * @@ -246,9 +258,8 @@ public VolumeReference getSourceVolume() { * - available: image can be used (provisionable) * - deleting: image is being deleted, and can no longer be used to provision new * resources - * - deprecated: image can be used, but is slated to become `obsolete` (provisionable) + * - deprecated: image is administratively slated to be deleted * - failed: image is corrupt or did not pass validation - * - obsolete: image can no longer be used to provision new resources * - pending: image is being imported and is not yet `available` * - tentative: image import has timed out (contact support) * - unusable: image cannot be used (see `status_reasons[]` for possible remediation) @@ -266,7 +277,18 @@ public String getStatus() { /** * Gets the statusReasons. * - * The reasons for the current status (if any). + * The reasons for the current status (if any): + * - `encrypted_data_key_invalid`: image cannot be decrypted with the specified + * `encryption_key` + * - `encryption_key_deleted`: image unusable because its `encryption_key` was deleted + * - `encryption_key_disabled`: image unusable until its `encryption_key` is re-enabled + * - `image_data_corrupted`: image data is corrupt, or is not in the specified format + * - `image_provisioned_size_unsupported`: image requires a boot volume size greater + * than the maximum supported value + * - `image_request_in_progress`: image operation is in progress (such as an import from + * Cloud Object Storage) + * - `image_request_queued`: image request has been accepted but the requested + * operation has not started * * The enumerated reason code values for this property will expand in the future. When processing this property, check * for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCatalogOffering.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCatalogOffering.java new file mode 100644 index 0000000000..2c68349656 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCatalogOffering.java @@ -0,0 +1,56 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * ImageCatalogOffering. + */ +public class ImageCatalogOffering extends GenericModel { + + protected Boolean managed; + protected CatalogOfferingVersionReference version; + + protected ImageCatalogOffering() { } + + /** + * Gets the managed. + * + * Indicates whether this image is managed as part of a + * [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. If an image is managed, + * accounts in the same + * [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise) with access to that catalog can + * specify the image's catalog offering version CRN to provision virtual server instances using the image. + * + * @return the managed + */ + public Boolean isManaged() { + return managed; + } + + /** + * Gets the version. + * + * The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + * offering version associated with this image. + * + * If absent, this image is not associated with a cloud catalog offering. + * + * @return the version + */ + public CatalogOfferingVersionReference getVersion() { + return version; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollection.java index 775027c770..703af6534d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollection.java @@ -26,6 +26,8 @@ public class ImageCollection extends GenericModel { protected Long limit; protected ImageCollectionNext next; + protected ImageCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionFirst.java index b141acd822..eb9b8c999f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionFirst.java @@ -21,6 +21,8 @@ public class ImageCollectionFirst extends GenericModel { protected String href; + protected ImageCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionNext.java index e865d79a77..d8068cad5c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionNext.java @@ -21,6 +21,8 @@ public class ImageCollectionNext extends GenericModel { protected String href; + protected ImageCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageFile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageFile.java index 67657c8392..8844848120 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageFile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageFile.java @@ -22,6 +22,8 @@ public class ImageFile extends GenericModel { protected ImageFileChecksums checksums; protected Long size; + protected ImageFile() { } + /** * Gets the checksums. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageFileChecksums.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageFileChecksums.java index bed4d6377f..7cb1a326ef 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageFileChecksums.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageFileChecksums.java @@ -21,6 +21,8 @@ public class ImageFileChecksums extends GenericModel { protected String sha256; + protected ImageFileChecksums() { } + /** * Gets the sha256. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageFilePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageFilePrototype.java index bb413ec40f..f3ee0af954 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageFilePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageFilePrototype.java @@ -27,6 +27,11 @@ public class ImageFilePrototype extends GenericModel { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing ImageFilePrototype instance. + * + * @param imageFilePrototype the instance to initialize the Builder with + */ private Builder(ImageFilePrototype imageFilePrototype) { this.href = imageFilePrototype.href; } @@ -67,6 +72,8 @@ public Builder href(String href) { } } + protected ImageFilePrototype() { } + protected ImageFilePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentity.java index 3ed07ce249..6929ee627e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentity.java @@ -28,8 +28,7 @@ public class ImageIdentity extends GenericModel { protected String crn; protected String href; - protected ImageIdentity() { - } + protected ImageIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentityByCRN.java index 35d2916215..af3c0e3b41 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentityByCRN.java @@ -24,6 +24,11 @@ public class ImageIdentityByCRN extends ImageIdentity { public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing ImageIdentityByCRN instance. + * + * @param imageIdentityByCrn the instance to initialize the Builder with + */ public Builder(ImageIdentity imageIdentityByCrn) { this.crn = imageIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected ImageIdentityByCRN() { } + protected ImageIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentityByHref.java index c8c9b7b277..20354ee4e1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentityByHref.java @@ -24,6 +24,11 @@ public class ImageIdentityByHref extends ImageIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing ImageIdentityByHref instance. + * + * @param imageIdentityByHref the instance to initialize the Builder with + */ public Builder(ImageIdentity imageIdentityByHref) { this.href = imageIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected ImageIdentityByHref() { } + protected ImageIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentityById.java index 740b27b59d..00a0cf3dc3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageIdentityById.java @@ -24,6 +24,11 @@ public class ImageIdentityById extends ImageIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing ImageIdentityById instance. + * + * @param imageIdentityById the instance to initialize the Builder with + */ public Builder(ImageIdentity imageIdentityById) { this.id = imageIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected ImageIdentityById() { } + protected ImageIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePatch.java index 4563d8ec90..d294a1b277 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePatch.java @@ -30,6 +30,11 @@ public class ImagePatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing ImagePatch instance. + * + * @param imagePatch the instance to initialize the Builder with + */ private Builder(ImagePatch imagePatch) { this.name = imagePatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected ImagePatch() { } + protected ImagePatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototype.java index abd2f495a4..5d1d90b195 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototype.java @@ -37,8 +37,7 @@ public class ImagePrototype extends GenericModel { @SerializedName("source_volume") protected VolumeIdentity sourceVolume; - protected ImagePrototype() { - } + protected ImagePrototype() { } /** * Gets the name. @@ -125,7 +124,7 @@ public OperatingSystemIdentity operatingSystem() { * Gets the sourceVolume. * * The volume from which to create the image. The specified volume must: - * - Originate from an image, which will be used to populate this image's + * - Have an `operating_system`, which will be used to populate this image's * operating system information. * - Not be `active` or `busy`. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageByFile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageByFile.java index 686b73f714..e1247e0c8f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageByFile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageByFile.java @@ -29,6 +29,11 @@ public static class Builder { private ImageFilePrototype file; private OperatingSystemIdentity operatingSystem; + /** + * Instantiates a new Builder from an existing ImagePrototypeImageByFile instance. + * + * @param imagePrototypeImageByFile the instance to initialize the Builder with + */ public Builder(ImagePrototype imagePrototypeImageByFile) { this.name = imagePrototypeImageByFile.name; this.resourceGroup = imagePrototypeImageByFile.resourceGroup; @@ -131,6 +136,8 @@ public Builder operatingSystem(OperatingSystemIdentity operatingSystem) { } } + protected ImagePrototypeImageByFile() { } + protected ImagePrototypeImageByFile(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.file, "file cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageBySourceVolume.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageBySourceVolume.java index d4477bcf50..2a94643ab3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageBySourceVolume.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageBySourceVolume.java @@ -27,6 +27,11 @@ public static class Builder { private EncryptionKeyIdentity encryptionKey; private VolumeIdentity sourceVolume; + /** + * Instantiates a new Builder from an existing ImagePrototypeImageBySourceVolume instance. + * + * @param imagePrototypeImageBySourceVolume the instance to initialize the Builder with + */ public Builder(ImagePrototype imagePrototypeImageBySourceVolume) { this.name = imagePrototypeImageBySourceVolume.name; this.resourceGroup = imagePrototypeImageBySourceVolume.resourceGroup; @@ -103,6 +108,8 @@ public Builder sourceVolume(VolumeIdentity sourceVolume) { } } + protected ImagePrototypeImageBySourceVolume() { } + protected ImagePrototypeImageBySourceVolume(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.sourceVolume, "sourceVolume cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageReference.java index ce99c1565c..ee68ca37a8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageReference.java @@ -25,6 +25,8 @@ public class ImageReference extends GenericModel { protected String id; protected String name; + protected ImageReference() { } + /** * Gets the crn. * @@ -39,7 +41,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageReferenceDeleted.java index 9d888b9764..0ed1b4cee6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class ImageReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class ImageReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected ImageReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageStatusReason.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageStatusReason.java index bb66590a8b..4a60744e93 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageStatusReason.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageStatusReason.java @@ -24,10 +24,16 @@ public class ImageStatusReason extends GenericModel { * A snake case string succinctly identifying the status reason. */ public interface Code { + /** encrypted_data_key_invalid. */ + String ENCRYPTED_DATA_KEY_INVALID = "encrypted_data_key_invalid"; /** encryption_key_deleted. */ String ENCRYPTION_KEY_DELETED = "encryption_key_deleted"; /** encryption_key_disabled. */ String ENCRYPTION_KEY_DISABLED = "encryption_key_disabled"; + /** image_data_corrupted. */ + String IMAGE_DATA_CORRUPTED = "image_data_corrupted"; + /** image_provisioned_size_unsupported. */ + String IMAGE_PROVISIONED_SIZE_UNSUPPORTED = "image_provisioned_size_unsupported"; /** image_request_in_progress. */ String IMAGE_REQUEST_IN_PROGRESS = "image_request_in_progress"; /** image_request_queued. */ @@ -39,6 +45,8 @@ public interface Code { @SerializedName("more_info") protected String moreInfo; + protected ImageStatusReason() { } + /** * Gets the code. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagesPager.java new file mode 100644 index 0000000000..65aae221ee --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * ImagesPager can be used to simplify the use of the "listImages" method. + */ +public class ImagesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListImagesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected ImagesPager() { } + + /** + * Constructs a new ImagesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listImages" method + * @param options the ListImagesOptions instance to be used to invoke the "listImages" method + */ + public ImagesPager(Vpc client, ListImagesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<Image> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListImagesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + ImageCollection result = client.listImages(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getImages(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<Image> containing all results returned by the "listImages" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Instance.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Instance.java index bea6644d08..edbfbe9fd8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Instance.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Instance.java @@ -23,6 +23,26 @@ */ public class Instance extends GenericModel { + /** + * The lifecycle state of the virtual server instance. + */ + public interface LifecycleState { + /** deleting. */ + String DELETING = "deleting"; + /** failed. */ + String FAILED = "failed"; + /** pending. */ + String PENDING = "pending"; + /** stable. */ + String STABLE = "stable"; + /** suspended. */ + String SUSPENDED = "suspended"; + /** updating. */ + String UPDATING = "updating"; + /** waiting. */ + String WAITING = "waiting"; + } + /** * The resource type. */ @@ -33,22 +53,20 @@ public interface ResourceType { /** * The status of the virtual server instance. + * + * The enumerated values for this property will expand in the future. When processing this property, check for and log + * unknown values. Optionally halt processing and surface the error, or bypass the instance on which the unexpected + * property value was encountered. */ public interface Status { /** deleting. */ String DELETING = "deleting"; /** failed. */ String FAILED = "failed"; - /** paused. */ - String PAUSED = "paused"; - /** pausing. */ - String PAUSING = "pausing"; /** pending. */ String PENDING = "pending"; /** restarting. */ String RESTARTING = "restarting"; - /** resuming. */ - String RESUMING = "resuming"; /** running. */ String RUNNING = "running"; /** starting. */ @@ -64,6 +82,8 @@ public interface Status { protected Long bandwidth; @SerializedName("boot_volume_attachment") protected VolumeAttachmentReferenceInstanceContext bootVolumeAttachment; + @SerializedName("catalog_offering") + protected InstanceCatalogOffering catalogOffering; @SerializedName("created_at") protected Date createdAt; protected String crn; @@ -74,6 +94,10 @@ public interface Status { protected String href; protected String id; protected ImageReference image; + @SerializedName("lifecycle_reasons") + protected List lifecycleReasons; + @SerializedName("lifecycle_state") + protected String lifecycleState; protected Long memory; @SerializedName("metadata_service") protected InstanceMetadataService metadataService; @@ -103,6 +127,8 @@ public interface Status { protected VPCReference vpc; protected ZoneReference zone; + protected Instance() { } + /** * Gets the availabilityPolicy. * @@ -137,6 +163,18 @@ public VolumeAttachmentReferenceInstanceContext getBootVolumeAttachment() { return bootVolumeAttachment; } + /** + * Gets the catalogOffering. + * + * If present, this virtual server instance was provisioned from a + * [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user). + * + * @return the catalogOffering + */ + public InstanceCatalogOffering getCatalogOffering() { + return catalogOffering; + } + /** * Gets the createdAt. * @@ -225,6 +263,32 @@ public ImageReference getImage() { return image; } + /** + * Gets the lifecycleReasons. + * + * The reasons for the current `lifecycle_state` (if any). + * + * The enumerated reason code values for this property will expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + * unexpected reason code was encountered. + * + * @return the lifecycleReasons + */ + public List getLifecycleReasons() { + return lifecycleReasons; + } + + /** + * Gets the lifecycleState. + * + * The lifecycle state of the virtual server instance. + * + * @return the lifecycleState + */ + public String getLifecycleState() { + return lifecycleState; + } + /** * Gets the memory. * @@ -294,7 +358,8 @@ public NetworkInterfaceInstanceContextReference getPrimaryNetworkInterface() { /** * Gets the profile. * - * The profile for this virtual server instance. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this virtual + * server instance. * * @return the profile */ @@ -340,6 +405,10 @@ public Boolean isStartable() { * * The status of the virtual server instance. * + * The enumerated values for this property will expand in the future. When processing this property, check for and log + * unknown values. Optionally halt processing and surface the error, or bypass the instance on which the unexpected + * property value was encountered. + * * @return the status */ public String getStatus() { diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAction.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAction.java index 65965fb6c2..4a2cc31b74 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAction.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAction.java @@ -60,6 +60,8 @@ public interface Type { protected String status; protected String type; + protected InstanceAction() { } + /** * Gets the completedAt. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicy.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicy.java index a71f634f61..af00469512 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicy.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicy.java @@ -39,6 +39,8 @@ public interface HostFailure { @SerializedName("host_failure") protected String hostFailure; + protected InstanceAvailabilityPolicy() { } + /** * Gets the hostFailure. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicyPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicyPatch.java index 41e9a05201..9a8284959b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicyPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicyPatch.java @@ -45,6 +45,11 @@ public interface HostFailure { public static class Builder { private String hostFailure; + /** + * Instantiates a new Builder from an existing InstanceAvailabilityPolicyPatch instance. + * + * @param instanceAvailabilityPolicyPatch the instance to initialize the Builder with + */ private Builder(InstanceAvailabilityPolicyPatch instanceAvailabilityPolicyPatch) { this.hostFailure = instanceAvailabilityPolicyPatch.hostFailure; } @@ -76,6 +81,8 @@ public Builder hostFailure(String hostFailure) { } } + protected InstanceAvailabilityPolicyPatch() { } + protected InstanceAvailabilityPolicyPatch(Builder builder) { hostFailure = builder.hostFailure; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPrototype.java index f1fc504c11..617f4d15bd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPrototype.java @@ -45,6 +45,11 @@ public interface HostFailure { public static class Builder { private String hostFailure; + /** + * Instantiates a new Builder from an existing InstanceAvailabilityPrototype instance. + * + * @param instanceAvailabilityPrototype the instance to initialize the Builder with + */ private Builder(InstanceAvailabilityPrototype instanceAvailabilityPrototype) { this.hostFailure = instanceAvailabilityPrototype.hostFailure; } @@ -76,6 +81,8 @@ public Builder hostFailure(String hostFailure) { } } + protected InstanceAvailabilityPrototype() { } + protected InstanceAvailabilityPrototype(Builder builder) { hostFailure = builder.hostFailure; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOffering.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOffering.java new file mode 100644 index 0000000000..a78b6d24bd --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOffering.java @@ -0,0 +1,42 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * InstanceCatalogOffering. + */ +public class InstanceCatalogOffering extends GenericModel { + + protected CatalogOfferingVersionReference version; + + protected InstanceCatalogOffering() { } + + /** + * Gets the version. + * + * The catalog offering version this virtual server instance was provisioned from. + * + * The catalog offering version is not managed by the IBM VPC service, and may no longer + * exist, or may refer to a different image CRN than the `image.crn` for this virtual + * server instance. However, all images associated with a catalog offering version will + * have the same checksum, and therefore will have the same data. + * + * @return the version + */ + public CatalogOfferingVersionReference getVersion() { + return version; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototype.java new file mode 100644 index 0000000000..d0305181f8 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototype.java @@ -0,0 +1,62 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering or offering version to use + * when provisioning this virtual server instance. + * + * If an offering is specified, the latest version of that offering will be used. + * + * The specified offering or offering version may be in a different account in the same + * [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject to IAM policies. + * + * Classes which extend this class: + * - InstanceCatalogOfferingPrototypeCatalogOfferingByOffering + * - InstanceCatalogOfferingPrototypeCatalogOfferingByVersion + */ +public class InstanceCatalogOfferingPrototype extends GenericModel { + + protected CatalogOfferingIdentity offering; + protected CatalogOfferingVersionIdentity version; + + protected InstanceCatalogOfferingPrototype() { } + + /** + * Gets the offering. + * + * Identifies a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + * offering by a unique property. + * + * @return the offering + */ + public CatalogOfferingIdentity offering() { + return offering; + } + + /** + * Gets the version. + * + * Identifies a version of a + * [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a + * unique property. + * + * @return the version + */ + public CatalogOfferingVersionIdentity version() { + return version; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.java new file mode 100644 index 0000000000..f64b7c5830 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +/** + * InstanceCatalogOfferingPrototypeCatalogOfferingByOffering. + */ +public class InstanceCatalogOfferingPrototypeCatalogOfferingByOffering extends InstanceCatalogOfferingPrototype { + + + /** + * Builder. + */ + public static class Builder { + private CatalogOfferingIdentity offering; + + /** + * Instantiates a new Builder from an existing InstanceCatalogOfferingPrototypeCatalogOfferingByOffering instance. + * + * @param instanceCatalogOfferingPrototypeCatalogOfferingByOffering the instance to initialize the Builder with + */ + public Builder(InstanceCatalogOfferingPrototype instanceCatalogOfferingPrototypeCatalogOfferingByOffering) { + this.offering = instanceCatalogOfferingPrototypeCatalogOfferingByOffering.offering; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param offering the offering + */ + public Builder(CatalogOfferingIdentity offering) { + this.offering = offering; + } + + /** + * Builds a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering. + * + * @return the new InstanceCatalogOfferingPrototypeCatalogOfferingByOffering instance + */ + public InstanceCatalogOfferingPrototypeCatalogOfferingByOffering build() { + return new InstanceCatalogOfferingPrototypeCatalogOfferingByOffering(this); + } + + /** + * Set the offering. + * + * @param offering the offering + * @return the InstanceCatalogOfferingPrototypeCatalogOfferingByOffering builder + */ + public Builder offering(CatalogOfferingIdentity offering) { + this.offering = offering; + return this; + } + } + + protected InstanceCatalogOfferingPrototypeCatalogOfferingByOffering() { } + + protected InstanceCatalogOfferingPrototypeCatalogOfferingByOffering(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.offering, + "offering cannot be null"); + offering = builder.offering; + } + + /** + * New builder. + * + * @return a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.java new file mode 100644 index 0000000000..ed1f955730 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +/** + * InstanceCatalogOfferingPrototypeCatalogOfferingByVersion. + */ +public class InstanceCatalogOfferingPrototypeCatalogOfferingByVersion extends InstanceCatalogOfferingPrototype { + + + /** + * Builder. + */ + public static class Builder { + private CatalogOfferingVersionIdentity version; + + /** + * Instantiates a new Builder from an existing InstanceCatalogOfferingPrototypeCatalogOfferingByVersion instance. + * + * @param instanceCatalogOfferingPrototypeCatalogOfferingByVersion the instance to initialize the Builder with + */ + public Builder(InstanceCatalogOfferingPrototype instanceCatalogOfferingPrototypeCatalogOfferingByVersion) { + this.version = instanceCatalogOfferingPrototypeCatalogOfferingByVersion.version; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param version the version + */ + public Builder(CatalogOfferingVersionIdentity version) { + this.version = version; + } + + /** + * Builds a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion. + * + * @return the new InstanceCatalogOfferingPrototypeCatalogOfferingByVersion instance + */ + public InstanceCatalogOfferingPrototypeCatalogOfferingByVersion build() { + return new InstanceCatalogOfferingPrototypeCatalogOfferingByVersion(this); + } + + /** + * Set the version. + * + * @param version the version + * @return the InstanceCatalogOfferingPrototypeCatalogOfferingByVersion builder + */ + public Builder version(CatalogOfferingVersionIdentity version) { + this.version = version; + return this; + } + } + + protected InstanceCatalogOfferingPrototypeCatalogOfferingByVersion() { } + + protected InstanceCatalogOfferingPrototypeCatalogOfferingByVersion(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.version, + "version cannot be null"); + version = builder.version; + } + + /** + * New builder. + * + * @return a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollection.java index 5bfc47ca87..f050ca7ead 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollection.java @@ -29,6 +29,8 @@ public class InstanceCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected InstanceCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionFirst.java index 1d3df37e74..2eb839774e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionFirst.java @@ -21,6 +21,8 @@ public class InstanceCollectionFirst extends GenericModel { protected String href; + protected InstanceCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionNext.java index 1a480be559..de326afded 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionNext.java @@ -21,6 +21,8 @@ public class InstanceCollectionNext extends GenericModel { protected String href; + protected InstanceCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceConsoleAccessToken.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceConsoleAccessToken.java index 25e05f32d9..020ec1f5b2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceConsoleAccessToken.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceConsoleAccessToken.java @@ -43,6 +43,8 @@ public interface ConsoleType { protected Boolean force; protected String href; + protected InstanceConsoleAccessToken() { } + /** * Gets the accessToken. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDefaultTrustedProfilePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDefaultTrustedProfilePrototype.java index 58eee8a6f9..cafbb79a39 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDefaultTrustedProfilePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDefaultTrustedProfilePrototype.java @@ -31,6 +31,11 @@ public static class Builder { private Boolean autoLink; private TrustedProfileIdentity target; + /** + * Instantiates a new Builder from an existing InstanceDefaultTrustedProfilePrototype instance. + * + * @param instanceDefaultTrustedProfilePrototype the instance to initialize the Builder with + */ private Builder(InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototype) { this.autoLink = instanceDefaultTrustedProfilePrototype.autoLink; this.target = instanceDefaultTrustedProfilePrototype.target; @@ -83,6 +88,8 @@ public Builder target(TrustedProfileIdentity target) { } } + protected InstanceDefaultTrustedProfilePrototype() { } + protected InstanceDefaultTrustedProfilePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.target, "target cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDisk.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDisk.java index 5325097b80..6f103ac28c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDisk.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDisk.java @@ -55,6 +55,8 @@ public interface ResourceType { protected String resourceType; protected Long size; + protected InstanceDisk() { } + /** * Gets the createdAt. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskCollection.java index 5652488e80..c8a1835279 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskCollection.java @@ -23,6 +23,8 @@ public class InstanceDiskCollection extends GenericModel { protected List disks; + protected InstanceDiskCollection() { } + /** * Gets the disks. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskPatch.java index 4870291cc1..a035014802 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskPatch.java @@ -30,6 +30,11 @@ public class InstanceDiskPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing InstanceDiskPatch instance. + * + * @param instanceDiskPatch the instance to initialize the Builder with + */ private Builder(InstanceDiskPatch instanceDiskPatch) { this.name = instanceDiskPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected InstanceDiskPatch() { } + protected InstanceDiskPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskReference.java index 4cfcace3da..63a218a60b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskReference.java @@ -35,10 +35,12 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected InstanceDiskReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskReferenceDeleted.java index 9323e25841..b3979e5fff 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceDiskReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class InstanceDiskReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class InstanceDiskReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected InstanceDiskReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGPU.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGPU.java index 693beb7e83..cb9432280b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGPU.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGPU.java @@ -24,6 +24,8 @@ public class InstanceGPU extends GenericModel { protected Long memory; protected String model; + protected InstanceGPU() { } + /** * Gets the count. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroup.java index 72ec0fe329..913823e4e7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroup.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroup.java @@ -65,11 +65,14 @@ public interface Status { protected Date updatedAt; protected VPCReference vpc; + protected InstanceGroup() { } + /** * Gets the applicationPort. * - * Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to supply - * the port for the load balancer pool member. + * The port used for new load balancer pool members created by this instance group. + * + * This property will be present if and only if `load_balancer_pool` is present. * * @return the applicationPort */ @@ -135,9 +138,8 @@ public InstanceTemplateReference getInstanceTemplate() { /** * Gets the loadBalancerPool. * - * The load balancer pool managed by this group. Instances created - * by this group will have a new load balancer pool member in that - * pool created. + * If present, the load balancer pool this instance group manages. A pool member will + * be created for each instance created by this group. * * @return the loadBalancerPool */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollection.java index 21fc865df2..07cb1d5959 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollection.java @@ -30,6 +30,8 @@ public class InstanceGroupCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected InstanceGroupCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollectionFirst.java index c6883d2113..0b9e79686e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollectionFirst.java @@ -21,6 +21,8 @@ public class InstanceGroupCollectionFirst extends GenericModel { protected String href; + protected InstanceGroupCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollectionNext.java index a1006c12d1..4bf7d2686f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollectionNext.java @@ -21,6 +21,8 @@ public class InstanceGroupCollectionNext extends GenericModel { protected String href; + protected InstanceGroupCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManager.java index 42b880140a..19345e31b0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManager.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManager.java @@ -56,8 +56,7 @@ public interface ManagerType { protected List policies; protected List actions; - protected InstanceGroupManager() { - } + protected InstanceGroupManager() { } /** * Gets the createdAt. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerAction.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerAction.java index 33010a3f63..f703525255 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerAction.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerAction.java @@ -87,8 +87,7 @@ public interface ActionType { protected InstanceGroupManagerScheduledActionGroup group; protected InstanceGroupManagerScheduledActionManager manager; - protected InstanceGroupManagerAction() { - } + protected InstanceGroupManagerAction() { } /** * Gets the autoDelete. @@ -190,7 +189,7 @@ public String getStatus() { /** * Gets the updatedAt. * - * The date and time that the instance group manager action was modified. + * The date and time that the instance group manager action was updated. * * @return the updatedAt */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionGroupPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionGroupPatch.java index 7d84095ecb..2162cadfd7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionGroupPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionGroupPatch.java @@ -29,6 +29,11 @@ public class InstanceGroupManagerActionGroupPatch extends GenericModel { public static class Builder { private Long membershipCount; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerActionGroupPatch instance. + * + * @param instanceGroupManagerActionGroupPatch the instance to initialize the Builder with + */ private Builder(InstanceGroupManagerActionGroupPatch instanceGroupManagerActionGroupPatch) { this.membershipCount = instanceGroupManagerActionGroupPatch.membershipCount; } @@ -60,6 +65,8 @@ public Builder membershipCount(long membershipCount) { } } + protected InstanceGroupManagerActionGroupPatch() { } + protected InstanceGroupManagerActionGroupPatch(Builder builder) { membershipCount = builder.membershipCount; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionManagerPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionManagerPatch.java index 6ff45be7a7..ba2d309b5f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionManagerPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionManagerPatch.java @@ -32,6 +32,11 @@ public static class Builder { private Long maxMembershipCount; private Long minMembershipCount; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerActionManagerPatch instance. + * + * @param instanceGroupManagerActionManagerPatch the instance to initialize the Builder with + */ private Builder(InstanceGroupManagerActionManagerPatch instanceGroupManagerActionManagerPatch) { this.maxMembershipCount = instanceGroupManagerActionManagerPatch.maxMembershipCount; this.minMembershipCount = instanceGroupManagerActionManagerPatch.minMembershipCount; @@ -75,6 +80,8 @@ public Builder minMembershipCount(long minMembershipCount) { } } + protected InstanceGroupManagerActionManagerPatch() { } + protected InstanceGroupManagerActionManagerPatch(Builder builder) { maxMembershipCount = builder.maxMembershipCount; minMembershipCount = builder.minMembershipCount; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPatch.java index 7c5e3091b6..17c407467a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPatch.java @@ -42,6 +42,11 @@ public static class Builder { private String name; private Date runAt; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerActionPatch instance. + * + * @param instanceGroupManagerActionPatch the instance to initialize the Builder with + */ private Builder(InstanceGroupManagerActionPatch instanceGroupManagerActionPatch) { this.cronSpec = instanceGroupManagerActionPatch.cronSpec; this.group = instanceGroupManagerActionPatch.group; @@ -121,6 +126,8 @@ public Builder runAt(Date runAt) { } } + protected InstanceGroupManagerActionPatch() { } + protected InstanceGroupManagerActionPatch(Builder builder) { cronSpec = builder.cronSpec; group = builder.group; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototype.java index ab476510fa..c74e208bcb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototype.java @@ -33,8 +33,7 @@ public class InstanceGroupManagerActionPrototype extends GenericModel { @SerializedName("cron_spec") protected String cronSpec; - protected InstanceGroupManagerActionPrototype() { - } + protected InstanceGroupManagerActionPrototype() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototype.java index d180ea99ff..f7e18354ee 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototype.java @@ -22,7 +22,6 @@ public class InstanceGroupManagerActionPrototypeScheduledActionPrototype extends InstanceGroupManagerActionPrototype { - protected InstanceGroupManagerActionPrototypeScheduledActionPrototype() { - } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototype() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec.java index 52ddf963cd..8d7b66141c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec.java @@ -22,7 +22,6 @@ public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec extends InstanceGroupManagerActionPrototypeScheduledActionPrototype { - protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() { - } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.java index 8dbee0a3d8..97f3193c06 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.java @@ -26,6 +26,11 @@ public static class Builder { private String cronSpec; private InstanceGroupManagerScheduledActionGroupPrototype group; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup instance. + * + * @param instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup the instance to initialize the Builder with + */ public Builder(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) { this.name = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.name; this.cronSpec = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.cronSpec; @@ -90,6 +95,8 @@ public Builder group(InstanceGroupManagerScheduledActionGroupPrototype group) { } } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup() { } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.group, "group cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.java index d58fd1b166..cb0939d53d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.java @@ -26,6 +26,11 @@ public static class Builder { private String cronSpec; private InstanceGroupManagerScheduledActionManagerPrototype manager; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager instance. + * + * @param instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager the instance to initialize the Builder with + */ public Builder(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) { this.name = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.name; this.cronSpec = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.cronSpec; @@ -90,6 +95,8 @@ public Builder manager(InstanceGroupManagerScheduledActionManagerPrototype manag } } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager() { } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.manager, "manager cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt.java index 49a6040402..fa02eb9d9c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt.java @@ -22,7 +22,6 @@ public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt extends InstanceGroupManagerActionPrototypeScheduledActionPrototype { - protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() { - } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.java index 9f5d96c103..f3a5d5ce60 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.java @@ -28,6 +28,11 @@ public static class Builder { private Date runAt; private InstanceGroupManagerScheduledActionGroupPrototype group; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup instance. + * + * @param instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup the instance to initialize the Builder with + */ public Builder(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) { this.name = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.name; this.runAt = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.runAt; @@ -92,6 +97,8 @@ public Builder group(InstanceGroupManagerScheduledActionGroupPrototype group) { } } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup() { } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.group, "group cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.java index b505fc1f16..e0cb2b1060 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.java @@ -28,6 +28,11 @@ public static class Builder { private Date runAt; private InstanceGroupManagerScheduledActionManagerPrototype manager; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager instance. + * + * @param instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager the instance to initialize the Builder with + */ public Builder(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) { this.name = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.name; this.runAt = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.runAt; @@ -92,6 +97,8 @@ public Builder manager(InstanceGroupManagerScheduledActionManagerPrototype manag } } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager() { } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.manager, "manager cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionReference.java index f45612652b..d1b9cce023 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionReference.java @@ -35,10 +35,12 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected InstanceGroupManagerActionReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionReferenceDeleted.java index e9da4fdc10..38dcb9ea6b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class InstanceGroupManagerActionReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class InstanceGroupManagerActionReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected InstanceGroupManagerActionReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionScheduledAction.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionScheduledAction.java index c57415c56c..8fd796ef13 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionScheduledAction.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionScheduledAction.java @@ -59,7 +59,6 @@ public interface ActionType { } - protected InstanceGroupManagerActionScheduledAction() { - } + protected InstanceGroupManagerActionScheduledAction() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionScheduledActionGroupTarget.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionScheduledActionGroupTarget.java index 69661e45f7..8721ec602c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionScheduledActionGroupTarget.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionScheduledActionGroupTarget.java @@ -54,5 +54,7 @@ public interface ActionType { String SCHEDULED = "scheduled"; } + + protected InstanceGroupManagerActionScheduledActionGroupTarget() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionScheduledActionManagerTarget.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionScheduledActionManagerTarget.java index 2e68d1ad2c..ae6ec2d0be 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionScheduledActionManagerTarget.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionScheduledActionManagerTarget.java @@ -54,5 +54,7 @@ public interface ActionType { String SCHEDULED = "scheduled"; } + + protected InstanceGroupManagerActionScheduledActionManagerTarget() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsCollection.java index f50720ae2b..387541b932 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsCollection.java @@ -29,6 +29,8 @@ public class InstanceGroupManagerActionsCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected InstanceGroupManagerActionsCollection() { } + /** * Gets the actions. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsCollectionFirst.java index 8d2407e66e..50a9a2b8f6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsCollectionFirst.java @@ -21,6 +21,8 @@ public class InstanceGroupManagerActionsCollectionFirst extends GenericModel { protected String href; + protected InstanceGroupManagerActionsCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsCollectionNext.java index d93243919b..914c460948 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsCollectionNext.java @@ -21,6 +21,8 @@ public class InstanceGroupManagerActionsCollectionNext extends GenericModel { protected String href; + protected InstanceGroupManagerActionsCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsPager.java new file mode 100644 index 0000000000..1d29953d8b --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * InstanceGroupManagerActionsPager can be used to simplify the use of the "listInstanceGroupManagerActions" method. + */ +public class InstanceGroupManagerActionsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListInstanceGroupManagerActionsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected InstanceGroupManagerActionsPager() { } + + /** + * Constructs a new InstanceGroupManagerActionsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listInstanceGroupManagerActions" method + * @param options the ListInstanceGroupManagerActionsOptions instance to be used to invoke the "listInstanceGroupManagerActions" method + */ + public InstanceGroupManagerActionsPager(Vpc client, ListInstanceGroupManagerActionsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<InstanceGroupManagerAction> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListInstanceGroupManagerActionsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + InstanceGroupManagerActionsCollection result = client.listInstanceGroupManagerActions(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getActions(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<InstanceGroupManagerAction> containing all results returned by the "listInstanceGroupManagerActions" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerAutoScale.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerAutoScale.java index f7711db9e8..c57c4b78b6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerAutoScale.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerAutoScale.java @@ -25,5 +25,7 @@ public interface ManagerType { String AUTOSCALE = "autoscale"; } + + protected InstanceGroupManagerAutoScale() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollection.java index f481863cd6..b61eb0713c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollection.java @@ -29,6 +29,8 @@ public class InstanceGroupManagerCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected InstanceGroupManagerCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollectionFirst.java index dd83eee6f7..97b275f20e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollectionFirst.java @@ -21,6 +21,8 @@ public class InstanceGroupManagerCollectionFirst extends GenericModel { protected String href; + protected InstanceGroupManagerCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollectionNext.java index 349c5375dd..0e4e6428fb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollectionNext.java @@ -21,6 +21,8 @@ public class InstanceGroupManagerCollectionNext extends GenericModel { protected String href; + protected InstanceGroupManagerCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPatch.java index 5f930369b1..00535a7b86 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPatch.java @@ -45,6 +45,11 @@ public static class Builder { private Long minMembershipCount; private String name; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerPatch instance. + * + * @param instanceGroupManagerPatch the instance to initialize the Builder with + */ private Builder(InstanceGroupManagerPatch instanceGroupManagerPatch) { this.aggregationWindow = instanceGroupManagerPatch.aggregationWindow; this.cooldown = instanceGroupManagerPatch.cooldown; @@ -136,6 +141,8 @@ public Builder name(String name) { } } + protected InstanceGroupManagerPatch() { } + protected InstanceGroupManagerPatch(Builder builder) { aggregationWindow = builder.aggregationWindow; cooldown = builder.cooldown; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPoliciesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPoliciesPager.java new file mode 100644 index 0000000000..72035cbeb0 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPoliciesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * InstanceGroupManagerPoliciesPager can be used to simplify the use of the "listInstanceGroupManagerPolicies" method. + */ +public class InstanceGroupManagerPoliciesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListInstanceGroupManagerPoliciesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected InstanceGroupManagerPoliciesPager() { } + + /** + * Constructs a new InstanceGroupManagerPoliciesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listInstanceGroupManagerPolicies" method + * @param options the ListInstanceGroupManagerPoliciesOptions instance to be used to invoke the "listInstanceGroupManagerPolicies" method + */ + public InstanceGroupManagerPoliciesPager(Vpc client, ListInstanceGroupManagerPoliciesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<InstanceGroupManagerPolicy> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListInstanceGroupManagerPoliciesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + InstanceGroupManagerPolicyCollection result = client.listInstanceGroupManagerPolicies(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getPolicies(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<InstanceGroupManagerPolicy> containing all results returned by the "listInstanceGroupManagerPolicies" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicy.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicy.java index e4f80c015b..59629141c8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicy.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicy.java @@ -61,8 +61,7 @@ public interface PolicyType { @SerializedName("policy_type") protected String policyType; - protected InstanceGroupManagerPolicy() { - } + protected InstanceGroupManagerPolicy() { } /** * Gets the createdAt. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyCollection.java index b58a4b941e..003033c936 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyCollection.java @@ -29,6 +29,8 @@ public class InstanceGroupManagerPolicyCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected InstanceGroupManagerPolicyCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyCollectionFirst.java index 9140b6d1f6..13376106a2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyCollectionFirst.java @@ -21,6 +21,8 @@ public class InstanceGroupManagerPolicyCollectionFirst extends GenericModel { protected String href; + protected InstanceGroupManagerPolicyCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyCollectionNext.java index ba6948da90..729da85252 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyCollectionNext.java @@ -21,6 +21,8 @@ public class InstanceGroupManagerPolicyCollectionNext extends GenericModel { protected String href; + protected InstanceGroupManagerPolicyCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.java index 0abf04f66f..20ddb4051e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.java @@ -39,5 +39,7 @@ public interface PolicyType { String TARGET = "target"; } + + protected InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPatch.java index b651d40880..4f368987cc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPatch.java @@ -51,6 +51,11 @@ public static class Builder { private Long metricValue; private String name; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerPolicyPatch instance. + * + * @param instanceGroupManagerPolicyPatch the instance to initialize the Builder with + */ private Builder(InstanceGroupManagerPolicyPatch instanceGroupManagerPolicyPatch) { this.metricType = instanceGroupManagerPolicyPatch.metricType; this.metricValue = instanceGroupManagerPolicyPatch.metricValue; @@ -106,6 +111,8 @@ public Builder name(String name) { } } + protected InstanceGroupManagerPolicyPatch() { } + protected InstanceGroupManagerPolicyPatch(Builder builder) { metricType = builder.metricType; metricValue = builder.metricValue; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPrototype.java index 40f310c2d8..4d7ff48edb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPrototype.java @@ -53,8 +53,7 @@ public interface PolicyType { @SerializedName("policy_type") protected String policyType; - protected InstanceGroupManagerPolicyPrototype() { - } + protected InstanceGroupManagerPolicyPrototype() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.java index 6f5ff93679..21457d9ca1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.java @@ -49,6 +49,11 @@ public static class Builder { private Long metricValue; private String policyType; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype instance. + * + * @param instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype the instance to initialize the Builder with + */ public Builder(InstanceGroupManagerPolicyPrototype instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype) { this.name = instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.name; this.metricType = instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.metricType; @@ -129,6 +134,8 @@ public Builder policyType(String policyType) { } } + protected InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype() { } + protected InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.metricType, "metricType cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyReference.java index d0a4ae3110..5cb71f3b63 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyReference.java @@ -24,10 +24,12 @@ public class InstanceGroupManagerPolicyReference extends GenericModel { protected String id; protected String name; + protected InstanceGroupManagerPolicyReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyReferenceDeleted.java index 3de434f631..6c007c3c4e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class InstanceGroupManagerPolicyReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class InstanceGroupManagerPolicyReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected InstanceGroupManagerPolicyReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPrototype.java index 52a1ee8df8..2ab4bca0eb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPrototype.java @@ -45,8 +45,7 @@ public interface ManagerType { @SerializedName("min_membership_count") protected Long minMembershipCount; - protected InstanceGroupManagerPrototype() { - } + protected InstanceGroupManagerPrototype() { } /** * Gets the managementEnabled. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.java index f10e32e5e9..272dda62ee 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.java @@ -38,6 +38,11 @@ public static class Builder { private Long maxMembershipCount; private Long minMembershipCount; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype instance. + * + * @param instanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype the instance to initialize the Builder with + */ public Builder(InstanceGroupManagerPrototype instanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype) { this.managementEnabled = instanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.managementEnabled; this.name = instanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.name; @@ -152,6 +157,8 @@ public Builder minMembershipCount(long minMembershipCount) { } } + protected InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype() { } + protected InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.managerType, "managerType cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.java index 6ec643f589..3437e30563 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.java @@ -34,6 +34,11 @@ public static class Builder { private String name; private String managerType; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype instance. + * + * @param instanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype the instance to initialize the Builder with + */ public Builder(InstanceGroupManagerPrototype instanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype) { this.managementEnabled = instanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.managementEnabled; this.name = instanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.name; @@ -98,6 +103,8 @@ public Builder managerType(String managerType) { } } + protected InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype() { } + protected InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.managerType, "managerType cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerReference.java index c98477d96f..cf4a8d47df 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerReference.java @@ -24,10 +24,12 @@ public class InstanceGroupManagerReference extends GenericModel { protected String id; protected String name; + protected InstanceGroupManagerReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerReferenceDeleted.java index d200099871..b913bab347 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class InstanceGroupManagerReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class InstanceGroupManagerReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected InstanceGroupManagerReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduled.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduled.java index 78608e5cfd..23acd7a0bb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduled.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduled.java @@ -25,5 +25,7 @@ public interface ManagerType { String SCHEDULED = "scheduled"; } + + protected InstanceGroupManagerScheduled() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionGroup.java index 4cab3e372f..51f68fb7ae 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionGroup.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionGroup.java @@ -23,6 +23,8 @@ public class InstanceGroupManagerScheduledActionGroup extends GenericModel { @SerializedName("membership_count") protected Long membershipCount; + protected InstanceGroupManagerScheduledActionGroup() { } + /** * Gets the membershipCount. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionGroupPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionGroupPrototype.java index 84c308bd1e..fe56bdb3c8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionGroupPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionGroupPrototype.java @@ -29,6 +29,11 @@ public class InstanceGroupManagerScheduledActionGroupPrototype extends GenericMo public static class Builder { private Long membershipCount; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerScheduledActionGroupPrototype instance. + * + * @param instanceGroupManagerScheduledActionGroupPrototype the instance to initialize the Builder with + */ private Builder(InstanceGroupManagerScheduledActionGroupPrototype instanceGroupManagerScheduledActionGroupPrototype) { this.membershipCount = instanceGroupManagerScheduledActionGroupPrototype.membershipCount; } @@ -69,6 +74,8 @@ public Builder membershipCount(long membershipCount) { } } + protected InstanceGroupManagerScheduledActionGroupPrototype() { } + protected InstanceGroupManagerScheduledActionGroupPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.membershipCount, "membershipCount cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManager.java index 0e2f5c1860..8f525a0400 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManager.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManager.java @@ -32,13 +32,12 @@ public class InstanceGroupManagerScheduledActionManager extends GenericModel { @SerializedName("min_membership_count") protected Long minMembershipCount; - protected InstanceGroupManagerScheduledActionManager() { - } + protected InstanceGroupManagerScheduledActionManager() { } /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerAutoScale.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerAutoScale.java index f405621eaa..aec9ef7ff9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerAutoScale.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerAutoScale.java @@ -17,5 +17,7 @@ */ public class InstanceGroupManagerScheduledActionManagerAutoScale extends InstanceGroupManagerScheduledActionManager { + + protected InstanceGroupManagerScheduledActionManagerAutoScale() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototype.java index 6d1ecbc364..ca350fe06c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototype.java @@ -30,8 +30,7 @@ public class InstanceGroupManagerScheduledActionManagerPrototype extends Generic protected String id; protected String href; - protected InstanceGroupManagerScheduledActionManagerPrototype() { - } + protected InstanceGroupManagerScheduledActionManagerPrototype() { } /** * Gets the maxMembershipCount. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype.java index b00fdbfcc5..f05840c6e1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype.java @@ -24,7 +24,6 @@ public class InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype extends InstanceGroupManagerScheduledActionManagerPrototype { - protected InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() { - } + protected InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref.java index ab9b64f52b..dc92c7c211 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref.java @@ -26,6 +26,11 @@ public static class Builder { private Long minMembershipCount; private String href; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref instance. + * + * @param instanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref the instance to initialize the Builder with + */ public Builder(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype instanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref) { this.maxMembershipCount = instanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref.maxMembershipCount; this.minMembershipCount = instanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref.minMembershipCount; @@ -90,6 +95,8 @@ public Builder href(String href) { } } + protected InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref() { } + protected InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.java index 01b3c856a2..7a490e238b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.java @@ -26,6 +26,11 @@ public static class Builder { private Long minMembershipCount; private String id; + /** + * Instantiates a new Builder from an existing InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById instance. + * + * @param instanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById the instance to initialize the Builder with + */ public Builder(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype instanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById) { this.maxMembershipCount = instanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.maxMembershipCount; this.minMembershipCount = instanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.minMembershipCount; @@ -90,6 +95,8 @@ public Builder id(String id) { } } + protected InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById() { } + protected InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagersPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagersPager.java new file mode 100644 index 0000000000..fffef9c322 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagersPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * InstanceGroupManagersPager can be used to simplify the use of the "listInstanceGroupManagers" method. + */ +public class InstanceGroupManagersPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListInstanceGroupManagersOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected InstanceGroupManagersPager() { } + + /** + * Constructs a new InstanceGroupManagersPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listInstanceGroupManagers" method + * @param options the ListInstanceGroupManagersOptions instance to be used to invoke the "listInstanceGroupManagers" method + */ + public InstanceGroupManagersPager(Vpc client, ListInstanceGroupManagersOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<InstanceGroupManager> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListInstanceGroupManagersOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + InstanceGroupManagerCollection result = client.listInstanceGroupManagers(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getManagers(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<InstanceGroupManager> containing all results returned by the "listInstanceGroupManagers" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembership.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembership.java index 64e21e28d1..ff47186169 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembership.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembership.java @@ -59,6 +59,8 @@ public interface Status { @SerializedName("updated_at") protected Date updatedAt; + protected InstanceGroupMembership() { } + /** * Gets the createdAt. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipCollection.java index 92d1a08f43..00e070d50f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipCollection.java @@ -29,6 +29,8 @@ public class InstanceGroupMembershipCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected InstanceGroupMembershipCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipCollectionFirst.java index 9f3c99e9c6..b03bbb056e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipCollectionFirst.java @@ -21,6 +21,8 @@ public class InstanceGroupMembershipCollectionFirst extends GenericModel { protected String href; + protected InstanceGroupMembershipCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipCollectionNext.java index 87fb2e656c..a6b811b407 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipCollectionNext.java @@ -21,6 +21,8 @@ public class InstanceGroupMembershipCollectionNext extends GenericModel { protected String href; + protected InstanceGroupMembershipCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipPatch.java index 48bd189819..66e8ee7ff2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipPatch.java @@ -30,6 +30,11 @@ public class InstanceGroupMembershipPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing InstanceGroupMembershipPatch instance. + * + * @param instanceGroupMembershipPatch the instance to initialize the Builder with + */ private Builder(InstanceGroupMembershipPatch instanceGroupMembershipPatch) { this.name = instanceGroupMembershipPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected InstanceGroupMembershipPatch() { } + protected InstanceGroupMembershipPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipsPager.java new file mode 100644 index 0000000000..9677651b90 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * InstanceGroupMembershipsPager can be used to simplify the use of the "listInstanceGroupMemberships" method. + */ +public class InstanceGroupMembershipsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListInstanceGroupMembershipsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected InstanceGroupMembershipsPager() { } + + /** + * Constructs a new InstanceGroupMembershipsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listInstanceGroupMemberships" method + * @param options the ListInstanceGroupMembershipsOptions instance to be used to invoke the "listInstanceGroupMemberships" method + */ + public InstanceGroupMembershipsPager(Vpc client, ListInstanceGroupMembershipsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<InstanceGroupMembership> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListInstanceGroupMembershipsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + InstanceGroupMembershipCollection result = client.listInstanceGroupMemberships(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getMemberships(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<InstanceGroupMembership> containing all results returned by the "listInstanceGroupMemberships" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupPatch.java index aa001d40c7..a2e85fef87 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupPatch.java @@ -50,6 +50,11 @@ public static class Builder { private String name; private List subnets; + /** + * Instantiates a new Builder from an existing InstanceGroupPatch instance. + * + * @param instanceGroupPatch the instance to initialize the Builder with + */ private Builder(InstanceGroupPatch instanceGroupPatch) { this.applicationPort = instanceGroupPatch.applicationPort; this.instanceTemplate = instanceGroupPatch.instanceTemplate; @@ -170,6 +175,8 @@ public Builder subnets(List subnets) { } } + protected InstanceGroupPatch() { } + protected InstanceGroupPatch(Builder builder) { applicationPort = builder.applicationPort; instanceTemplate = builder.instanceTemplate; @@ -192,8 +199,9 @@ public Builder newBuilder() { /** * Gets the applicationPort. * - * Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to supply - * the port for the load balancer pool member. + * The port to use for new load balancer pool members created by this instance group. + * + * This property must be set if and only if `load_balancer_pool` has been set. * * @return the applicationPort */ @@ -218,8 +226,10 @@ public InstanceTemplateIdentity instanceTemplate() { /** * Gets the loadBalancer. * - * The load balancer associated with the specified load balancer pool. - * Required if `load_balancer_pool` is specified. + * The load balancer associated with `load_balancer_pool`. + * + * This property must be specified if and only if `load_balancer_pool` has been + * specified. * * At present, only load balancers in the `application` family are supported. * @@ -232,10 +242,10 @@ public LoadBalancerIdentity loadBalancer() { /** * Gets the loadBalancerPool. * - * If specified, the load balancer pool will be managed by this - * group. Instances created by this group will have a new load - * balancer pool member in that pool created. Must be used with - * `application_port`. + * If specified, the load balancer pool this instance group will manage. A pool member + * will be created for each instance created by this group. + * + * If specified, `load_balancer` and `application_port` must also be specified. * * @return the loadBalancerPool */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupReference.java index d71f750632..2820333c9b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupReference.java @@ -25,6 +25,8 @@ public class InstanceGroupReference extends GenericModel { protected String id; protected String name; + protected InstanceGroupReference() { } + /** * Gets the crn. * @@ -39,7 +41,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupReferenceDeleted.java index ba661d65a1..89910ba7c0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class InstanceGroupReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class InstanceGroupReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected InstanceGroupReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupsPager.java new file mode 100644 index 0000000000..0fd8598d12 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * InstanceGroupsPager can be used to simplify the use of the "listInstanceGroups" method. + */ +public class InstanceGroupsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListInstanceGroupsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected InstanceGroupsPager() { } + + /** + * Constructs a new InstanceGroupsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listInstanceGroups" method + * @param options the ListInstanceGroupsOptions instance to be used to invoke the "listInstanceGroups" method + */ + public InstanceGroupsPager(Vpc client, ListInstanceGroupsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<InstanceGroup> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListInstanceGroupsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + InstanceGroupCollection result = client.listInstanceGroups(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getInstanceGroups(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<InstanceGroup> containing all results returned by the "listInstanceGroups" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceInitialization.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceInitialization.java index 3a2f0ccf2b..64ebe885a8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceInitialization.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceInitialization.java @@ -27,6 +27,8 @@ public class InstanceInitialization extends GenericModel { protected List keys; protected InstanceInitializationPassword password; + protected InstanceInitialization() { } + /** * Gets the defaultTrustedProfile. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceInitializationDefaultTrustedProfile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceInitializationDefaultTrustedProfile.java index 093cb83269..eb89b90349 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceInitializationDefaultTrustedProfile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceInitializationDefaultTrustedProfile.java @@ -24,6 +24,8 @@ public class InstanceInitializationDefaultTrustedProfile extends GenericModel { protected Boolean autoLink; protected TrustedProfileReference target; + protected InstanceInitializationDefaultTrustedProfile() { } + /** * Gets the autoLink. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceInitializationPassword.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceInitializationPassword.java index 302e82454b..667ae40390 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceInitializationPassword.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceInitializationPassword.java @@ -25,6 +25,8 @@ public class InstanceInitializationPassword extends GenericModel { @SerializedName("encryption_key") protected KeyIdentityByFingerprint encryptionKey; + protected InstanceInitializationPassword() { } + /** * Gets the encryptedPassword. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceMetadataService.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceMetadataService.java index 7977f11947..0286d50e6f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceMetadataService.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceMetadataService.java @@ -21,6 +21,8 @@ public class InstanceMetadataService extends GenericModel { protected Boolean enabled; + protected InstanceMetadataService() { } + /** * Gets the enabled. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceMetadataServicePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceMetadataServicePatch.java index 8d94317654..0e1a28fb08 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceMetadataServicePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceMetadataServicePatch.java @@ -27,6 +27,11 @@ public class InstanceMetadataServicePatch extends GenericModel { public static class Builder { private Boolean enabled; + /** + * Instantiates a new Builder from an existing InstanceMetadataServicePatch instance. + * + * @param instanceMetadataServicePatch the instance to initialize the Builder with + */ private Builder(InstanceMetadataServicePatch instanceMetadataServicePatch) { this.enabled = instanceMetadataServicePatch.enabled; } @@ -58,6 +63,8 @@ public Builder enabled(Boolean enabled) { } } + protected InstanceMetadataServicePatch() { } + protected InstanceMetadataServicePatch(Builder builder) { enabled = builder.enabled; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceMetadataServicePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceMetadataServicePrototype.java index ace09885db..9e5cfe0358 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceMetadataServicePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceMetadataServicePrototype.java @@ -27,6 +27,11 @@ public class InstanceMetadataServicePrototype extends GenericModel { public static class Builder { private Boolean enabled; + /** + * Instantiates a new Builder from an existing InstanceMetadataServicePrototype instance. + * + * @param instanceMetadataServicePrototype the instance to initialize the Builder with + */ private Builder(InstanceMetadataServicePrototype instanceMetadataServicePrototype) { this.enabled = instanceMetadataServicePrototype.enabled; } @@ -58,6 +63,8 @@ public Builder enabled(Boolean enabled) { } } + protected InstanceMetadataServicePrototype() { } + protected InstanceMetadataServicePrototype(Builder builder) { enabled = builder.enabled; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceNetworkInterfaceIpsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceNetworkInterfaceIpsPager.java new file mode 100644 index 0000000000..1287b13828 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceNetworkInterfaceIpsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * InstanceNetworkInterfaceIpsPager can be used to simplify the use of the "listInstanceNetworkInterfaceIps" method. + */ +public class InstanceNetworkInterfaceIpsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListInstanceNetworkInterfaceIpsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected InstanceNetworkInterfaceIpsPager() { } + + /** + * Constructs a new InstanceNetworkInterfaceIpsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listInstanceNetworkInterfaceIps" method + * @param options the ListInstanceNetworkInterfaceIpsOptions instance to be used to invoke the "listInstanceNetworkInterfaceIps" method + */ + public InstanceNetworkInterfaceIpsPager(Vpc client, ListInstanceNetworkInterfaceIpsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<ReservedIP> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListInstanceNetworkInterfaceIpsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + ReservedIPCollectionNetworkInterfaceContext result = client.listInstanceNetworkInterfaceIps(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getIps(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<ReservedIP> containing all results returned by the "listInstanceNetworkInterfaceIps" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatch.java index 5310ab32cb..41ac5c4023 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatch.java @@ -45,6 +45,11 @@ public static class Builder { private InstancePatchProfile profile; private Long totalVolumeBandwidth; + /** + * Instantiates a new Builder from an existing InstancePatch instance. + * + * @param instancePatch the instance to initialize the Builder with + */ private Builder(InstancePatch instancePatch) { this.availabilityPolicy = instancePatch.availabilityPolicy; this.metadataService = instancePatch.metadataService; @@ -136,6 +141,8 @@ public Builder totalVolumeBandwidth(long totalVolumeBandwidth) { } } + protected InstancePatch() { } + protected InstancePatch(Builder builder) { availabilityPolicy = builder.availabilityPolicy; metadataService = builder.metadataService; @@ -211,6 +218,7 @@ public InstancePlacementTargetPatch placementTarget() { * - Be compatible with any `placement_target` constraints. For example, if the * instance is placed on a dedicated host, the requested profile `family` must be * the same as the dedicated host `family`. + * - Have the same `vcpu.architecture`. * * @return the profile */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfile.java index aface986cf..7f0327689f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfile.java @@ -23,6 +23,7 @@ * - Be compatible with any `placement_target` constraints. For example, if the * instance is placed on a dedicated host, the requested profile `family` must be * the same as the dedicated host `family`. + * - Have the same `vcpu.architecture`. * * Classes which extend this class: * - InstancePatchProfileInstanceProfileIdentityByName @@ -33,8 +34,7 @@ public class InstancePatchProfile extends GenericModel { protected String name; protected String href; - protected InstancePatchProfile() { - } + protected InstancePatchProfile() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfileInstanceProfileIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfileInstanceProfileIdentityByHref.java index 568f275973..b4bf636a60 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfileInstanceProfileIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfileInstanceProfileIdentityByHref.java @@ -24,6 +24,11 @@ public class InstancePatchProfileInstanceProfileIdentityByHref extends InstanceP public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing InstancePatchProfileInstanceProfileIdentityByHref instance. + * + * @param instancePatchProfileInstanceProfileIdentityByHref the instance to initialize the Builder with + */ public Builder(InstancePatchProfile instancePatchProfileInstanceProfileIdentityByHref) { this.href = instancePatchProfileInstanceProfileIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected InstancePatchProfileInstanceProfileIdentityByHref() { } + protected InstancePatchProfileInstanceProfileIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfileInstanceProfileIdentityByName.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfileInstanceProfileIdentityByName.java index d9343f2511..95c42682b0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfileInstanceProfileIdentityByName.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfileInstanceProfileIdentityByName.java @@ -24,6 +24,11 @@ public class InstancePatchProfileInstanceProfileIdentityByName extends InstanceP public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing InstancePatchProfileInstanceProfileIdentityByName instance. + * + * @param instancePatchProfileInstanceProfileIdentityByName the instance to initialize the Builder with + */ public Builder(InstancePatchProfile instancePatchProfileInstanceProfileIdentityByName) { this.name = instancePatchProfileInstanceProfileIdentityByName.name; } @@ -64,6 +69,8 @@ public Builder name(String name) { } } + protected InstancePatchProfileInstanceProfileIdentityByName() { } + protected InstancePatchProfileInstanceProfileIdentityByName(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTarget.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTarget.java index f496f325d6..6cd8426586 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTarget.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTarget.java @@ -41,8 +41,7 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; - protected InstancePlacementTarget() { - } + protected InstancePlacementTarget() { } /** * Gets the crn. @@ -58,7 +57,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetDedicatedHostGroupReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetDedicatedHostGroupReference.java index 742b35422d..fe915d2477 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetDedicatedHostGroupReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetDedicatedHostGroupReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String DEDICATED_HOST_GROUP = "dedicated_host_group"; } + + protected InstancePlacementTargetDedicatedHostGroupReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetDedicatedHostReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetDedicatedHostReference.java index 6e8c03141e..58fe2fd042 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetDedicatedHostReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetDedicatedHostReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String DEDICATED_HOST = "dedicated_host"; } + + protected InstancePlacementTargetDedicatedHostReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatch.java index 1fe9c85ee4..f8f3383885 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatch.java @@ -27,8 +27,7 @@ public class InstancePlacementTargetPatch extends GenericModel { protected String crn; protected String href; - protected InstancePlacementTargetPatch() { - } + protected InstancePlacementTargetPatch() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentity.java index 8d36a70f57..08e20156ca 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentity.java @@ -23,7 +23,6 @@ public class InstancePlacementTargetPatchDedicatedHostGroupIdentity extends InstancePlacementTargetPatch { - protected InstancePlacementTargetPatchDedicatedHostGroupIdentity() { - } + protected InstancePlacementTargetPatchDedicatedHostGroupIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.java index a627b5b122..b3a4474591 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHost public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN instance. + * + * @param instancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCrn the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPatchDedicatedHostGroupIdentity instancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCrn) { this.crn = instancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN() { } + protected InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.java index ae0b87c48f..6eee8da757 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHost public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref instance. + * + * @param instancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPatchDedicatedHostGroupIdentity instancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) { this.href = instancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref() { } + protected InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.java index a9b7d31790..a906b78808 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHost public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById instance. + * + * @param instancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPatchDedicatedHostGroupIdentity instancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById) { this.id = instancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById() { } + protected InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentity.java index a1a7cbb0d9..f9f9dbbb29 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentity.java @@ -23,7 +23,6 @@ public class InstancePlacementTargetPatchDedicatedHostIdentity extends InstancePlacementTargetPatch { - protected InstancePlacementTargetPatchDedicatedHostIdentity() { - } + protected InstancePlacementTargetPatchDedicatedHostIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN.java index 45e7398b1c..fa82c3cfc2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdent public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN instance. + * + * @param instancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCrn the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPatchDedicatedHostIdentity instancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCrn) { this.crn = instancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN() { } + protected InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref.java index fa3c8e612f..f87d697c7e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdent public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref instance. + * + * @param instancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPatchDedicatedHostIdentity instancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref) { this.href = instancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref() { } + protected InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.java index 9ae7e17642..08168fc2fd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdent public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById instance. + * + * @param instancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPatchDedicatedHostIdentity instancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById) { this.id = instancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById() { } + protected InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPlacementGroupReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPlacementGroupReference.java index c6c3adbfeb..54d77e1307 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPlacementGroupReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPlacementGroupReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String PLACEMENT_GROUP = "placement_group"; } + + protected InstancePlacementTargetPlacementGroupReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototype.java index 2dcd8a7510..1f765a2007 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototype.java @@ -28,8 +28,7 @@ public class InstancePlacementTargetPrototype extends GenericModel { protected String crn; protected String href; - protected InstancePlacementTargetPrototype() { - } + protected InstancePlacementTargetPrototype() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentity.java index e85ca6547e..fb8f038b4a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentity.java @@ -23,7 +23,6 @@ public class InstancePlacementTargetPrototypeDedicatedHostGroupIdentity extends InstancePlacementTargetPrototype { - protected InstancePlacementTargetPrototypeDedicatedHostGroupIdentity() { - } + protected InstancePlacementTargetPrototypeDedicatedHostGroupIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.java index 0fbf57fd6c..52c439a6fc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicated public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN instance. + * + * @param instancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCrn the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPrototypeDedicatedHostGroupIdentity instancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCrn) { this.crn = instancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN() { } + protected InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.java index 2b8255b7c4..6fe9433599 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicated public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref instance. + * + * @param instancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPrototypeDedicatedHostGroupIdentity instancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) { this.href = instancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref() { } + protected InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.java index 24cbc79055..9926df1a1e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicated public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById instance. + * + * @param instancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPrototypeDedicatedHostGroupIdentity instancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById) { this.id = instancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById() { } + protected InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentity.java index 510d820731..0d8f604a94 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentity.java @@ -23,7 +23,6 @@ public class InstancePlacementTargetPrototypeDedicatedHostIdentity extends InstancePlacementTargetPrototype { - protected InstancePlacementTargetPrototypeDedicatedHostIdentity() { - } + protected InstancePlacementTargetPrototypeDedicatedHostIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN.java index a83f07a8c8..1a6729f994 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostI public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN instance. + * + * @param instancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCrn the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPrototypeDedicatedHostIdentity instancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCrn) { this.crn = instancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN() { } + protected InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref.java index 029369672a..758b1e13a5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostI public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref instance. + * + * @param instancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPrototypeDedicatedHostIdentity instancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref) { this.href = instancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref() { } + protected InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.java index c9384dda16..6ab60a4134 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostI public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instance. + * + * @param instancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPrototypeDedicatedHostIdentity instancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById) { this.id = instancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById() { } + protected InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentity.java index f5b99e84a8..1ba14e7e9b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentity.java @@ -23,7 +23,6 @@ public class InstancePlacementTargetPrototypePlacementGroupIdentity extends InstancePlacementTargetPrototype { - protected InstancePlacementTargetPrototypePlacementGroupIdentity() { - } + protected InstancePlacementTargetPrototypePlacementGroupIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN.java index bed4972b91..077085cf1f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGrou public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN instance. + * + * @param instancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCrn the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPrototypePlacementGroupIdentity instancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCrn) { this.crn = instancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN() { } + protected InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref.java index ac3fcb3507..8bb6b2895c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGrou public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref instance. + * + * @param instancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPrototypePlacementGroupIdentity instancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref) { this.href = instancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref() { } + protected InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById.java index d8245fa584..42fd22d7c1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById.java @@ -24,6 +24,11 @@ public class InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGrou public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById instance. + * + * @param instancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById the instance to initialize the Builder with + */ public Builder(InstancePlacementTargetPrototypePlacementGroupIdentity instancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById) { this.id = instancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById() { } + protected InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfile.java index dc495b4694..ec3d21bf37 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfile.java @@ -47,6 +47,8 @@ public class InstanceProfile extends GenericModel { @SerializedName("vcpu_count") protected InstanceProfileVCPU vcpuCount; + protected InstanceProfile() { } + /** * Gets the bandwidth. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidth.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidth.java index 952a1824dd..d0f6253003 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidth.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidth.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected InstanceProfileBandwidth() { - } + protected InstanceProfileBandwidth() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthDependent.java index 9180e754b5..e31cb81c49 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthDependent.java @@ -26,5 +26,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected InstanceProfileBandwidthDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthEnum.java index b6475acc0b..f4ee76b92d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthEnum.java @@ -26,5 +26,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected InstanceProfileBandwidthEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthFixed.java index 0f88ce7368..30bd61ebd8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthFixed.java @@ -26,5 +26,7 @@ public interface Type { String FIXED = "fixed"; } + + protected InstanceProfileBandwidthFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthRange.java index 391fc87000..4f6159b451 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileBandwidthRange.java @@ -26,5 +26,7 @@ public interface Type { String RANGE = "range"; } + + protected InstanceProfileBandwidthRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollection.java index 4ff6089796..b2f74014d9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollection.java @@ -23,6 +23,8 @@ public class InstanceProfileCollection extends GenericModel { protected List profiles; + protected InstanceProfileCollection() { } + /** * Gets the profiles. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDisk.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDisk.java index dbdd136ea3..316779a952 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDisk.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDisk.java @@ -25,6 +25,8 @@ public class InstanceProfileDisk extends GenericModel { @SerializedName("supported_interface_types") protected InstanceProfileDiskSupportedInterfaces supportedInterfaceTypes; + protected InstanceProfileDisk() { } + /** * Gets the quantity. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantity.java index 6fafcde8c0..5269f4ab09 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantity.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected InstanceProfileDiskQuantity() { - } + protected InstanceProfileDiskQuantity() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityDependent.java index b8bf1d68d5..6aca1acc7a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected InstanceProfileDiskQuantityDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityEnum.java index 22e86859af..9003ca8f1e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected InstanceProfileDiskQuantityEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityFixed.java index b79ae24cfe..1c75d48ddb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected InstanceProfileDiskQuantityFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityRange.java index b92978f65c..3784544d56 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskQuantityRange.java @@ -25,5 +25,7 @@ public interface Type { String RANGE = "range"; } + + protected InstanceProfileDiskQuantityRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSize.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSize.java index ed97834a8a..28569bac56 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSize.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSize.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected InstanceProfileDiskSize() { - } + protected InstanceProfileDiskSize() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeDependent.java index e3d184c31b..1d12beecfb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeDependent.java @@ -26,5 +26,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected InstanceProfileDiskSizeDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeEnum.java index a1831cf87a..2faf9786f1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected InstanceProfileDiskSizeEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeFixed.java index 7723456dd4..a67ebb582c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected InstanceProfileDiskSizeFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeRange.java index 53e4d943eb..4617ab52ef 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSizeRange.java @@ -25,5 +25,7 @@ public interface Type { String RANGE = "range"; } + + protected InstanceProfileDiskSizeRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSupportedInterfaces.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSupportedInterfaces.java index 582201783d..3d4a4b6341 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSupportedInterfaces.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskSupportedInterfaces.java @@ -63,6 +63,8 @@ public interface Values { protected String type; protected List values; + protected InstanceProfileDiskSupportedInterfaces() { } + /** * Gets the xDefault. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPU.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPU.java index ffb7160657..ff8a13876b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPU.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPU.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected InstanceProfileGPU() { - } + protected InstanceProfileGPU() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUDependent.java index b633554407..8845ba4eb8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected InstanceProfileGPUDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUEnum.java index ef73088226..01a87d1b18 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected InstanceProfileGPUEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUFixed.java index b1b691a1ef..28f1991b41 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected InstanceProfileGPUFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUManufacturer.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUManufacturer.java index 19a75cd3ca..6d1e1df090 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUManufacturer.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUManufacturer.java @@ -32,6 +32,8 @@ public interface Type { protected String type; protected List values; + protected InstanceProfileGPUManufacturer() { } + /** * Gets the type. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemory.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemory.java index c13b8468e3..a183ce3123 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemory.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemory.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected InstanceProfileGPUMemory() { - } + protected InstanceProfileGPUMemory() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryDependent.java index c2e3d77a56..98b79a7d23 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected InstanceProfileGPUMemoryDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryEnum.java index 1dfb917e66..179c22a6c7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected InstanceProfileGPUMemoryEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryFixed.java index c2ec008de5..c00e3036c9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected InstanceProfileGPUMemoryFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryRange.java index 8e4065f42e..daea875820 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUMemoryRange.java @@ -25,5 +25,7 @@ public interface Type { String RANGE = "range"; } + + protected InstanceProfileGPUMemoryRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUModel.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUModel.java index 90a72bca97..3da74434b2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUModel.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPUModel.java @@ -32,6 +32,8 @@ public interface Type { protected String type; protected List values; + protected InstanceProfileGPUModel() { } + /** * Gets the type. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPURange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPURange.java index 2514b97ba1..b631c06b99 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPURange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileGPURange.java @@ -25,5 +25,7 @@ public interface Type { String RANGE = "range"; } + + protected InstanceProfileGPURange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileIdentity.java index 4e61d0f553..79f5164fe5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileIdentity.java @@ -26,8 +26,7 @@ public class InstanceProfileIdentity extends GenericModel { protected String name; protected String href; - protected InstanceProfileIdentity() { - } + protected InstanceProfileIdentity() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileIdentityByHref.java index b712d37f87..c187e47821 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileIdentityByHref.java @@ -24,6 +24,11 @@ public class InstanceProfileIdentityByHref extends InstanceProfileIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing InstanceProfileIdentityByHref instance. + * + * @param instanceProfileIdentityByHref the instance to initialize the Builder with + */ public Builder(InstanceProfileIdentity instanceProfileIdentityByHref) { this.href = instanceProfileIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected InstanceProfileIdentityByHref() { } + protected InstanceProfileIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileIdentityByName.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileIdentityByName.java index bd51746c3a..c22ca3742e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileIdentityByName.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileIdentityByName.java @@ -24,6 +24,11 @@ public class InstanceProfileIdentityByName extends InstanceProfileIdentity { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing InstanceProfileIdentityByName instance. + * + * @param instanceProfileIdentityByName the instance to initialize the Builder with + */ public Builder(InstanceProfileIdentity instanceProfileIdentityByName) { this.name = instanceProfileIdentityByName.name; } @@ -64,6 +69,8 @@ public Builder name(String name) { } } + protected InstanceProfileIdentityByName() { } + protected InstanceProfileIdentityByName(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemory.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemory.java index 90ecf7a79a..bfdfadd7c8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemory.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemory.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected InstanceProfileMemory() { - } + protected InstanceProfileMemory() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryDependent.java index 2d2aa36d1f..7b9296f22f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected InstanceProfileMemoryDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryEnum.java index 23ff32c3d1..e8227c35a5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected InstanceProfileMemoryEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryFixed.java index c5677c8f02..d2e2befc32 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected InstanceProfileMemoryFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryRange.java index eb69e85e68..20b9e499aa 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileMemoryRange.java @@ -25,5 +25,7 @@ public interface Type { String RANGE = "range"; } + + protected InstanceProfileMemoryRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileOSArchitecture.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileOSArchitecture.java index 7bb4a33b52..2f9b4f4628 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileOSArchitecture.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileOSArchitecture.java @@ -35,6 +35,8 @@ public interface Type { protected String type; protected List values; + protected InstanceProfileOSArchitecture() { } + /** * Gets the xDefault. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfilePortSpeed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfilePortSpeed.java index b33a2c7d11..9a1552fe42 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfilePortSpeed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfilePortSpeed.java @@ -34,8 +34,7 @@ public interface Type { protected String type; protected Long value; - protected InstanceProfilePortSpeed() { - } + protected InstanceProfilePortSpeed() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfilePortSpeedDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfilePortSpeedDependent.java index dff1d9d6ea..3e51e69760 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfilePortSpeedDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfilePortSpeedDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected InstanceProfilePortSpeedDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfilePortSpeedFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfilePortSpeedFixed.java index 8e060c722e..f766be6cbf 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfilePortSpeedFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfilePortSpeedFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected InstanceProfilePortSpeedFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileReference.java index 8a5e765106..1d53585237 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileReference.java @@ -22,6 +22,8 @@ public class InstanceProfileReference extends GenericModel { protected String href; protected String name; + protected InstanceProfileReference() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPU.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPU.java index 0c4b94238a..cb84c98e87 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPU.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPU.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected InstanceProfileVCPU() { - } + protected InstanceProfileVCPU() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUArchitecture.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUArchitecture.java index 021ed7689b..98c1c42f7b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUArchitecture.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUArchitecture.java @@ -33,6 +33,8 @@ public interface Type { protected String type; protected String value; + protected InstanceProfileVCPUArchitecture() { } + /** * Gets the xDefault. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUDependent.java index 81fd8afde1..27ded57e06 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected InstanceProfileVCPUDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUEnum.java index 60c29be391..32a4f9db9a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUEnum.java @@ -25,5 +25,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected InstanceProfileVCPUEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUFixed.java index 2e4cf66260..f10a644b45 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected InstanceProfileVCPUFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPURange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPURange.java index a2a60cc3ea..01a31f123c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPURange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPURange.java @@ -25,5 +25,7 @@ public interface Type { String RANGE = "range"; } + + protected InstanceProfileVCPURange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidth.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidth.java index 4408715aa7..e03feb2f22 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidth.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidth.java @@ -45,8 +45,7 @@ public interface Type { protected Long step; protected List values; - protected InstanceProfileVolumeBandwidth() { - } + protected InstanceProfileVolumeBandwidth() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthDependent.java index 8d7102a21b..83c26c9696 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthDependent.java @@ -26,5 +26,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected InstanceProfileVolumeBandwidthDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthEnum.java index efd5b798e2..5c105106d0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthEnum.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthEnum.java @@ -26,5 +26,7 @@ public interface Type { String X_ENUM = "enum"; } + + protected InstanceProfileVolumeBandwidthEnum() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthFixed.java index ded98dbbfd..d679eecdf2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected InstanceProfileVolumeBandwidthFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthRange.java index 2a10c623b0..aa0a32bc83 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthRange.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthRange.java @@ -26,5 +26,7 @@ public interface Type { String RANGE = "range"; } + + protected InstanceProfileVolumeBandwidthRange() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototype.java index b4e597ca2f..25c90e4bf1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototype.java @@ -22,6 +22,7 @@ * * Classes which extend this class: * - InstancePrototypeInstanceByImage + * - InstancePrototypeInstanceByCatalogOffering * - InstancePrototypeInstanceBySourceSnapshot * - InstancePrototypeInstanceBySourceTemplate */ @@ -55,11 +56,12 @@ public class InstancePrototype extends GenericModel { @SerializedName("primary_network_interface") protected NetworkInterfacePrototype primaryNetworkInterface; protected ZoneIdentity zone; + @SerializedName("catalog_offering") + protected InstanceCatalogOfferingPrototype catalogOffering; @SerializedName("source_template") protected InstanceTemplateIdentity sourceTemplate; - protected InstancePrototype() { - } + protected InstancePrototype() { } /** * Gets the availabilityPolicy. @@ -158,8 +160,11 @@ public InstancePlacementTargetPrototype placementTarget() { /** * Gets the profile. * - * The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will - * be used, but this default value is expected to change in the future. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + * virtual server instance. + * + * If unspecified, `bx2-2x8` will be used, but this default value is expected to change + * in the future. * * @return the profile */ @@ -218,8 +223,10 @@ public List volumeAttachments() { /** * Gets the vpc. * - * The VPC the virtual server instance is to be a part of. If specified, it must match - * the VPC referenced by the subnets of the instance's network interfaces. + * The VPC this virtual server instance will reside in. + * + * If specified, it must match the VPC for the subnets of the instance's network + * interfaces. * * @return the vpc */ @@ -271,6 +278,24 @@ public ZoneIdentity zone() { return zone; } + /** + * Gets the catalogOffering. + * + * The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + * or offering version to use when provisioning this virtual server instance. + * + * If an offering is specified, the latest version of that offering will be used. + * + * The specified offering or offering version may be in a different account in the same + * [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject + * to IAM policies. + * + * @return the catalogOffering + */ + public InstanceCatalogOfferingPrototype catalogOffering() { + return catalogOffering; + } + /** * Gets the sourceTemplate. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOffering.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOffering.java new file mode 100644 index 0000000000..df5bf61060 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOffering.java @@ -0,0 +1,375 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * InstancePrototypeInstanceByCatalogOffering. + */ +public class InstancePrototypeInstanceByCatalogOffering extends InstancePrototype { + + + /** + * Builder. + */ + public static class Builder { + private InstanceAvailabilityPrototype availabilityPolicy; + private InstanceDefaultTrustedProfilePrototype defaultTrustedProfile; + private List keys; + private InstanceMetadataServicePrototype metadataService; + private String name; + private List networkInterfaces; + private InstancePlacementTargetPrototype placementTarget; + private InstanceProfileIdentity profile; + private ResourceGroupIdentity resourceGroup; + private Long totalVolumeBandwidth; + private String userData; + private List volumeAttachments; + private VPCIdentity vpc; + private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; + private InstanceCatalogOfferingPrototype catalogOffering; + private NetworkInterfacePrototype primaryNetworkInterface; + private ZoneIdentity zone; + + /** + * Instantiates a new Builder from an existing InstancePrototypeInstanceByCatalogOffering instance. + * + * @param instancePrototypeInstanceByCatalogOffering the instance to initialize the Builder with + */ + public Builder(InstancePrototype instancePrototypeInstanceByCatalogOffering) { + this.availabilityPolicy = instancePrototypeInstanceByCatalogOffering.availabilityPolicy; + this.defaultTrustedProfile = instancePrototypeInstanceByCatalogOffering.defaultTrustedProfile; + this.keys = instancePrototypeInstanceByCatalogOffering.keys; + this.metadataService = instancePrototypeInstanceByCatalogOffering.metadataService; + this.name = instancePrototypeInstanceByCatalogOffering.name; + this.networkInterfaces = instancePrototypeInstanceByCatalogOffering.networkInterfaces; + this.placementTarget = instancePrototypeInstanceByCatalogOffering.placementTarget; + this.profile = instancePrototypeInstanceByCatalogOffering.profile; + this.resourceGroup = instancePrototypeInstanceByCatalogOffering.resourceGroup; + this.totalVolumeBandwidth = instancePrototypeInstanceByCatalogOffering.totalVolumeBandwidth; + this.userData = instancePrototypeInstanceByCatalogOffering.userData; + this.volumeAttachments = instancePrototypeInstanceByCatalogOffering.volumeAttachments; + this.vpc = instancePrototypeInstanceByCatalogOffering.vpc; + this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instancePrototypeInstanceByCatalogOffering.bootVolumeAttachment; + this.catalogOffering = instancePrototypeInstanceByCatalogOffering.catalogOffering; + this.primaryNetworkInterface = instancePrototypeInstanceByCatalogOffering.primaryNetworkInterface; + this.zone = instancePrototypeInstanceByCatalogOffering.zone; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param catalogOffering the catalogOffering + * @param primaryNetworkInterface the primaryNetworkInterface + * @param zone the zone + */ + public Builder(InstanceCatalogOfferingPrototype catalogOffering, NetworkInterfacePrototype primaryNetworkInterface, ZoneIdentity zone) { + this.catalogOffering = catalogOffering; + this.primaryNetworkInterface = primaryNetworkInterface; + this.zone = zone; + } + + /** + * Builds a InstancePrototypeInstanceByCatalogOffering. + * + * @return the new InstancePrototypeInstanceByCatalogOffering instance + */ + public InstancePrototypeInstanceByCatalogOffering build() { + return new InstancePrototypeInstanceByCatalogOffering(this); + } + + /** + * Adds an keys to keys. + * + * @param keys the new keys + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder addKeys(KeyIdentity keys) { + com.ibm.cloud.sdk.core.util.Validator.notNull(keys, + "keys cannot be null"); + if (this.keys == null) { + this.keys = new ArrayList(); + } + this.keys.add(keys); + return this; + } + + /** + * Adds an networkInterfaces to networkInterfaces. + * + * @param networkInterfaces the new networkInterfaces + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder addNetworkInterfaces(NetworkInterfacePrototype networkInterfaces) { + com.ibm.cloud.sdk.core.util.Validator.notNull(networkInterfaces, + "networkInterfaces cannot be null"); + if (this.networkInterfaces == null) { + this.networkInterfaces = new ArrayList(); + } + this.networkInterfaces.add(networkInterfaces); + return this; + } + + /** + * Adds an volumeAttachments to volumeAttachments. + * + * @param volumeAttachments the new volumeAttachments + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder addVolumeAttachments(VolumeAttachmentPrototypeInstanceContext volumeAttachments) { + com.ibm.cloud.sdk.core.util.Validator.notNull(volumeAttachments, + "volumeAttachments cannot be null"); + if (this.volumeAttachments == null) { + this.volumeAttachments = new ArrayList(); + } + this.volumeAttachments.add(volumeAttachments); + return this; + } + + /** + * Set the availabilityPolicy. + * + * @param availabilityPolicy the availabilityPolicy + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder availabilityPolicy(InstanceAvailabilityPrototype availabilityPolicy) { + this.availabilityPolicy = availabilityPolicy; + return this; + } + + /** + * Set the defaultTrustedProfile. + * + * @param defaultTrustedProfile the defaultTrustedProfile + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder defaultTrustedProfile(InstanceDefaultTrustedProfilePrototype defaultTrustedProfile) { + this.defaultTrustedProfile = defaultTrustedProfile; + return this; + } + + /** + * Set the keys. + * Existing keys will be replaced. + * + * @param keys the keys + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder keys(List keys) { + this.keys = keys; + return this; + } + + /** + * Set the metadataService. + * + * @param metadataService the metadataService + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder metadataService(InstanceMetadataServicePrototype metadataService) { + this.metadataService = metadataService; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the networkInterfaces. + * Existing networkInterfaces will be replaced. + * + * @param networkInterfaces the networkInterfaces + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder networkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Set the placementTarget. + * + * @param placementTarget the placementTarget + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder placementTarget(InstancePlacementTargetPrototype placementTarget) { + this.placementTarget = placementTarget; + return this; + } + + /** + * Set the profile. + * + * @param profile the profile + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder profile(InstanceProfileIdentity profile) { + this.profile = profile; + return this; + } + + /** + * Set the resourceGroup. + * + * @param resourceGroup the resourceGroup + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Set the totalVolumeBandwidth. + * + * @param totalVolumeBandwidth the totalVolumeBandwidth + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder totalVolumeBandwidth(long totalVolumeBandwidth) { + this.totalVolumeBandwidth = totalVolumeBandwidth; + return this; + } + + /** + * Set the userData. + * + * @param userData the userData + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder userData(String userData) { + this.userData = userData; + return this; + } + + /** + * Set the volumeAttachments. + * Existing volumeAttachments will be replaced. + * + * @param volumeAttachments the volumeAttachments + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder volumeAttachments(List volumeAttachments) { + this.volumeAttachments = volumeAttachments; + return this; + } + + /** + * Set the vpc. + * + * @param vpc the vpc + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder vpc(VPCIdentity vpc) { + this.vpc = vpc; + return this; + } + + /** + * Set the bootVolumeAttachment. + * + * @param bootVolumeAttachment the bootVolumeAttachment + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder bootVolumeAttachment(VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment) { + this.bootVolumeAttachment = bootVolumeAttachment; + return this; + } + + /** + * Set the catalogOffering. + * + * @param catalogOffering the catalogOffering + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder catalogOffering(InstanceCatalogOfferingPrototype catalogOffering) { + this.catalogOffering = catalogOffering; + return this; + } + + /** + * Set the primaryNetworkInterface. + * + * @param primaryNetworkInterface the primaryNetworkInterface + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder primaryNetworkInterface(NetworkInterfacePrototype primaryNetworkInterface) { + this.primaryNetworkInterface = primaryNetworkInterface; + return this; + } + + /** + * Set the zone. + * + * @param zone the zone + * @return the InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder zone(ZoneIdentity zone) { + this.zone = zone; + return this; + } + } + + protected InstancePrototypeInstanceByCatalogOffering() { } + + protected InstancePrototypeInstanceByCatalogOffering(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.catalogOffering, + "catalogOffering cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.primaryNetworkInterface, + "primaryNetworkInterface cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.zone, + "zone cannot be null"); + availabilityPolicy = builder.availabilityPolicy; + defaultTrustedProfile = builder.defaultTrustedProfile; + keys = builder.keys; + metadataService = builder.metadataService; + name = builder.name; + networkInterfaces = builder.networkInterfaces; + placementTarget = builder.placementTarget; + profile = builder.profile; + resourceGroup = builder.resourceGroup; + totalVolumeBandwidth = builder.totalVolumeBandwidth; + userData = builder.userData; + volumeAttachments = builder.volumeAttachments; + vpc = builder.vpc; + bootVolumeAttachment = builder.bootVolumeAttachment; + catalogOffering = builder.catalogOffering; + primaryNetworkInterface = builder.primaryNetworkInterface; + zone = builder.zone; + } + + /** + * New builder. + * + * @return a InstancePrototypeInstanceByCatalogOffering builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImage.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImage.java index 5e4981d728..b71095483f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImage.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImage.java @@ -43,6 +43,11 @@ public static class Builder { private NetworkInterfacePrototype primaryNetworkInterface; private ZoneIdentity zone; + /** + * Instantiates a new Builder from an existing InstancePrototypeInstanceByImage instance. + * + * @param instancePrototypeInstanceByImage the instance to initialize the Builder with + */ public Builder(InstancePrototype instancePrototypeInstanceByImage) { this.availabilityPolicy = instancePrototypeInstanceByImage.availabilityPolicy; this.defaultTrustedProfile = instancePrototypeInstanceByImage.defaultTrustedProfile; @@ -330,6 +335,8 @@ public Builder zone(ZoneIdentity zone) { } } + protected InstancePrototypeInstanceByImage() { } + protected InstancePrototypeInstanceByImage(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.image, "image cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshot.java index fefbcee8fc..541254aa38 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshot.java @@ -42,6 +42,11 @@ public static class Builder { private NetworkInterfacePrototype primaryNetworkInterface; private ZoneIdentity zone; + /** + * Instantiates a new Builder from an existing InstancePrototypeInstanceBySourceSnapshot instance. + * + * @param instancePrototypeInstanceBySourceSnapshot the instance to initialize the Builder with + */ public Builder(InstancePrototype instancePrototypeInstanceBySourceSnapshot) { this.availabilityPolicy = instancePrototypeInstanceBySourceSnapshot.availabilityPolicy; this.defaultTrustedProfile = instancePrototypeInstanceBySourceSnapshot.defaultTrustedProfile; @@ -317,6 +322,8 @@ public Builder zone(ZoneIdentity zone) { } } + protected InstancePrototypeInstanceBySourceSnapshot() { } + protected InstancePrototypeInstanceBySourceSnapshot(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.bootVolumeAttachment, "bootVolumeAttachment cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplate.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplate.java index 77dcf90df1..4279f0a1fe 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplate.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplate.java @@ -39,11 +39,17 @@ public static class Builder { private List volumeAttachments; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; + private InstanceCatalogOfferingPrototype catalogOffering; private ImageIdentity image; private NetworkInterfacePrototype primaryNetworkInterface; private InstanceTemplateIdentity sourceTemplate; private ZoneIdentity zone; + /** + * Instantiates a new Builder from an existing InstancePrototypeInstanceBySourceTemplate instance. + * + * @param instancePrototypeInstanceBySourceTemplate the instance to initialize the Builder with + */ public Builder(InstancePrototype instancePrototypeInstanceBySourceTemplate) { this.availabilityPolicy = instancePrototypeInstanceBySourceTemplate.availabilityPolicy; this.defaultTrustedProfile = instancePrototypeInstanceBySourceTemplate.defaultTrustedProfile; @@ -59,6 +65,7 @@ public Builder(InstancePrototype instancePrototypeInstanceBySourceTemplate) { this.volumeAttachments = instancePrototypeInstanceBySourceTemplate.volumeAttachments; this.vpc = instancePrototypeInstanceBySourceTemplate.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instancePrototypeInstanceBySourceTemplate.bootVolumeAttachment; + this.catalogOffering = instancePrototypeInstanceBySourceTemplate.catalogOffering; this.image = instancePrototypeInstanceBySourceTemplate.image; this.primaryNetworkInterface = instancePrototypeInstanceBySourceTemplate.primaryNetworkInterface; this.sourceTemplate = instancePrototypeInstanceBySourceTemplate.sourceTemplate; @@ -294,6 +301,17 @@ public Builder bootVolumeAttachment(VolumeAttachmentPrototypeInstanceByImageCont return this; } + /** + * Set the catalogOffering. + * + * @param catalogOffering the catalogOffering + * @return the InstancePrototypeInstanceBySourceTemplate builder + */ + public Builder catalogOffering(InstanceCatalogOfferingPrototype catalogOffering) { + this.catalogOffering = catalogOffering; + return this; + } + /** * Set the image. * @@ -339,6 +357,8 @@ public Builder zone(ZoneIdentity zone) { } } + protected InstancePrototypeInstanceBySourceTemplate() { } + protected InstancePrototypeInstanceBySourceTemplate(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.sourceTemplate, "sourceTemplate cannot be null"); @@ -356,6 +376,7 @@ protected InstancePrototypeInstanceBySourceTemplate(Builder builder) { volumeAttachments = builder.volumeAttachments; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; + catalogOffering = builder.catalogOffering; image = builder.image; primaryNetworkInterface = builder.primaryNetworkInterface; sourceTemplate = builder.sourceTemplate; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceReference.java index 204b67d419..a36ba8e0b8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceReference.java @@ -25,6 +25,8 @@ public class InstanceReference extends GenericModel { protected String id; protected String name; + protected InstanceReference() { } + /** * Gets the crn. * @@ -39,7 +41,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceReferenceDeleted.java index 3f1ad9b6df..1b9d495d4a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class InstanceReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class InstanceReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected InstanceReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceStatusReason.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceStatusReason.java index 5e671fd72c..2edb86d0db 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceStatusReason.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceStatusReason.java @@ -51,6 +51,8 @@ public interface Code { @SerializedName("more_info") protected String moreInfo; + protected InstanceStatusReason() { } + /** * Gets the code. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplate.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplate.java index 2e0ff05897..9bb85f557e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplate.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplate.java @@ -24,6 +24,7 @@ * Classes which extend this class: * - InstanceTemplateInstanceByImage * - InstanceTemplateInstanceBySourceSnapshot + * - InstanceTemplateInstanceByCatalogOffering */ public class InstanceTemplate extends GenericModel { @@ -60,9 +61,10 @@ public class InstanceTemplate extends GenericModel { @SerializedName("primary_network_interface") protected NetworkInterfacePrototype primaryNetworkInterface; protected ZoneIdentity zone; + @SerializedName("catalog_offering") + protected InstanceCatalogOfferingPrototype catalogOffering; - protected InstanceTemplate() { - } + protected InstanceTemplate() { } /** * Gets the availabilityPolicy. @@ -204,8 +206,11 @@ public InstancePlacementTargetPrototype getPlacementTarget() { /** * Gets the profile. * - * The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will - * be used, but this default value is expected to change in the future. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + * virtual server instance. + * + * If unspecified, `bx2-2x8` will be used, but this default value is expected to change + * in the future. * * @return the profile */ @@ -263,8 +268,10 @@ public List getVolumeAttachments() { /** * Gets the vpc. * - * The VPC the virtual server instance is to be a part of. If specified, it must match - * the VPC referenced by the subnets of the instance's network interfaces. + * The VPC this virtual server instance will reside in. + * + * If specified, it must match the VPC for the subnets of the instance's network + * interfaces. * * @return the vpc */ @@ -315,5 +322,23 @@ public NetworkInterfacePrototype getPrimaryNetworkInterface() { public ZoneIdentity getZone() { return zone; } + + /** + * Gets the catalogOffering. + * + * The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + * or offering version to use when provisioning this virtual server instance. + * + * If an offering is specified, the latest version of that offering will be used. + * + * The specified offering or offering version may be in a different account in the same + * [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject + * to IAM policies. + * + * @return the catalogOffering + */ + public InstanceCatalogOfferingPrototype getCatalogOffering() { + return catalogOffering; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollection.java index ada54c8218..463701968a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollection.java @@ -29,6 +29,8 @@ public class InstanceTemplateCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected InstanceTemplateCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionFirst.java index 6e3acb7841..a0e5b1c385 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionFirst.java @@ -21,6 +21,8 @@ public class InstanceTemplateCollectionFirst extends GenericModel { protected String href; + protected InstanceTemplateCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionNext.java index 98833aed08..12bcf4dce7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionNext.java @@ -21,6 +21,8 @@ public class InstanceTemplateCollectionNext extends GenericModel { protected String href; + protected InstanceTemplateCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentity.java index 94cb1151f7..8a72fced46 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentity.java @@ -28,8 +28,7 @@ public class InstanceTemplateIdentity extends GenericModel { protected String href; protected String crn; - protected InstanceTemplateIdentity() { - } + protected InstanceTemplateIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentityByCRN.java index 43a4ba4d15..5ce41a677a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentityByCRN.java @@ -24,6 +24,11 @@ public class InstanceTemplateIdentityByCRN extends InstanceTemplateIdentity { public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing InstanceTemplateIdentityByCRN instance. + * + * @param instanceTemplateIdentityByCrn the instance to initialize the Builder with + */ public Builder(InstanceTemplateIdentity instanceTemplateIdentityByCrn) { this.crn = instanceTemplateIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected InstanceTemplateIdentityByCRN() { } + protected InstanceTemplateIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentityByHref.java index ce5a991ed9..20074969bd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentityByHref.java @@ -24,6 +24,11 @@ public class InstanceTemplateIdentityByHref extends InstanceTemplateIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing InstanceTemplateIdentityByHref instance. + * + * @param instanceTemplateIdentityByHref the instance to initialize the Builder with + */ public Builder(InstanceTemplateIdentity instanceTemplateIdentityByHref) { this.href = instanceTemplateIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected InstanceTemplateIdentityByHref() { } + protected InstanceTemplateIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentityById.java index ac413b009a..7cef8481a3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateIdentityById.java @@ -24,6 +24,11 @@ public class InstanceTemplateIdentityById extends InstanceTemplateIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing InstanceTemplateIdentityById instance. + * + * @param instanceTemplateIdentityById the instance to initialize the Builder with + */ public Builder(InstanceTemplateIdentity instanceTemplateIdentityById) { this.id = instanceTemplateIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected InstanceTemplateIdentityById() { } + protected InstanceTemplateIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOffering.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOffering.java new file mode 100644 index 0000000000..ed9c979c70 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOffering.java @@ -0,0 +1,23 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +/** + * InstanceTemplateInstanceByCatalogOffering. + */ +public class InstanceTemplateInstanceByCatalogOffering extends InstanceTemplate { + + + protected InstanceTemplateInstanceByCatalogOffering() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImage.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImage.java index d381876607..ad5fde7586 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImage.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImage.java @@ -17,5 +17,7 @@ */ public class InstanceTemplateInstanceByImage extends InstanceTemplate { + + protected InstanceTemplateInstanceByImage() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshot.java index b70d7c1ee5..c3d8fc1ab1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshot.java @@ -17,5 +17,7 @@ */ public class InstanceTemplateInstanceBySourceSnapshot extends InstanceTemplate { + + protected InstanceTemplateInstanceBySourceSnapshot() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePatch.java index 33c49db573..a3fdd99f25 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePatch.java @@ -30,6 +30,11 @@ public class InstanceTemplatePatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing InstanceTemplatePatch instance. + * + * @param instanceTemplatePatch the instance to initialize the Builder with + */ private Builder(InstanceTemplatePatch instanceTemplatePatch) { this.name = instanceTemplatePatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected InstanceTemplatePatch() { } + protected InstanceTemplatePatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototype.java index 8e07ead016..0ff13d233f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototype.java @@ -23,6 +23,8 @@ * Classes which extend this class: * - InstanceTemplatePrototypeInstanceByImage * - InstanceTemplatePrototypeInstanceBySourceTemplate + * - InstanceTemplatePrototypeInstanceBySourceSnapshot + * - InstanceTemplatePrototypeInstanceByCatalogOffering */ public class InstanceTemplatePrototype extends GenericModel { @@ -54,11 +56,12 @@ public class InstanceTemplatePrototype extends GenericModel { @SerializedName("primary_network_interface") protected NetworkInterfacePrototype primaryNetworkInterface; protected ZoneIdentity zone; + @SerializedName("catalog_offering") + protected InstanceCatalogOfferingPrototype catalogOffering; @SerializedName("source_template") protected InstanceTemplateIdentity sourceTemplate; - protected InstanceTemplatePrototype() { - } + protected InstanceTemplatePrototype() { } /** * Gets the availabilityPolicy. @@ -157,8 +160,11 @@ public InstancePlacementTargetPrototype placementTarget() { /** * Gets the profile. * - * The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will - * be used, but this default value is expected to change in the future. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + * virtual server instance. + * + * If unspecified, `bx2-2x8` will be used, but this default value is expected to change + * in the future. * * @return the profile */ @@ -217,8 +223,10 @@ public List volumeAttachments() { /** * Gets the vpc. * - * The VPC the virtual server instance is to be a part of. If specified, it must match - * the VPC referenced by the subnets of the instance's network interfaces. + * The VPC this virtual server instance will reside in. + * + * If specified, it must match the VPC for the subnets of the instance's network + * interfaces. * * @return the vpc */ @@ -270,6 +278,25 @@ public ZoneIdentity zone() { return zone; } + /** + * Gets the catalogOffering. + * + * The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + * offering version to use when provisioning this virtual server instance. + * If an offering is specified, the latest version of that offering will be used. + * + * The specified offering or offering version may be in a different account, subject to + * IAM policies. + * + * If specified, `image` must not be specified, and `source_template` must not have + * `image` specified. + * + * @return the catalogOffering + */ + public InstanceCatalogOfferingPrototype catalogOffering() { + return catalogOffering; + } + /** * Gets the sourceTemplate. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByCatalogOffering.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByCatalogOffering.java new file mode 100644 index 0000000000..b6e3fcae4e --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByCatalogOffering.java @@ -0,0 +1,375 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * InstanceTemplatePrototypeInstanceByCatalogOffering. + */ +public class InstanceTemplatePrototypeInstanceByCatalogOffering extends InstanceTemplatePrototype { + + + /** + * Builder. + */ + public static class Builder { + private InstanceAvailabilityPrototype availabilityPolicy; + private InstanceDefaultTrustedProfilePrototype defaultTrustedProfile; + private List keys; + private InstanceMetadataServicePrototype metadataService; + private String name; + private List networkInterfaces; + private InstancePlacementTargetPrototype placementTarget; + private InstanceProfileIdentity profile; + private ResourceGroupIdentity resourceGroup; + private Long totalVolumeBandwidth; + private String userData; + private List volumeAttachments; + private VPCIdentity vpc; + private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; + private InstanceCatalogOfferingPrototype catalogOffering; + private NetworkInterfacePrototype primaryNetworkInterface; + private ZoneIdentity zone; + + /** + * Instantiates a new Builder from an existing InstanceTemplatePrototypeInstanceByCatalogOffering instance. + * + * @param instanceTemplatePrototypeInstanceByCatalogOffering the instance to initialize the Builder with + */ + public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceByCatalogOffering) { + this.availabilityPolicy = instanceTemplatePrototypeInstanceByCatalogOffering.availabilityPolicy; + this.defaultTrustedProfile = instanceTemplatePrototypeInstanceByCatalogOffering.defaultTrustedProfile; + this.keys = instanceTemplatePrototypeInstanceByCatalogOffering.keys; + this.metadataService = instanceTemplatePrototypeInstanceByCatalogOffering.metadataService; + this.name = instanceTemplatePrototypeInstanceByCatalogOffering.name; + this.networkInterfaces = instanceTemplatePrototypeInstanceByCatalogOffering.networkInterfaces; + this.placementTarget = instanceTemplatePrototypeInstanceByCatalogOffering.placementTarget; + this.profile = instanceTemplatePrototypeInstanceByCatalogOffering.profile; + this.resourceGroup = instanceTemplatePrototypeInstanceByCatalogOffering.resourceGroup; + this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceByCatalogOffering.totalVolumeBandwidth; + this.userData = instanceTemplatePrototypeInstanceByCatalogOffering.userData; + this.volumeAttachments = instanceTemplatePrototypeInstanceByCatalogOffering.volumeAttachments; + this.vpc = instanceTemplatePrototypeInstanceByCatalogOffering.vpc; + this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instanceTemplatePrototypeInstanceByCatalogOffering.bootVolumeAttachment; + this.catalogOffering = instanceTemplatePrototypeInstanceByCatalogOffering.catalogOffering; + this.primaryNetworkInterface = instanceTemplatePrototypeInstanceByCatalogOffering.primaryNetworkInterface; + this.zone = instanceTemplatePrototypeInstanceByCatalogOffering.zone; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param catalogOffering the catalogOffering + * @param primaryNetworkInterface the primaryNetworkInterface + * @param zone the zone + */ + public Builder(InstanceCatalogOfferingPrototype catalogOffering, NetworkInterfacePrototype primaryNetworkInterface, ZoneIdentity zone) { + this.catalogOffering = catalogOffering; + this.primaryNetworkInterface = primaryNetworkInterface; + this.zone = zone; + } + + /** + * Builds a InstanceTemplatePrototypeInstanceByCatalogOffering. + * + * @return the new InstanceTemplatePrototypeInstanceByCatalogOffering instance + */ + public InstanceTemplatePrototypeInstanceByCatalogOffering build() { + return new InstanceTemplatePrototypeInstanceByCatalogOffering(this); + } + + /** + * Adds an keys to keys. + * + * @param keys the new keys + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder addKeys(KeyIdentity keys) { + com.ibm.cloud.sdk.core.util.Validator.notNull(keys, + "keys cannot be null"); + if (this.keys == null) { + this.keys = new ArrayList(); + } + this.keys.add(keys); + return this; + } + + /** + * Adds an networkInterfaces to networkInterfaces. + * + * @param networkInterfaces the new networkInterfaces + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder addNetworkInterfaces(NetworkInterfacePrototype networkInterfaces) { + com.ibm.cloud.sdk.core.util.Validator.notNull(networkInterfaces, + "networkInterfaces cannot be null"); + if (this.networkInterfaces == null) { + this.networkInterfaces = new ArrayList(); + } + this.networkInterfaces.add(networkInterfaces); + return this; + } + + /** + * Adds an volumeAttachments to volumeAttachments. + * + * @param volumeAttachments the new volumeAttachments + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder addVolumeAttachments(VolumeAttachmentPrototypeInstanceContext volumeAttachments) { + com.ibm.cloud.sdk.core.util.Validator.notNull(volumeAttachments, + "volumeAttachments cannot be null"); + if (this.volumeAttachments == null) { + this.volumeAttachments = new ArrayList(); + } + this.volumeAttachments.add(volumeAttachments); + return this; + } + + /** + * Set the availabilityPolicy. + * + * @param availabilityPolicy the availabilityPolicy + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder availabilityPolicy(InstanceAvailabilityPrototype availabilityPolicy) { + this.availabilityPolicy = availabilityPolicy; + return this; + } + + /** + * Set the defaultTrustedProfile. + * + * @param defaultTrustedProfile the defaultTrustedProfile + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder defaultTrustedProfile(InstanceDefaultTrustedProfilePrototype defaultTrustedProfile) { + this.defaultTrustedProfile = defaultTrustedProfile; + return this; + } + + /** + * Set the keys. + * Existing keys will be replaced. + * + * @param keys the keys + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder keys(List keys) { + this.keys = keys; + return this; + } + + /** + * Set the metadataService. + * + * @param metadataService the metadataService + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder metadataService(InstanceMetadataServicePrototype metadataService) { + this.metadataService = metadataService; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the networkInterfaces. + * Existing networkInterfaces will be replaced. + * + * @param networkInterfaces the networkInterfaces + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder networkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Set the placementTarget. + * + * @param placementTarget the placementTarget + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder placementTarget(InstancePlacementTargetPrototype placementTarget) { + this.placementTarget = placementTarget; + return this; + } + + /** + * Set the profile. + * + * @param profile the profile + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder profile(InstanceProfileIdentity profile) { + this.profile = profile; + return this; + } + + /** + * Set the resourceGroup. + * + * @param resourceGroup the resourceGroup + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Set the totalVolumeBandwidth. + * + * @param totalVolumeBandwidth the totalVolumeBandwidth + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder totalVolumeBandwidth(long totalVolumeBandwidth) { + this.totalVolumeBandwidth = totalVolumeBandwidth; + return this; + } + + /** + * Set the userData. + * + * @param userData the userData + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder userData(String userData) { + this.userData = userData; + return this; + } + + /** + * Set the volumeAttachments. + * Existing volumeAttachments will be replaced. + * + * @param volumeAttachments the volumeAttachments + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder volumeAttachments(List volumeAttachments) { + this.volumeAttachments = volumeAttachments; + return this; + } + + /** + * Set the vpc. + * + * @param vpc the vpc + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder vpc(VPCIdentity vpc) { + this.vpc = vpc; + return this; + } + + /** + * Set the bootVolumeAttachment. + * + * @param bootVolumeAttachment the bootVolumeAttachment + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder bootVolumeAttachment(VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment) { + this.bootVolumeAttachment = bootVolumeAttachment; + return this; + } + + /** + * Set the catalogOffering. + * + * @param catalogOffering the catalogOffering + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder catalogOffering(InstanceCatalogOfferingPrototype catalogOffering) { + this.catalogOffering = catalogOffering; + return this; + } + + /** + * Set the primaryNetworkInterface. + * + * @param primaryNetworkInterface the primaryNetworkInterface + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder primaryNetworkInterface(NetworkInterfacePrototype primaryNetworkInterface) { + this.primaryNetworkInterface = primaryNetworkInterface; + return this; + } + + /** + * Set the zone. + * + * @param zone the zone + * @return the InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder zone(ZoneIdentity zone) { + this.zone = zone; + return this; + } + } + + protected InstanceTemplatePrototypeInstanceByCatalogOffering() { } + + protected InstanceTemplatePrototypeInstanceByCatalogOffering(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.catalogOffering, + "catalogOffering cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.primaryNetworkInterface, + "primaryNetworkInterface cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.zone, + "zone cannot be null"); + availabilityPolicy = builder.availabilityPolicy; + defaultTrustedProfile = builder.defaultTrustedProfile; + keys = builder.keys; + metadataService = builder.metadataService; + name = builder.name; + networkInterfaces = builder.networkInterfaces; + placementTarget = builder.placementTarget; + profile = builder.profile; + resourceGroup = builder.resourceGroup; + totalVolumeBandwidth = builder.totalVolumeBandwidth; + userData = builder.userData; + volumeAttachments = builder.volumeAttachments; + vpc = builder.vpc; + bootVolumeAttachment = builder.bootVolumeAttachment; + catalogOffering = builder.catalogOffering; + primaryNetworkInterface = builder.primaryNetworkInterface; + zone = builder.zone; + } + + /** + * New builder. + * + * @return a InstanceTemplatePrototypeInstanceByCatalogOffering builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImage.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImage.java index d4a492ea31..2f46d726c2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImage.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImage.java @@ -43,6 +43,11 @@ public static class Builder { private NetworkInterfacePrototype primaryNetworkInterface; private ZoneIdentity zone; + /** + * Instantiates a new Builder from an existing InstanceTemplatePrototypeInstanceByImage instance. + * + * @param instanceTemplatePrototypeInstanceByImage the instance to initialize the Builder with + */ public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceByImage) { this.availabilityPolicy = instanceTemplatePrototypeInstanceByImage.availabilityPolicy; this.defaultTrustedProfile = instanceTemplatePrototypeInstanceByImage.defaultTrustedProfile; @@ -330,6 +335,8 @@ public Builder zone(ZoneIdentity zone) { } } + protected InstanceTemplatePrototypeInstanceByImage() { } + protected InstanceTemplatePrototypeInstanceByImage(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.image, "image cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceSnapshot.java new file mode 100644 index 0000000000..dd6a65cdd3 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceSnapshot.java @@ -0,0 +1,361 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * InstanceTemplatePrototypeInstanceBySourceSnapshot. + */ +public class InstanceTemplatePrototypeInstanceBySourceSnapshot extends InstanceTemplatePrototype { + + + /** + * Builder. + */ + public static class Builder { + private InstanceAvailabilityPrototype availabilityPolicy; + private InstanceDefaultTrustedProfilePrototype defaultTrustedProfile; + private List keys; + private InstanceMetadataServicePrototype metadataService; + private String name; + private List networkInterfaces; + private InstancePlacementTargetPrototype placementTarget; + private InstanceProfileIdentity profile; + private ResourceGroupIdentity resourceGroup; + private Long totalVolumeBandwidth; + private String userData; + private List volumeAttachments; + private VPCIdentity vpc; + private VolumeAttachmentPrototypeInstanceBySourceSnapshotContext bootVolumeAttachment; + private NetworkInterfacePrototype primaryNetworkInterface; + private ZoneIdentity zone; + + /** + * Instantiates a new Builder from an existing InstanceTemplatePrototypeInstanceBySourceSnapshot instance. + * + * @param instanceTemplatePrototypeInstanceBySourceSnapshot the instance to initialize the Builder with + */ + public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceBySourceSnapshot) { + this.availabilityPolicy = instanceTemplatePrototypeInstanceBySourceSnapshot.availabilityPolicy; + this.defaultTrustedProfile = instanceTemplatePrototypeInstanceBySourceSnapshot.defaultTrustedProfile; + this.keys = instanceTemplatePrototypeInstanceBySourceSnapshot.keys; + this.metadataService = instanceTemplatePrototypeInstanceBySourceSnapshot.metadataService; + this.name = instanceTemplatePrototypeInstanceBySourceSnapshot.name; + this.networkInterfaces = instanceTemplatePrototypeInstanceBySourceSnapshot.networkInterfaces; + this.placementTarget = instanceTemplatePrototypeInstanceBySourceSnapshot.placementTarget; + this.profile = instanceTemplatePrototypeInstanceBySourceSnapshot.profile; + this.resourceGroup = instanceTemplatePrototypeInstanceBySourceSnapshot.resourceGroup; + this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceBySourceSnapshot.totalVolumeBandwidth; + this.userData = instanceTemplatePrototypeInstanceBySourceSnapshot.userData; + this.volumeAttachments = instanceTemplatePrototypeInstanceBySourceSnapshot.volumeAttachments; + this.vpc = instanceTemplatePrototypeInstanceBySourceSnapshot.vpc; + this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceBySourceSnapshotContext) instanceTemplatePrototypeInstanceBySourceSnapshot.bootVolumeAttachment; + this.primaryNetworkInterface = instanceTemplatePrototypeInstanceBySourceSnapshot.primaryNetworkInterface; + this.zone = instanceTemplatePrototypeInstanceBySourceSnapshot.zone; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param bootVolumeAttachment the bootVolumeAttachment + * @param primaryNetworkInterface the primaryNetworkInterface + * @param zone the zone + */ + public Builder(VolumeAttachmentPrototypeInstanceBySourceSnapshotContext bootVolumeAttachment, NetworkInterfacePrototype primaryNetworkInterface, ZoneIdentity zone) { + this.bootVolumeAttachment = bootVolumeAttachment; + this.primaryNetworkInterface = primaryNetworkInterface; + this.zone = zone; + } + + /** + * Builds a InstanceTemplatePrototypeInstanceBySourceSnapshot. + * + * @return the new InstanceTemplatePrototypeInstanceBySourceSnapshot instance + */ + public InstanceTemplatePrototypeInstanceBySourceSnapshot build() { + return new InstanceTemplatePrototypeInstanceBySourceSnapshot(this); + } + + /** + * Adds an keys to keys. + * + * @param keys the new keys + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder addKeys(KeyIdentity keys) { + com.ibm.cloud.sdk.core.util.Validator.notNull(keys, + "keys cannot be null"); + if (this.keys == null) { + this.keys = new ArrayList(); + } + this.keys.add(keys); + return this; + } + + /** + * Adds an networkInterfaces to networkInterfaces. + * + * @param networkInterfaces the new networkInterfaces + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder addNetworkInterfaces(NetworkInterfacePrototype networkInterfaces) { + com.ibm.cloud.sdk.core.util.Validator.notNull(networkInterfaces, + "networkInterfaces cannot be null"); + if (this.networkInterfaces == null) { + this.networkInterfaces = new ArrayList(); + } + this.networkInterfaces.add(networkInterfaces); + return this; + } + + /** + * Adds an volumeAttachments to volumeAttachments. + * + * @param volumeAttachments the new volumeAttachments + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder addVolumeAttachments(VolumeAttachmentPrototypeInstanceContext volumeAttachments) { + com.ibm.cloud.sdk.core.util.Validator.notNull(volumeAttachments, + "volumeAttachments cannot be null"); + if (this.volumeAttachments == null) { + this.volumeAttachments = new ArrayList(); + } + this.volumeAttachments.add(volumeAttachments); + return this; + } + + /** + * Set the availabilityPolicy. + * + * @param availabilityPolicy the availabilityPolicy + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder availabilityPolicy(InstanceAvailabilityPrototype availabilityPolicy) { + this.availabilityPolicy = availabilityPolicy; + return this; + } + + /** + * Set the defaultTrustedProfile. + * + * @param defaultTrustedProfile the defaultTrustedProfile + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder defaultTrustedProfile(InstanceDefaultTrustedProfilePrototype defaultTrustedProfile) { + this.defaultTrustedProfile = defaultTrustedProfile; + return this; + } + + /** + * Set the keys. + * Existing keys will be replaced. + * + * @param keys the keys + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder keys(List keys) { + this.keys = keys; + return this; + } + + /** + * Set the metadataService. + * + * @param metadataService the metadataService + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder metadataService(InstanceMetadataServicePrototype metadataService) { + this.metadataService = metadataService; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the networkInterfaces. + * Existing networkInterfaces will be replaced. + * + * @param networkInterfaces the networkInterfaces + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder networkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Set the placementTarget. + * + * @param placementTarget the placementTarget + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder placementTarget(InstancePlacementTargetPrototype placementTarget) { + this.placementTarget = placementTarget; + return this; + } + + /** + * Set the profile. + * + * @param profile the profile + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder profile(InstanceProfileIdentity profile) { + this.profile = profile; + return this; + } + + /** + * Set the resourceGroup. + * + * @param resourceGroup the resourceGroup + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Set the totalVolumeBandwidth. + * + * @param totalVolumeBandwidth the totalVolumeBandwidth + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder totalVolumeBandwidth(long totalVolumeBandwidth) { + this.totalVolumeBandwidth = totalVolumeBandwidth; + return this; + } + + /** + * Set the userData. + * + * @param userData the userData + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder userData(String userData) { + this.userData = userData; + return this; + } + + /** + * Set the volumeAttachments. + * Existing volumeAttachments will be replaced. + * + * @param volumeAttachments the volumeAttachments + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder volumeAttachments(List volumeAttachments) { + this.volumeAttachments = volumeAttachments; + return this; + } + + /** + * Set the vpc. + * + * @param vpc the vpc + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder vpc(VPCIdentity vpc) { + this.vpc = vpc; + return this; + } + + /** + * Set the bootVolumeAttachment. + * + * @param bootVolumeAttachment the bootVolumeAttachment + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder bootVolumeAttachment(VolumeAttachmentPrototypeInstanceBySourceSnapshotContext bootVolumeAttachment) { + this.bootVolumeAttachment = bootVolumeAttachment; + return this; + } + + /** + * Set the primaryNetworkInterface. + * + * @param primaryNetworkInterface the primaryNetworkInterface + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder primaryNetworkInterface(NetworkInterfacePrototype primaryNetworkInterface) { + this.primaryNetworkInterface = primaryNetworkInterface; + return this; + } + + /** + * Set the zone. + * + * @param zone the zone + * @return the InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder zone(ZoneIdentity zone) { + this.zone = zone; + return this; + } + } + + protected InstanceTemplatePrototypeInstanceBySourceSnapshot() { } + + protected InstanceTemplatePrototypeInstanceBySourceSnapshot(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.bootVolumeAttachment, + "bootVolumeAttachment cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.primaryNetworkInterface, + "primaryNetworkInterface cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.zone, + "zone cannot be null"); + availabilityPolicy = builder.availabilityPolicy; + defaultTrustedProfile = builder.defaultTrustedProfile; + keys = builder.keys; + metadataService = builder.metadataService; + name = builder.name; + networkInterfaces = builder.networkInterfaces; + placementTarget = builder.placementTarget; + profile = builder.profile; + resourceGroup = builder.resourceGroup; + totalVolumeBandwidth = builder.totalVolumeBandwidth; + userData = builder.userData; + volumeAttachments = builder.volumeAttachments; + vpc = builder.vpc; + bootVolumeAttachment = builder.bootVolumeAttachment; + primaryNetworkInterface = builder.primaryNetworkInterface; + zone = builder.zone; + } + + /** + * New builder. + * + * @return a InstanceTemplatePrototypeInstanceBySourceSnapshot builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplate.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplate.java index cff706f504..4bf4df8cb0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplate.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplate.java @@ -39,11 +39,17 @@ public static class Builder { private List volumeAttachments; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; + private InstanceCatalogOfferingPrototype catalogOffering; private ImageIdentity image; private NetworkInterfacePrototype primaryNetworkInterface; private InstanceTemplateIdentity sourceTemplate; private ZoneIdentity zone; + /** + * Instantiates a new Builder from an existing InstanceTemplatePrototypeInstanceBySourceTemplate instance. + * + * @param instanceTemplatePrototypeInstanceBySourceTemplate the instance to initialize the Builder with + */ public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceBySourceTemplate) { this.availabilityPolicy = instanceTemplatePrototypeInstanceBySourceTemplate.availabilityPolicy; this.defaultTrustedProfile = instanceTemplatePrototypeInstanceBySourceTemplate.defaultTrustedProfile; @@ -59,6 +65,7 @@ public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceBySour this.volumeAttachments = instanceTemplatePrototypeInstanceBySourceTemplate.volumeAttachments; this.vpc = instanceTemplatePrototypeInstanceBySourceTemplate.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instanceTemplatePrototypeInstanceBySourceTemplate.bootVolumeAttachment; + this.catalogOffering = instanceTemplatePrototypeInstanceBySourceTemplate.catalogOffering; this.image = instanceTemplatePrototypeInstanceBySourceTemplate.image; this.primaryNetworkInterface = instanceTemplatePrototypeInstanceBySourceTemplate.primaryNetworkInterface; this.sourceTemplate = instanceTemplatePrototypeInstanceBySourceTemplate.sourceTemplate; @@ -294,6 +301,17 @@ public Builder bootVolumeAttachment(VolumeAttachmentPrototypeInstanceByImageCont return this; } + /** + * Set the catalogOffering. + * + * @param catalogOffering the catalogOffering + * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + */ + public Builder catalogOffering(InstanceCatalogOfferingPrototype catalogOffering) { + this.catalogOffering = catalogOffering; + return this; + } + /** * Set the image. * @@ -339,6 +357,8 @@ public Builder zone(ZoneIdentity zone) { } } + protected InstanceTemplatePrototypeInstanceBySourceTemplate() { } + protected InstanceTemplatePrototypeInstanceBySourceTemplate(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.sourceTemplate, "sourceTemplate cannot be null"); @@ -356,6 +376,7 @@ protected InstanceTemplatePrototypeInstanceBySourceTemplate(Builder builder) { volumeAttachments = builder.volumeAttachments; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; + catalogOffering = builder.catalogOffering; image = builder.image; primaryNetworkInterface = builder.primaryNetworkInterface; sourceTemplate = builder.sourceTemplate; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateReference.java index 3c62aa47ac..6825a6b439 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateReference.java @@ -25,6 +25,8 @@ public class InstanceTemplateReference extends GenericModel { protected String id; protected String name; + protected InstanceTemplateReference() { } + /** * Gets the crn. * @@ -39,7 +41,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateReferenceDeleted.java index 79a3ab6464..a112f4c566 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class InstanceTemplateReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class InstanceTemplateReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected InstanceTemplateReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPU.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPU.java index c317285189..3aabb46194 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPU.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPU.java @@ -22,6 +22,8 @@ public class InstanceVCPU extends GenericModel { protected String architecture; protected Long count; + protected InstanceVCPU() { } + /** * Gets the architecture. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancesPager.java new file mode 100644 index 0000000000..de16fac8d0 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * InstancesPager can be used to simplify the use of the "listInstances" method. + */ +public class InstancesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListInstancesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected InstancesPager() { } + + /** + * Constructs a new InstancesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listInstances" method + * @param options the ListInstancesOptions instance to be used to invoke the "listInstances" method + */ + public InstancesPager(Vpc client, ListInstancesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<Instance> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListInstancesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + InstanceCollection result = client.listInstances(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getInstances(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<Instance> containing all results returned by the "listInstances" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IpsecPoliciesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IpsecPoliciesPager.java new file mode 100644 index 0000000000..e50f615740 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IpsecPoliciesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * IpsecPoliciesPager can be used to simplify the use of the "listIpsecPolicies" method. + */ +public class IpsecPoliciesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListIpsecPoliciesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected IpsecPoliciesPager() { } + + /** + * Constructs a new IpsecPoliciesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listIpsecPolicies" method + * @param options the ListIpsecPoliciesOptions instance to be used to invoke the "listIpsecPolicies" method + */ + public IpsecPoliciesPager(Vpc client, ListIpsecPoliciesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<IPsecPolicy> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListIpsecPoliciesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + IPsecPolicyCollection result = client.listIpsecPolicies(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getIpsecPolicies(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<IPsecPolicy> containing all results returned by the "listIpsecPolicies" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Key.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Key.java index 02d4adf8b3..b5a886f74f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Key.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Key.java @@ -44,6 +44,8 @@ public interface Type { protected ResourceGroupReference resourceGroup; protected String type; + protected Key() { } + /** * Gets the createdAt. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyCollection.java index 2077127d94..825c8dac08 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyCollection.java @@ -29,6 +29,8 @@ public class KeyCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected KeyCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyCollectionFirst.java index 49c6e349f8..5bfcbd3939 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyCollectionFirst.java @@ -21,6 +21,8 @@ public class KeyCollectionFirst extends GenericModel { protected String href; + protected KeyCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyCollectionNext.java index d60a9637b8..a5781ff17e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyCollectionNext.java @@ -21,6 +21,8 @@ public class KeyCollectionNext extends GenericModel { protected String href; + protected KeyCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentity.java index 25577d9399..dd7e723c89 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentity.java @@ -30,8 +30,7 @@ public class KeyIdentity extends GenericModel { protected String href; protected String fingerprint; - protected KeyIdentity() { - } + protected KeyIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityByCRN.java index 214c970eb1..5801330028 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityByCRN.java @@ -24,6 +24,11 @@ public class KeyIdentityByCRN extends KeyIdentity { public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing KeyIdentityByCRN instance. + * + * @param keyIdentityByCrn the instance to initialize the Builder with + */ public Builder(KeyIdentity keyIdentityByCrn) { this.crn = keyIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected KeyIdentityByCRN() { } + protected KeyIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityByFingerprint.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityByFingerprint.java index 27b6e32a52..42946cd03b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityByFingerprint.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityByFingerprint.java @@ -24,6 +24,11 @@ public class KeyIdentityByFingerprint extends KeyIdentity { public static class Builder { private String fingerprint; + /** + * Instantiates a new Builder from an existing KeyIdentityByFingerprint instance. + * + * @param keyIdentityByFingerprint the instance to initialize the Builder with + */ public Builder(KeyIdentity keyIdentityByFingerprint) { this.fingerprint = keyIdentityByFingerprint.fingerprint; } @@ -64,6 +69,8 @@ public Builder fingerprint(String fingerprint) { } } + protected KeyIdentityByFingerprint() { } + protected KeyIdentityByFingerprint(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.fingerprint, "fingerprint cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityByHref.java index db94744c8f..204649523c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityByHref.java @@ -24,6 +24,11 @@ public class KeyIdentityByHref extends KeyIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing KeyIdentityByHref instance. + * + * @param keyIdentityByHref the instance to initialize the Builder with + */ public Builder(KeyIdentity keyIdentityByHref) { this.href = keyIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected KeyIdentityByHref() { } + protected KeyIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityById.java index 2b3c14e6f3..e941a02db5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyIdentityById.java @@ -24,6 +24,11 @@ public class KeyIdentityById extends KeyIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing KeyIdentityById instance. + * + * @param keyIdentityById the instance to initialize the Builder with + */ public Builder(KeyIdentity keyIdentityById) { this.id = keyIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected KeyIdentityById() { } + protected KeyIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyPatch.java index 1c6a452fd4..deeaf43d29 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyPatch.java @@ -30,6 +30,11 @@ public class KeyPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing KeyPatch instance. + * + * @param keyPatch the instance to initialize the Builder with + */ private Builder(KeyPatch keyPatch) { this.name = keyPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected KeyPatch() { } + protected KeyPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyReference.java index fedb67057a..a4a0248e75 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyReference.java @@ -26,6 +26,8 @@ public class KeyReference extends GenericModel { protected String id; protected String name; + protected KeyReference() { } + /** * Gets the crn. * @@ -40,7 +42,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyReferenceDeleted.java index 8c02e41f4b..ef1128a0fb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeyReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class KeyReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class KeyReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected KeyReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeysPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeysPager.java new file mode 100644 index 0000000000..72dc37dbf3 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/KeysPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * KeysPager can be used to simplify the use of the "listKeys" method. + */ +public class KeysPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListKeysOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected KeysPager() { } + + /** + * Constructs a new KeysPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listKeys" method + * @param options the ListKeysOptions instance to be used to invoke the "listKeys" method + */ + public KeysPager(Vpc client, ListKeysOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<Key> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListKeysOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + KeyCollection result = client.listKeys(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getKeys(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<Key> containing all results returned by the "listKeys" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LegacyCloudObjectStorageBucketIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LegacyCloudObjectStorageBucketIdentity.java index d918f790a7..7f727fa252 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LegacyCloudObjectStorageBucketIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LegacyCloudObjectStorageBucketIdentity.java @@ -24,8 +24,7 @@ public class LegacyCloudObjectStorageBucketIdentity extends GenericModel { protected String name; - protected LegacyCloudObjectStorageBucketIdentity() { - } + protected LegacyCloudObjectStorageBucketIdentity() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.java index 40dca88404..13118b9dfc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.java @@ -24,6 +24,11 @@ public class LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdent public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName instance. + * + * @param legacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName the instance to initialize the Builder with + */ public Builder(LegacyCloudObjectStorageBucketIdentity legacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) { this.name = legacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.name; } @@ -64,6 +69,8 @@ public Builder name(String name) { } } + protected LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName() { } + protected LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LegacyCloudObjectStorageBucketReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LegacyCloudObjectStorageBucketReference.java index f871823be1..1e46e6dfae 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LegacyCloudObjectStorageBucketReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LegacyCloudObjectStorageBucketReference.java @@ -21,6 +21,8 @@ public class LegacyCloudObjectStorageBucketReference extends GenericModel { protected String name; + protected LegacyCloudObjectStorageBucketReference() { } + /** * Gets the name. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LifecycleReason.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LifecycleReason.java new file mode 100644 index 0000000000..89e88f2dd6 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LifecycleReason.java @@ -0,0 +1,71 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * LifecycleReason. + */ +public class LifecycleReason extends GenericModel { + + /** + * A snake case string succinctly identifying the reason for this lifecycle state. + */ + public interface Code { + /** resource_suspended_by_provider. */ + String RESOURCE_SUSPENDED_BY_PROVIDER = "resource_suspended_by_provider"; + } + + protected String code; + protected String message; + @SerializedName("more_info") + protected String moreInfo; + + protected LifecycleReason() { } + + /** + * Gets the code. + * + * A snake case string succinctly identifying the reason for this lifecycle state. + * + * @return the code + */ + public String getCode() { + return code; + } + + /** + * Gets the message. + * + * An explanation of the reason for this lifecycle state. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Gets the moreInfo. + * + * Link to documentation about the reason for this lifecycle state. + * + * @return the moreInfo + */ + public String getMoreInfo() { + return moreInfo; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPoliciesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPoliciesOptions.java index b77238e38c..b393fccea8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPoliciesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPoliciesOptions.java @@ -35,6 +35,11 @@ public static class Builder { private String name; private String tag; + /** + * Instantiates a new Builder from an existing ListBackupPoliciesOptions instance. + * + * @param listBackupPoliciesOptions the instance to initialize the Builder with + */ private Builder(ListBackupPoliciesOptions listBackupPoliciesOptions) { this.start = listBackupPoliciesOptions.start; this.limit = listBackupPoliciesOptions.limit; @@ -114,6 +119,8 @@ public Builder tag(String tag) { } } + protected ListBackupPoliciesOptions() { } + protected ListBackupPoliciesOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyPlansOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyPlansOptions.java index a3f89492b8..a568aac45d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyPlansOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyPlansOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String backupPolicyId; private String name; + /** + * Instantiates a new Builder from an existing ListBackupPolicyPlansOptions instance. + * + * @param listBackupPolicyPlansOptions the instance to initialize the Builder with + */ private Builder(ListBackupPolicyPlansOptions listBackupPolicyPlansOptions) { this.backupPolicyId = listBackupPolicyPlansOptions.backupPolicyId; this.name = listBackupPolicyPlansOptions.name; @@ -81,6 +86,8 @@ public Builder name(String name) { } } + protected ListBackupPolicyPlansOptions() { } + protected ListBackupPolicyPlansOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.backupPolicyId, "backupPolicyId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerDisksOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerDisksOptions.java index e8646246c1..01b8e5d002 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerDisksOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerDisksOptions.java @@ -27,6 +27,11 @@ public class ListBareMetalServerDisksOptions extends GenericModel { public static class Builder { private String bareMetalServerId; + /** + * Instantiates a new Builder from an existing ListBareMetalServerDisksOptions instance. + * + * @param listBareMetalServerDisksOptions the instance to initialize the Builder with + */ private Builder(ListBareMetalServerDisksOptions listBareMetalServerDisksOptions) { this.bareMetalServerId = listBareMetalServerDisksOptions.bareMetalServerId; } @@ -67,6 +72,8 @@ public Builder bareMetalServerId(String bareMetalServerId) { } } + protected ListBareMetalServerDisksOptions() { } + protected ListBareMetalServerDisksOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerNetworkInterfaceFloatingIpsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerNetworkInterfaceFloatingIpsOptions.java index 1f65cedd01..5f22332e83 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerNetworkInterfaceFloatingIpsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerNetworkInterfaceFloatingIpsOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String bareMetalServerId; private String networkInterfaceId; + /** + * Instantiates a new Builder from an existing ListBareMetalServerNetworkInterfaceFloatingIpsOptions instance. + * + * @param listBareMetalServerNetworkInterfaceFloatingIpsOptions the instance to initialize the Builder with + */ private Builder(ListBareMetalServerNetworkInterfaceFloatingIpsOptions listBareMetalServerNetworkInterfaceFloatingIpsOptions) { this.bareMetalServerId = listBareMetalServerNetworkInterfaceFloatingIpsOptions.bareMetalServerId; this.networkInterfaceId = listBareMetalServerNetworkInterfaceFloatingIpsOptions.networkInterfaceId; @@ -83,6 +88,8 @@ public Builder networkInterfaceId(String networkInterfaceId) { } } + protected ListBareMetalServerNetworkInterfaceFloatingIpsOptions() { } + protected ListBareMetalServerNetworkInterfaceFloatingIpsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerNetworkInterfaceIpsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerNetworkInterfaceIpsOptions.java index 9b4e618bf5..e96cc14533 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerNetworkInterfaceIpsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerNetworkInterfaceIpsOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String bareMetalServerId; private String networkInterfaceId; + /** + * Instantiates a new Builder from an existing ListBareMetalServerNetworkInterfaceIpsOptions instance. + * + * @param listBareMetalServerNetworkInterfaceIpsOptions the instance to initialize the Builder with + */ private Builder(ListBareMetalServerNetworkInterfaceIpsOptions listBareMetalServerNetworkInterfaceIpsOptions) { this.bareMetalServerId = listBareMetalServerNetworkInterfaceIpsOptions.bareMetalServerId; this.networkInterfaceId = listBareMetalServerNetworkInterfaceIpsOptions.networkInterfaceId; @@ -83,6 +88,8 @@ public Builder networkInterfaceId(String networkInterfaceId) { } } + protected ListBareMetalServerNetworkInterfaceIpsOptions() { } + protected ListBareMetalServerNetworkInterfaceIpsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerNetworkInterfacesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerNetworkInterfacesOptions.java index d0adcaf675..0b6be85291 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerNetworkInterfacesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerNetworkInterfacesOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListBareMetalServerNetworkInterfacesOptions instance. + * + * @param listBareMetalServerNetworkInterfacesOptions the instance to initialize the Builder with + */ private Builder(ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptions) { this.bareMetalServerId = listBareMetalServerNetworkInterfacesOptions.bareMetalServerId; this.start = listBareMetalServerNetworkInterfacesOptions.start; @@ -95,6 +100,8 @@ public Builder limit(long limit) { } } + protected ListBareMetalServerNetworkInterfacesOptions() { } + protected ListBareMetalServerNetworkInterfacesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerProfilesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerProfilesOptions.java index 8d0caddba8..17194c0511 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerProfilesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServerProfilesOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListBareMetalServerProfilesOptions instance. + * + * @param listBareMetalServerProfilesOptions the instance to initialize the Builder with + */ private Builder(ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptions) { this.start = listBareMetalServerProfilesOptions.start; this.limit = listBareMetalServerProfilesOptions.limit; @@ -72,6 +77,8 @@ public Builder limit(long limit) { } } + protected ListBareMetalServerProfilesOptions() { } + protected ListBareMetalServerProfilesOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServersOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServersOptions.java index cddf7b8458..1618cf3191 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServersOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServersOptions.java @@ -45,6 +45,11 @@ public static class Builder { private String networkInterfacesSubnetCrn; private String networkInterfacesSubnetName; + /** + * Instantiates a new Builder from an existing ListBareMetalServersOptions instance. + * + * @param listBareMetalServersOptions the instance to initialize the Builder with + */ private Builder(ListBareMetalServersOptions listBareMetalServersOptions) { this.start = listBareMetalServersOptions.start; this.limit = listBareMetalServersOptions.limit; @@ -184,6 +189,8 @@ public Builder networkInterfacesSubnetName(String networkInterfacesSubnetName) { } } + protected ListBareMetalServersOptions() { } + protected ListBareMetalServersOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostDisksOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostDisksOptions.java index 054e430524..4547f06e43 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostDisksOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostDisksOptions.java @@ -27,6 +27,11 @@ public class ListDedicatedHostDisksOptions extends GenericModel { public static class Builder { private String dedicatedHostId; + /** + * Instantiates a new Builder from an existing ListDedicatedHostDisksOptions instance. + * + * @param listDedicatedHostDisksOptions the instance to initialize the Builder with + */ private Builder(ListDedicatedHostDisksOptions listDedicatedHostDisksOptions) { this.dedicatedHostId = listDedicatedHostDisksOptions.dedicatedHostId; } @@ -67,6 +72,8 @@ public Builder dedicatedHostId(String dedicatedHostId) { } } + protected ListDedicatedHostDisksOptions() { } + protected ListDedicatedHostDisksOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.dedicatedHostId, "dedicatedHostId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostGroupsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostGroupsOptions.java index 3952abc499..129a8a5044 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostGroupsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostGroupsOptions.java @@ -35,6 +35,11 @@ public static class Builder { private String zoneName; private String name; + /** + * Instantiates a new Builder from an existing ListDedicatedHostGroupsOptions instance. + * + * @param listDedicatedHostGroupsOptions the instance to initialize the Builder with + */ private Builder(ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions) { this.start = listDedicatedHostGroupsOptions.start; this.limit = listDedicatedHostGroupsOptions.limit; @@ -114,6 +119,8 @@ public Builder name(String name) { } } + protected ListDedicatedHostGroupsOptions() { } + protected ListDedicatedHostGroupsOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostProfilesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostProfilesOptions.java index 234f38cca5..1619618c61 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostProfilesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostProfilesOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListDedicatedHostProfilesOptions instance. + * + * @param listDedicatedHostProfilesOptions the instance to initialize the Builder with + */ private Builder(ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptions) { this.start = listDedicatedHostProfilesOptions.start; this.limit = listDedicatedHostProfilesOptions.limit; @@ -72,6 +77,8 @@ public Builder limit(long limit) { } } + protected ListDedicatedHostProfilesOptions() { } + protected ListDedicatedHostProfilesOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostsOptions.java index 27535662c3..203f509511 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostsOptions.java @@ -37,6 +37,11 @@ public static class Builder { private String zoneName; private String name; + /** + * Instantiates a new Builder from an existing ListDedicatedHostsOptions instance. + * + * @param listDedicatedHostsOptions the instance to initialize the Builder with + */ private Builder(ListDedicatedHostsOptions listDedicatedHostsOptions) { this.dedicatedHostGroupId = listDedicatedHostsOptions.dedicatedHostGroupId; this.start = listDedicatedHostsOptions.start; @@ -128,6 +133,8 @@ public Builder name(String name) { } } + protected ListDedicatedHostsOptions() { } + protected ListDedicatedHostsOptions(Builder builder) { dedicatedHostGroupId = builder.dedicatedHostGroupId; start = builder.start; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewayIpsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewayIpsOptions.java index b7554eb743..638d53acb3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewayIpsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewayIpsOptions.java @@ -47,6 +47,11 @@ public static class Builder { private Long limit; private String sort; + /** + * Instantiates a new Builder from an existing ListEndpointGatewayIpsOptions instance. + * + * @param listEndpointGatewayIpsOptions the instance to initialize the Builder with + */ private Builder(ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptions) { this.endpointGatewayId = listEndpointGatewayIpsOptions.endpointGatewayId; this.start = listEndpointGatewayIpsOptions.start; @@ -123,6 +128,8 @@ public Builder sort(String sort) { } } + protected ListEndpointGatewayIpsOptions() { } + protected ListEndpointGatewayIpsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.endpointGatewayId, "endpointGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewaysOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewaysOptions.java index d4b831d180..74682cf081 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewaysOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewaysOptions.java @@ -33,6 +33,11 @@ public static class Builder { private Long limit; private String resourceGroupId; + /** + * Instantiates a new Builder from an existing ListEndpointGatewaysOptions instance. + * + * @param listEndpointGatewaysOptions the instance to initialize the Builder with + */ private Builder(ListEndpointGatewaysOptions listEndpointGatewaysOptions) { this.name = listEndpointGatewaysOptions.name; this.start = listEndpointGatewaysOptions.start; @@ -100,6 +105,8 @@ public Builder resourceGroupId(String resourceGroupId) { } } + protected ListEndpointGatewaysOptions() { } + protected ListEndpointGatewaysOptions(Builder builder) { name = builder.name; start = builder.start; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFloatingIpsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFloatingIpsOptions.java index 89ae2420e7..335cac5567 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFloatingIpsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFloatingIpsOptions.java @@ -45,6 +45,11 @@ public static class Builder { private String resourceGroupId; private String sort; + /** + * Instantiates a new Builder from an existing ListFloatingIpsOptions instance. + * + * @param listFloatingIpsOptions the instance to initialize the Builder with + */ private Builder(ListFloatingIpsOptions listFloatingIpsOptions) { this.start = listFloatingIpsOptions.start; this.limit = listFloatingIpsOptions.limit; @@ -112,6 +117,8 @@ public Builder sort(String sort) { } } + protected ListFloatingIpsOptions() { } + protected ListFloatingIpsOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFlowLogCollectorsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFlowLogCollectorsOptions.java index aec49a9098..9629179547 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFlowLogCollectorsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFlowLogCollectorsOptions.java @@ -57,6 +57,11 @@ public static class Builder { private String targetId; private String targetResourceType; + /** + * Instantiates a new Builder from an existing ListFlowLogCollectorsOptions instance. + * + * @param listFlowLogCollectorsOptions the instance to initialize the Builder with + */ private Builder(ListFlowLogCollectorsOptions listFlowLogCollectorsOptions) { this.start = listFlowLogCollectorsOptions.start; this.limit = listFlowLogCollectorsOptions.limit; @@ -184,6 +189,8 @@ public Builder targetResourceType(String targetResourceType) { } } + protected ListFlowLogCollectorsOptions() { } + protected ListFlowLogCollectorsOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIkePoliciesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIkePoliciesOptions.java index 5f2816910f..a0d1e044b2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIkePoliciesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIkePoliciesOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListIkePoliciesOptions instance. + * + * @param listIkePoliciesOptions the instance to initialize the Builder with + */ private Builder(ListIkePoliciesOptions listIkePoliciesOptions) { this.start = listIkePoliciesOptions.start; this.limit = listIkePoliciesOptions.limit; @@ -72,6 +77,8 @@ public Builder limit(long limit) { } } + protected ListIkePoliciesOptions() { } + protected ListIkePoliciesOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIkePolicyConnectionsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIkePolicyConnectionsOptions.java index c26cee5652..1b2433ff22 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIkePolicyConnectionsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIkePolicyConnectionsOptions.java @@ -27,6 +27,11 @@ public class ListIkePolicyConnectionsOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing ListIkePolicyConnectionsOptions instance. + * + * @param listIkePolicyConnectionsOptions the instance to initialize the Builder with + */ private Builder(ListIkePolicyConnectionsOptions listIkePolicyConnectionsOptions) { this.id = listIkePolicyConnectionsOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected ListIkePolicyConnectionsOptions() { } + protected ListIkePolicyConnectionsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImagesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImagesOptions.java index ac0435b671..fe7c50f3fb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImagesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImagesOptions.java @@ -45,6 +45,11 @@ public static class Builder { private String name; private String visibility; + /** + * Instantiates a new Builder from an existing ListImagesOptions instance. + * + * @param listImagesOptions the instance to initialize the Builder with + */ private Builder(ListImagesOptions listImagesOptions) { this.start = listImagesOptions.start; this.limit = listImagesOptions.limit; @@ -124,6 +129,8 @@ public Builder visibility(String visibility) { } } + protected ListImagesOptions() { } + protected ListImagesOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceDisksOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceDisksOptions.java index 6075e71b74..821ae64f80 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceDisksOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceDisksOptions.java @@ -27,6 +27,11 @@ public class ListInstanceDisksOptions extends GenericModel { public static class Builder { private String instanceId; + /** + * Instantiates a new Builder from an existing ListInstanceDisksOptions instance. + * + * @param listInstanceDisksOptions the instance to initialize the Builder with + */ private Builder(ListInstanceDisksOptions listInstanceDisksOptions) { this.instanceId = listInstanceDisksOptions.instanceId; } @@ -67,6 +72,8 @@ public Builder instanceId(String instanceId) { } } + protected ListInstanceDisksOptions() { } + protected ListInstanceDisksOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupManagerActionsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupManagerActionsOptions.java index f24a7dc0c7..bd28dc7cf3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupManagerActionsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupManagerActionsOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListInstanceGroupManagerActionsOptions instance. + * + * @param listInstanceGroupManagerActionsOptions the instance to initialize the Builder with + */ private Builder(ListInstanceGroupManagerActionsOptions listInstanceGroupManagerActionsOptions) { this.instanceGroupId = listInstanceGroupManagerActionsOptions.instanceGroupId; this.instanceGroupManagerId = listInstanceGroupManagerActionsOptions.instanceGroupManagerId; @@ -111,6 +116,8 @@ public Builder limit(long limit) { } } + protected ListInstanceGroupManagerActionsOptions() { } + protected ListInstanceGroupManagerActionsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupManagerPoliciesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupManagerPoliciesOptions.java index 55041b1a61..458167b1aa 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupManagerPoliciesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupManagerPoliciesOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListInstanceGroupManagerPoliciesOptions instance. + * + * @param listInstanceGroupManagerPoliciesOptions the instance to initialize the Builder with + */ private Builder(ListInstanceGroupManagerPoliciesOptions listInstanceGroupManagerPoliciesOptions) { this.instanceGroupId = listInstanceGroupManagerPoliciesOptions.instanceGroupId; this.instanceGroupManagerId = listInstanceGroupManagerPoliciesOptions.instanceGroupManagerId; @@ -111,6 +116,8 @@ public Builder limit(long limit) { } } + protected ListInstanceGroupManagerPoliciesOptions() { } + protected ListInstanceGroupManagerPoliciesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupManagersOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupManagersOptions.java index c99adbd9c3..4e65e1e807 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupManagersOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupManagersOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListInstanceGroupManagersOptions instance. + * + * @param listInstanceGroupManagersOptions the instance to initialize the Builder with + */ private Builder(ListInstanceGroupManagersOptions listInstanceGroupManagersOptions) { this.instanceGroupId = listInstanceGroupManagersOptions.instanceGroupId; this.start = listInstanceGroupManagersOptions.start; @@ -95,6 +100,8 @@ public Builder limit(long limit) { } } + protected ListInstanceGroupManagersOptions() { } + protected ListInstanceGroupManagersOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupMembershipsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupMembershipsOptions.java index 0d855c14c3..63430b198d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupMembershipsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupMembershipsOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListInstanceGroupMembershipsOptions instance. + * + * @param listInstanceGroupMembershipsOptions the instance to initialize the Builder with + */ private Builder(ListInstanceGroupMembershipsOptions listInstanceGroupMembershipsOptions) { this.instanceGroupId = listInstanceGroupMembershipsOptions.instanceGroupId; this.start = listInstanceGroupMembershipsOptions.start; @@ -95,6 +100,8 @@ public Builder limit(long limit) { } } + protected ListInstanceGroupMembershipsOptions() { } + protected ListInstanceGroupMembershipsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupsOptions.java index 29d45e57a5..736a0c9b28 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceGroupsOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListInstanceGroupsOptions instance. + * + * @param listInstanceGroupsOptions the instance to initialize the Builder with + */ private Builder(ListInstanceGroupsOptions listInstanceGroupsOptions) { this.start = listInstanceGroupsOptions.start; this.limit = listInstanceGroupsOptions.limit; @@ -72,6 +77,8 @@ public Builder limit(long limit) { } } + protected ListInstanceGroupsOptions() { } + protected ListInstanceGroupsOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceNetworkInterfaceFloatingIpsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceNetworkInterfaceFloatingIpsOptions.java index a097a387c5..2073bd0f4c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceNetworkInterfaceFloatingIpsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceNetworkInterfaceFloatingIpsOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String instanceId; private String networkInterfaceId; + /** + * Instantiates a new Builder from an existing ListInstanceNetworkInterfaceFloatingIpsOptions instance. + * + * @param listInstanceNetworkInterfaceFloatingIpsOptions the instance to initialize the Builder with + */ private Builder(ListInstanceNetworkInterfaceFloatingIpsOptions listInstanceNetworkInterfaceFloatingIpsOptions) { this.instanceId = listInstanceNetworkInterfaceFloatingIpsOptions.instanceId; this.networkInterfaceId = listInstanceNetworkInterfaceFloatingIpsOptions.networkInterfaceId; @@ -83,6 +88,8 @@ public Builder networkInterfaceId(String networkInterfaceId) { } } + protected ListInstanceNetworkInterfaceFloatingIpsOptions() { } + protected ListInstanceNetworkInterfaceFloatingIpsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceNetworkInterfaceIpsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceNetworkInterfaceIpsOptions.java index 05a95037e4..96d3da1714 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceNetworkInterfaceIpsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceNetworkInterfaceIpsOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListInstanceNetworkInterfaceIpsOptions instance. + * + * @param listInstanceNetworkInterfaceIpsOptions the instance to initialize the Builder with + */ private Builder(ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptions) { this.instanceId = listInstanceNetworkInterfaceIpsOptions.instanceId; this.networkInterfaceId = listInstanceNetworkInterfaceIpsOptions.networkInterfaceId; @@ -111,6 +116,8 @@ public Builder limit(long limit) { } } + protected ListInstanceNetworkInterfaceIpsOptions() { } + protected ListInstanceNetworkInterfaceIpsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceNetworkInterfacesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceNetworkInterfacesOptions.java index 0fc91c41fa..cf3c0f6d42 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceNetworkInterfacesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceNetworkInterfacesOptions.java @@ -27,6 +27,11 @@ public class ListInstanceNetworkInterfacesOptions extends GenericModel { public static class Builder { private String instanceId; + /** + * Instantiates a new Builder from an existing ListInstanceNetworkInterfacesOptions instance. + * + * @param listInstanceNetworkInterfacesOptions the instance to initialize the Builder with + */ private Builder(ListInstanceNetworkInterfacesOptions listInstanceNetworkInterfacesOptions) { this.instanceId = listInstanceNetworkInterfacesOptions.instanceId; } @@ -67,6 +72,8 @@ public Builder instanceId(String instanceId) { } } + protected ListInstanceNetworkInterfacesOptions() { } + protected ListInstanceNetworkInterfacesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceProfilesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceProfilesOptions.java index c351567382..b27a56bcfa 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceProfilesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceProfilesOptions.java @@ -19,5 +19,10 @@ */ public class ListInstanceProfilesOptions extends GenericModel { + /** + * Construct a new instance of ListInstanceProfilesOptions. + */ + public ListInstanceProfilesOptions() { + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceTemplatesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceTemplatesOptions.java index b6d442b1e0..147ab5d5b3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceTemplatesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceTemplatesOptions.java @@ -19,5 +19,10 @@ */ public class ListInstanceTemplatesOptions extends GenericModel { + /** + * Construct a new instance of ListInstanceTemplatesOptions. + */ + public ListInstanceTemplatesOptions() { + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceVolumeAttachmentsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceVolumeAttachmentsOptions.java index 3b4b94459c..cca585fb1e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceVolumeAttachmentsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstanceVolumeAttachmentsOptions.java @@ -27,6 +27,11 @@ public class ListInstanceVolumeAttachmentsOptions extends GenericModel { public static class Builder { private String instanceId; + /** + * Instantiates a new Builder from an existing ListInstanceVolumeAttachmentsOptions instance. + * + * @param listInstanceVolumeAttachmentsOptions the instance to initialize the Builder with + */ private Builder(ListInstanceVolumeAttachmentsOptions listInstanceVolumeAttachmentsOptions) { this.instanceId = listInstanceVolumeAttachmentsOptions.instanceId; } @@ -67,6 +72,8 @@ public Builder instanceId(String instanceId) { } } + protected ListInstanceVolumeAttachmentsOptions() { } + protected ListInstanceVolumeAttachmentsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstancesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstancesOptions.java index 8d1c68bb52..caf192ee4b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstancesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstancesOptions.java @@ -51,6 +51,11 @@ public static class Builder { private String placementGroupCrn; private String placementGroupName; + /** + * Instantiates a new Builder from an existing ListInstancesOptions instance. + * + * @param listInstancesOptions the instance to initialize the Builder with + */ private Builder(ListInstancesOptions listInstancesOptions) { this.start = listInstancesOptions.start; this.limit = listInstancesOptions.limit; @@ -226,6 +231,8 @@ public Builder placementGroupName(String placementGroupName) { } } + protected ListInstancesOptions() { } + protected ListInstancesOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIpsecPoliciesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIpsecPoliciesOptions.java index 5b3bda5314..88f8064de3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIpsecPoliciesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIpsecPoliciesOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListIpsecPoliciesOptions instance. + * + * @param listIpsecPoliciesOptions the instance to initialize the Builder with + */ private Builder(ListIpsecPoliciesOptions listIpsecPoliciesOptions) { this.start = listIpsecPoliciesOptions.start; this.limit = listIpsecPoliciesOptions.limit; @@ -72,6 +77,8 @@ public Builder limit(long limit) { } } + protected ListIpsecPoliciesOptions() { } + protected ListIpsecPoliciesOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIpsecPolicyConnectionsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIpsecPolicyConnectionsOptions.java index 53c2657618..798665468d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIpsecPolicyConnectionsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListIpsecPolicyConnectionsOptions.java @@ -27,6 +27,11 @@ public class ListIpsecPolicyConnectionsOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing ListIpsecPolicyConnectionsOptions instance. + * + * @param listIpsecPolicyConnectionsOptions the instance to initialize the Builder with + */ private Builder(ListIpsecPolicyConnectionsOptions listIpsecPolicyConnectionsOptions) { this.id = listIpsecPolicyConnectionsOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected ListIpsecPolicyConnectionsOptions() { } + protected ListIpsecPolicyConnectionsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListKeysOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListKeysOptions.java index 2ec8fdbd42..46fd3a74d7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListKeysOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListKeysOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListKeysOptions instance. + * + * @param listKeysOptions the instance to initialize the Builder with + */ private Builder(ListKeysOptions listKeysOptions) { this.start = listKeysOptions.start; this.limit = listKeysOptions.limit; @@ -72,6 +77,8 @@ public Builder limit(long limit) { } } + protected ListKeysOptions() { } + protected ListKeysOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerListenerPoliciesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerListenerPoliciesOptions.java index e80b5eea61..2502f38274 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerListenerPoliciesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerListenerPoliciesOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String loadBalancerId; private String listenerId; + /** + * Instantiates a new Builder from an existing ListLoadBalancerListenerPoliciesOptions instance. + * + * @param listLoadBalancerListenerPoliciesOptions the instance to initialize the Builder with + */ private Builder(ListLoadBalancerListenerPoliciesOptions listLoadBalancerListenerPoliciesOptions) { this.loadBalancerId = listLoadBalancerListenerPoliciesOptions.loadBalancerId; this.listenerId = listLoadBalancerListenerPoliciesOptions.listenerId; @@ -83,6 +88,8 @@ public Builder listenerId(String listenerId) { } } + protected ListLoadBalancerListenerPoliciesOptions() { } + protected ListLoadBalancerListenerPoliciesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerListenerPolicyRulesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerListenerPolicyRulesOptions.java index 1b56cfc951..c00377573c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerListenerPolicyRulesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerListenerPolicyRulesOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String listenerId; private String policyId; + /** + * Instantiates a new Builder from an existing ListLoadBalancerListenerPolicyRulesOptions instance. + * + * @param listLoadBalancerListenerPolicyRulesOptions the instance to initialize the Builder with + */ private Builder(ListLoadBalancerListenerPolicyRulesOptions listLoadBalancerListenerPolicyRulesOptions) { this.loadBalancerId = listLoadBalancerListenerPolicyRulesOptions.loadBalancerId; this.listenerId = listLoadBalancerListenerPolicyRulesOptions.listenerId; @@ -99,6 +104,8 @@ public Builder policyId(String policyId) { } } + protected ListLoadBalancerListenerPolicyRulesOptions() { } + protected ListLoadBalancerListenerPolicyRulesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerListenersOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerListenersOptions.java index af6b709d20..63f9d51d33 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerListenersOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerListenersOptions.java @@ -27,6 +27,11 @@ public class ListLoadBalancerListenersOptions extends GenericModel { public static class Builder { private String loadBalancerId; + /** + * Instantiates a new Builder from an existing ListLoadBalancerListenersOptions instance. + * + * @param listLoadBalancerListenersOptions the instance to initialize the Builder with + */ private Builder(ListLoadBalancerListenersOptions listLoadBalancerListenersOptions) { this.loadBalancerId = listLoadBalancerListenersOptions.loadBalancerId; } @@ -67,6 +72,8 @@ public Builder loadBalancerId(String loadBalancerId) { } } + protected ListLoadBalancerListenersOptions() { } + protected ListLoadBalancerListenersOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerPoolMembersOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerPoolMembersOptions.java index 0a20b7c827..2e0986f79d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerPoolMembersOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerPoolMembersOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String loadBalancerId; private String poolId; + /** + * Instantiates a new Builder from an existing ListLoadBalancerPoolMembersOptions instance. + * + * @param listLoadBalancerPoolMembersOptions the instance to initialize the Builder with + */ private Builder(ListLoadBalancerPoolMembersOptions listLoadBalancerPoolMembersOptions) { this.loadBalancerId = listLoadBalancerPoolMembersOptions.loadBalancerId; this.poolId = listLoadBalancerPoolMembersOptions.poolId; @@ -83,6 +88,8 @@ public Builder poolId(String poolId) { } } + protected ListLoadBalancerPoolMembersOptions() { } + protected ListLoadBalancerPoolMembersOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerPoolsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerPoolsOptions.java index ee0105cf32..05903e3fb1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerPoolsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerPoolsOptions.java @@ -27,6 +27,11 @@ public class ListLoadBalancerPoolsOptions extends GenericModel { public static class Builder { private String loadBalancerId; + /** + * Instantiates a new Builder from an existing ListLoadBalancerPoolsOptions instance. + * + * @param listLoadBalancerPoolsOptions the instance to initialize the Builder with + */ private Builder(ListLoadBalancerPoolsOptions listLoadBalancerPoolsOptions) { this.loadBalancerId = listLoadBalancerPoolsOptions.loadBalancerId; } @@ -67,6 +72,8 @@ public Builder loadBalancerId(String loadBalancerId) { } } + protected ListLoadBalancerPoolsOptions() { } + protected ListLoadBalancerPoolsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerProfilesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerProfilesOptions.java index 240bc2d8a3..b5291efc47 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerProfilesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancerProfilesOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListLoadBalancerProfilesOptions instance. + * + * @param listLoadBalancerProfilesOptions the instance to initialize the Builder with + */ private Builder(ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptions) { this.start = listLoadBalancerProfilesOptions.start; this.limit = listLoadBalancerProfilesOptions.limit; @@ -72,6 +77,8 @@ public Builder limit(long limit) { } } + protected ListLoadBalancerProfilesOptions() { } + protected ListLoadBalancerProfilesOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancersOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancersOptions.java index 097aee2e1d..a2b555b217 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancersOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListLoadBalancersOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListLoadBalancersOptions instance. + * + * @param listLoadBalancersOptions the instance to initialize the Builder with + */ private Builder(ListLoadBalancersOptions listLoadBalancersOptions) { this.start = listLoadBalancersOptions.start; this.limit = listLoadBalancersOptions.limit; @@ -72,6 +77,8 @@ public Builder limit(long limit) { } } + protected ListLoadBalancersOptions() { } + protected ListLoadBalancersOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclRulesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclRulesOptions.java index 45a6590bfd..7b2e80e680 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclRulesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclRulesOptions.java @@ -43,6 +43,11 @@ public static class Builder { private Long limit; private String direction; + /** + * Instantiates a new Builder from an existing ListNetworkAclRulesOptions instance. + * + * @param listNetworkAclRulesOptions the instance to initialize the Builder with + */ private Builder(ListNetworkAclRulesOptions listNetworkAclRulesOptions) { this.networkAclId = listNetworkAclRulesOptions.networkAclId; this.start = listNetworkAclRulesOptions.start; @@ -119,6 +124,8 @@ public Builder direction(String direction) { } } + protected ListNetworkAclRulesOptions() { } + protected ListNetworkAclRulesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.networkAclId, "networkAclId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclsOptions.java index db7d9632f2..e0bfc92d46 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclsOptions.java @@ -31,6 +31,11 @@ public static class Builder { private Long limit; private String resourceGroupId; + /** + * Instantiates a new Builder from an existing ListNetworkAclsOptions instance. + * + * @param listNetworkAclsOptions the instance to initialize the Builder with + */ private Builder(ListNetworkAclsOptions listNetworkAclsOptions) { this.start = listNetworkAclsOptions.start; this.limit = listNetworkAclsOptions.limit; @@ -86,6 +91,8 @@ public Builder resourceGroupId(String resourceGroupId) { } } + protected ListNetworkAclsOptions() { } + protected ListNetworkAclsOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListOperatingSystemsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListOperatingSystemsOptions.java index e575fec579..d6b202f896 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListOperatingSystemsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListOperatingSystemsOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListOperatingSystemsOptions instance. + * + * @param listOperatingSystemsOptions the instance to initialize the Builder with + */ private Builder(ListOperatingSystemsOptions listOperatingSystemsOptions) { this.start = listOperatingSystemsOptions.start; this.limit = listOperatingSystemsOptions.limit; @@ -72,6 +77,8 @@ public Builder limit(long limit) { } } + protected ListOperatingSystemsOptions() { } + protected ListOperatingSystemsOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListPlacementGroupsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListPlacementGroupsOptions.java index 7fea8cc38f..2e014c0edb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListPlacementGroupsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListPlacementGroupsOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListPlacementGroupsOptions instance. + * + * @param listPlacementGroupsOptions the instance to initialize the Builder with + */ private Builder(ListPlacementGroupsOptions listPlacementGroupsOptions) { this.start = listPlacementGroupsOptions.start; this.limit = listPlacementGroupsOptions.limit; @@ -72,6 +77,8 @@ public Builder limit(long limit) { } } + protected ListPlacementGroupsOptions() { } + protected ListPlacementGroupsOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListPublicGatewaysOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListPublicGatewaysOptions.java index 29da7a306d..8da7e22821 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListPublicGatewaysOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListPublicGatewaysOptions.java @@ -31,6 +31,11 @@ public static class Builder { private Long limit; private String resourceGroupId; + /** + * Instantiates a new Builder from an existing ListPublicGatewaysOptions instance. + * + * @param listPublicGatewaysOptions the instance to initialize the Builder with + */ private Builder(ListPublicGatewaysOptions listPublicGatewaysOptions) { this.start = listPublicGatewaysOptions.start; this.limit = listPublicGatewaysOptions.limit; @@ -86,6 +91,8 @@ public Builder resourceGroupId(String resourceGroupId) { } } + protected ListPublicGatewaysOptions() { } + protected ListPublicGatewaysOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListRegionZonesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListRegionZonesOptions.java index a8b5274702..f775e06b31 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListRegionZonesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListRegionZonesOptions.java @@ -27,6 +27,11 @@ public class ListRegionZonesOptions extends GenericModel { public static class Builder { private String regionName; + /** + * Instantiates a new Builder from an existing ListRegionZonesOptions instance. + * + * @param listRegionZonesOptions the instance to initialize the Builder with + */ private Builder(ListRegionZonesOptions listRegionZonesOptions) { this.regionName = listRegionZonesOptions.regionName; } @@ -67,6 +72,8 @@ public Builder regionName(String regionName) { } } + protected ListRegionZonesOptions() { } + protected ListRegionZonesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.regionName, "regionName cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListRegionsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListRegionsOptions.java index 2eaa642c46..1742b0af38 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListRegionsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListRegionsOptions.java @@ -19,5 +19,10 @@ */ public class ListRegionsOptions extends GenericModel { + /** + * Construct a new instance of ListRegionsOptions. + */ + public ListRegionsOptions() { + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupRulesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupRulesOptions.java index 8642dfdec0..28021e0035 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupRulesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupRulesOptions.java @@ -27,6 +27,11 @@ public class ListSecurityGroupRulesOptions extends GenericModel { public static class Builder { private String securityGroupId; + /** + * Instantiates a new Builder from an existing ListSecurityGroupRulesOptions instance. + * + * @param listSecurityGroupRulesOptions the instance to initialize the Builder with + */ private Builder(ListSecurityGroupRulesOptions listSecurityGroupRulesOptions) { this.securityGroupId = listSecurityGroupRulesOptions.securityGroupId; } @@ -67,6 +72,8 @@ public Builder securityGroupId(String securityGroupId) { } } + protected ListSecurityGroupRulesOptions() { } + protected ListSecurityGroupRulesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.securityGroupId, "securityGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupTargetsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupTargetsOptions.java index 224dcd76a4..3a0b1abd7d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupTargetsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupTargetsOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListSecurityGroupTargetsOptions instance. + * + * @param listSecurityGroupTargetsOptions the instance to initialize the Builder with + */ private Builder(ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptions) { this.securityGroupId = listSecurityGroupTargetsOptions.securityGroupId; this.start = listSecurityGroupTargetsOptions.start; @@ -95,6 +100,8 @@ public Builder limit(long limit) { } } + protected ListSecurityGroupTargetsOptions() { } + protected ListSecurityGroupTargetsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.securityGroupId, "securityGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupsOptions.java index 26781eff0a..0ec6ce6adb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupsOptions.java @@ -37,6 +37,11 @@ public static class Builder { private String vpcCrn; private String vpcName; + /** + * Instantiates a new Builder from an existing ListSecurityGroupsOptions instance. + * + * @param listSecurityGroupsOptions the instance to initialize the Builder with + */ private Builder(ListSecurityGroupsOptions listSecurityGroupsOptions) { this.start = listSecurityGroupsOptions.start; this.limit = listSecurityGroupsOptions.limit; @@ -128,6 +133,8 @@ public Builder vpcName(String vpcName) { } } + protected ListSecurityGroupsOptions() { } + protected ListSecurityGroupsOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotClonesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotClonesOptions.java index 236639f287..390d91a73a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotClonesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotClonesOptions.java @@ -27,6 +27,11 @@ public class ListSnapshotClonesOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing ListSnapshotClonesOptions instance. + * + * @param listSnapshotClonesOptions the instance to initialize the Builder with + */ private Builder(ListSnapshotClonesOptions listSnapshotClonesOptions) { this.id = listSnapshotClonesOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected ListSnapshotClonesOptions() { } + protected ListSnapshotClonesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotsOptions.java index 12b11cd40e..1ce1832de3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotsOptions.java @@ -59,6 +59,11 @@ public static class Builder { private String sort; private String backupPolicyPlanId; + /** + * Instantiates a new Builder from an existing ListSnapshotsOptions instance. + * + * @param listSnapshotsOptions the instance to initialize the Builder with + */ private Builder(ListSnapshotsOptions listSnapshotsOptions) { this.start = listSnapshotsOptions.start; this.limit = listSnapshotsOptions.limit; @@ -210,6 +215,8 @@ public Builder backupPolicyPlanId(String backupPolicyPlanId) { } } + protected ListSnapshotsOptions() { } + protected ListSnapshotsOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetReservedIpsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetReservedIpsOptions.java index f56e3acf8c..d109ba0981 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetReservedIpsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetReservedIpsOptions.java @@ -47,6 +47,11 @@ public static class Builder { private Long limit; private String sort; + /** + * Instantiates a new Builder from an existing ListSubnetReservedIpsOptions instance. + * + * @param listSubnetReservedIpsOptions the instance to initialize the Builder with + */ private Builder(ListSubnetReservedIpsOptions listSubnetReservedIpsOptions) { this.subnetId = listSubnetReservedIpsOptions.subnetId; this.start = listSubnetReservedIpsOptions.start; @@ -123,6 +128,8 @@ public Builder sort(String sort) { } } + protected ListSubnetReservedIpsOptions() { } + protected ListSubnetReservedIpsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.subnetId, "subnetId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetsOptions.java index f96f388013..d6ee7228eb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetsOptions.java @@ -35,6 +35,11 @@ public static class Builder { private String routingTableId; private String routingTableName; + /** + * Instantiates a new Builder from an existing ListSubnetsOptions instance. + * + * @param listSubnetsOptions the instance to initialize the Builder with + */ private Builder(ListSubnetsOptions listSubnetsOptions) { this.start = listSubnetsOptions.start; this.limit = listSubnetsOptions.limit; @@ -114,6 +119,8 @@ public Builder routingTableName(String routingTableName) { } } + protected ListSubnetsOptions() { } + protected ListSubnetsOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumeProfilesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumeProfilesOptions.java index 924ebfbaad..9b1da3d553 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumeProfilesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumeProfilesOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListVolumeProfilesOptions instance. + * + * @param listVolumeProfilesOptions the instance to initialize the Builder with + */ private Builder(ListVolumeProfilesOptions listVolumeProfilesOptions) { this.start = listVolumeProfilesOptions.start; this.limit = listVolumeProfilesOptions.limit; @@ -72,6 +77,8 @@ public Builder limit(long limit) { } } + protected ListVolumeProfilesOptions() { } + protected ListVolumeProfilesOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumesOptions.java index bdf2459177..c420c1ef8b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumesOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String name; private String zoneName; + /** + * Instantiates a new Builder from an existing ListVolumesOptions instance. + * + * @param listVolumesOptions the instance to initialize the Builder with + */ private Builder(ListVolumesOptions listVolumesOptions) { this.start = listVolumesOptions.start; this.limit = listVolumesOptions.limit; @@ -100,6 +105,8 @@ public Builder zoneName(String zoneName) { } } + protected ListVolumesOptions() { } + protected ListVolumesOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcAddressPrefixesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcAddressPrefixesOptions.java index 4074fce214..ba18280b04 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcAddressPrefixesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcAddressPrefixesOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListVpcAddressPrefixesOptions instance. + * + * @param listVpcAddressPrefixesOptions the instance to initialize the Builder with + */ private Builder(ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptions) { this.vpcId = listVpcAddressPrefixesOptions.vpcId; this.start = listVpcAddressPrefixesOptions.start; @@ -95,6 +100,8 @@ public Builder limit(long limit) { } } + protected ListVpcAddressPrefixesOptions() { } + protected ListVpcAddressPrefixesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutesOptions.java index 9e8311e87d..36d0bd8834 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutesOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListVpcRoutesOptions instance. + * + * @param listVpcRoutesOptions the instance to initialize the Builder with + */ private Builder(ListVpcRoutesOptions listVpcRoutesOptions) { this.vpcId = listVpcRoutesOptions.vpcId; this.zoneName = listVpcRoutesOptions.zoneName; @@ -109,6 +114,8 @@ public Builder limit(long limit) { } } + protected ListVpcRoutesOptions() { } + protected ListVpcRoutesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutingTableRoutesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutingTableRoutesOptions.java index acb4669ad5..f79cee6c68 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutingTableRoutesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutingTableRoutesOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String start; private Long limit; + /** + * Instantiates a new Builder from an existing ListVpcRoutingTableRoutesOptions instance. + * + * @param listVpcRoutingTableRoutesOptions the instance to initialize the Builder with + */ private Builder(ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptions) { this.vpcId = listVpcRoutingTableRoutesOptions.vpcId; this.routingTableId = listVpcRoutingTableRoutesOptions.routingTableId; @@ -111,6 +116,8 @@ public Builder limit(long limit) { } } + protected ListVpcRoutingTableRoutesOptions() { } + protected ListVpcRoutingTableRoutesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutingTablesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutingTablesOptions.java index 5ab05ed09a..54bb4c8174 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutingTablesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutingTablesOptions.java @@ -33,6 +33,11 @@ public static class Builder { private Long limit; private Boolean isDefault; + /** + * Instantiates a new Builder from an existing ListVpcRoutingTablesOptions instance. + * + * @param listVpcRoutingTablesOptions the instance to initialize the Builder with + */ private Builder(ListVpcRoutingTablesOptions listVpcRoutingTablesOptions) { this.vpcId = listVpcRoutingTablesOptions.vpcId; this.start = listVpcRoutingTablesOptions.start; @@ -109,6 +114,8 @@ public Builder isDefault(Boolean isDefault) { } } + protected ListVpcRoutingTablesOptions() { } + protected ListVpcRoutingTablesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcsOptions.java index ddf378cfc5..33b6e11b8d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcsOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String resourceGroupId; private Boolean classicAccess; + /** + * Instantiates a new Builder from an existing ListVpcsOptions instance. + * + * @param listVpcsOptions the instance to initialize the Builder with + */ private Builder(ListVpcsOptions listVpcsOptions) { this.start = listVpcsOptions.start; this.limit = listVpcsOptions.limit; @@ -100,6 +105,8 @@ public Builder classicAccess(Boolean classicAccess) { } } + protected ListVpcsOptions() { } + protected ListVpcsOptions(Builder builder) { start = builder.start; limit = builder.limit; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionLocalCidrsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionLocalCidrsOptions.java index e43737619b..aaa6e70003 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionLocalCidrsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionLocalCidrsOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpnGatewayId; private String id; + /** + * Instantiates a new Builder from an existing ListVpnGatewayConnectionLocalCidrsOptions instance. + * + * @param listVpnGatewayConnectionLocalCidrsOptions the instance to initialize the Builder with + */ private Builder(ListVpnGatewayConnectionLocalCidrsOptions listVpnGatewayConnectionLocalCidrsOptions) { this.vpnGatewayId = listVpnGatewayConnectionLocalCidrsOptions.vpnGatewayId; this.id = listVpnGatewayConnectionLocalCidrsOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected ListVpnGatewayConnectionLocalCidrsOptions() { } + protected ListVpnGatewayConnectionLocalCidrsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, "vpnGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionPeerCidrsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionPeerCidrsOptions.java index cd8fa715dd..bc034de3c3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionPeerCidrsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionPeerCidrsOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpnGatewayId; private String id; + /** + * Instantiates a new Builder from an existing ListVpnGatewayConnectionPeerCidrsOptions instance. + * + * @param listVpnGatewayConnectionPeerCidrsOptions the instance to initialize the Builder with + */ private Builder(ListVpnGatewayConnectionPeerCidrsOptions listVpnGatewayConnectionPeerCidrsOptions) { this.vpnGatewayId = listVpnGatewayConnectionPeerCidrsOptions.vpnGatewayId; this.id = listVpnGatewayConnectionPeerCidrsOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected ListVpnGatewayConnectionPeerCidrsOptions() { } + protected ListVpnGatewayConnectionPeerCidrsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, "vpnGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionsOptions.java index 710c46e274..a7d2d3e252 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionsOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String vpnGatewayId; private String status; + /** + * Instantiates a new Builder from an existing ListVpnGatewayConnectionsOptions instance. + * + * @param listVpnGatewayConnectionsOptions the instance to initialize the Builder with + */ private Builder(ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptions) { this.vpnGatewayId = listVpnGatewayConnectionsOptions.vpnGatewayId; this.status = listVpnGatewayConnectionsOptions.status; @@ -81,6 +86,8 @@ public Builder status(String status) { } } + protected ListVpnGatewayConnectionsOptions() { } + protected ListVpnGatewayConnectionsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, "vpnGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewaysOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewaysOptions.java index 816a176b74..00b98e8527 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewaysOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewaysOptions.java @@ -19,6 +19,18 @@ */ public class ListVpnGatewaysOptions extends GenericModel { + /** + * Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + * to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + * in descending order, and the value `name` sorts it by the `name` property in ascending order. + */ + public interface Sort { + /** created_at. */ + String CREATED_AT = "created_at"; + /** name. */ + String NAME = "name"; + } + /** * Filters the collection to VPN gateways with the specified mode. */ @@ -32,6 +44,7 @@ public interface Mode { protected String start; protected Long limit; protected String resourceGroupId; + protected String sort; protected String mode; /** @@ -41,12 +54,19 @@ public static class Builder { private String start; private Long limit; private String resourceGroupId; + private String sort; private String mode; + /** + * Instantiates a new Builder from an existing ListVpnGatewaysOptions instance. + * + * @param listVpnGatewaysOptions the instance to initialize the Builder with + */ private Builder(ListVpnGatewaysOptions listVpnGatewaysOptions) { this.start = listVpnGatewaysOptions.start; this.limit = listVpnGatewaysOptions.limit; this.resourceGroupId = listVpnGatewaysOptions.resourceGroupId; + this.sort = listVpnGatewaysOptions.sort; this.mode = listVpnGatewaysOptions.mode; } @@ -98,6 +118,17 @@ public Builder resourceGroupId(String resourceGroupId) { return this; } + /** + * Set the sort. + * + * @param sort the sort + * @return the ListVpnGatewaysOptions builder + */ + public Builder sort(String sort) { + this.sort = sort; + return this; + } + /** * Set the mode. * @@ -110,10 +141,13 @@ public Builder mode(String mode) { } } + protected ListVpnGatewaysOptions() { } + protected ListVpnGatewaysOptions(Builder builder) { start = builder.start; limit = builder.limit; resourceGroupId = builder.resourceGroupId; + sort = builder.sort; mode = builder.mode; } @@ -159,6 +193,19 @@ public String resourceGroupId() { return resourceGroupId; } + /** + * Gets the sort. + * + * Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + * to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + * in descending order, and the value `name` sorts it by the `name` property in ascending order. + * + * @return the sort + */ + public String sort() { + return sort; + } + /** * Gets the mode. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServerClientsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServerClientsOptions.java index 4d4c804352..9ba79807fe 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServerClientsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServerClientsOptions.java @@ -43,6 +43,11 @@ public static class Builder { private Long limit; private String sort; + /** + * Instantiates a new Builder from an existing ListVpnServerClientsOptions instance. + * + * @param listVpnServerClientsOptions the instance to initialize the Builder with + */ private Builder(ListVpnServerClientsOptions listVpnServerClientsOptions) { this.vpnServerId = listVpnServerClientsOptions.vpnServerId; this.start = listVpnServerClientsOptions.start; @@ -119,6 +124,8 @@ public Builder sort(String sort) { } } + protected ListVpnServerClientsOptions() { } + protected ListVpnServerClientsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnServerId, "vpnServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServerRoutesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServerRoutesOptions.java index bfff49edd3..2cb3a48d83 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServerRoutesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServerRoutesOptions.java @@ -45,6 +45,11 @@ public static class Builder { private Long limit; private String sort; + /** + * Instantiates a new Builder from an existing ListVpnServerRoutesOptions instance. + * + * @param listVpnServerRoutesOptions the instance to initialize the Builder with + */ private Builder(ListVpnServerRoutesOptions listVpnServerRoutesOptions) { this.vpnServerId = listVpnServerRoutesOptions.vpnServerId; this.start = listVpnServerRoutesOptions.start; @@ -121,6 +126,8 @@ public Builder sort(String sort) { } } + protected ListVpnServerRoutesOptions() { } + protected ListVpnServerRoutesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnServerId, "vpnServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServersOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServersOptions.java index e0232e1e76..e0bc90c01f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServersOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServersOptions.java @@ -47,6 +47,11 @@ public static class Builder { private String resourceGroupId; private String sort; + /** + * Instantiates a new Builder from an existing ListVpnServersOptions instance. + * + * @param listVpnServersOptions the instance to initialize the Builder with + */ private Builder(ListVpnServersOptions listVpnServersOptions) { this.name = listVpnServersOptions.name; this.start = listVpnServersOptions.start; @@ -126,6 +131,8 @@ public Builder sort(String sort) { } } + protected ListVpnServersOptions() { } + protected ListVpnServersOptions(Builder builder) { name = builder.name; start = builder.start; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancer.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancer.java index 5ef39167e6..9b5e0da6bf 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancer.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancer.java @@ -34,7 +34,22 @@ public interface OperatingStatus { } /** - * The provisioning status of this load balancer. + * The provisioning status of this load balancer: + * + * - `active`: The load balancer is running. + * - `create_pending`: The load balancer is being created. + * - `delete_pending`: The load balancer is being deleted. + * - `maintenance_pending`: The load balancer is unavailable due to an internal + * error (contact IBM support). + * - `migrate_pending`: The load balancer is migrating to the requested configuration. + * Performance may be degraded. + * - `update_pending`: The load balancer is being updated + * to the requested configuration. + * + * The enumerated values for this property are expected to expand in the future. When + * processing this property, check for and log unknown values. Optionally halt + * processing and surface the error, or bypass the load balancer on which the + * unexpected property value was encountered. */ public interface ProvisioningStatus { /** active. */ @@ -47,6 +62,8 @@ public interface ProvisioningStatus { String FAILED = "failed"; /** maintenance_pending. */ String MAINTENANCE_PENDING = "maintenance_pending"; + /** migrate_pending. */ + String MIGRATE_PENDING = "migrate_pending"; /** update_pending. */ String UPDATE_PENDING = "update_pending"; } @@ -94,6 +111,8 @@ public interface ResourceType { @SerializedName("udp_supported") protected Boolean udpSupported; + protected LoadBalancer() { } + /** * Gets the createdAt. * @@ -240,7 +259,22 @@ public LoadBalancerProfileReference getProfile() { /** * Gets the provisioningStatus. * - * The provisioning status of this load balancer. + * The provisioning status of this load balancer: + * + * - `active`: The load balancer is running. + * - `create_pending`: The load balancer is being created. + * - `delete_pending`: The load balancer is being deleted. + * - `maintenance_pending`: The load balancer is unavailable due to an internal + * error (contact IBM support). + * - `migrate_pending`: The load balancer is migrating to the requested configuration. + * Performance may be degraded. + * - `update_pending`: The load balancer is being updated + * to the requested configuration. + * + * The enumerated values for this property are expected to expand in the future. When + * processing this property, check for and log unknown values. Optionally halt + * processing and surface the error, or bypass the load balancer on which the + * unexpected property value was encountered. * * @return the provisioningStatus */ @@ -323,7 +357,10 @@ public Boolean isSecurityGroupsSupported() { /** * Gets the subnets. * - * The subnets this load balancer is part of. + * The subnets this load balancer is provisioned in. The load balancer's availability depends on the availability of + * the zones that the subnets reside in. + * + * All subnets will be in the same VPC. * * @return the subnets */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollection.java index d969746081..ea470de8b1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollection.java @@ -30,6 +30,8 @@ public class LoadBalancerCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected LoadBalancerCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollectionFirst.java index eefd831f9f..3b5a9eb3a3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollectionFirst.java @@ -21,6 +21,8 @@ public class LoadBalancerCollectionFirst extends GenericModel { protected String href; + protected LoadBalancerCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollectionNext.java index 57516d1a0f..ed05678492 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollectionNext.java @@ -21,6 +21,8 @@ public class LoadBalancerCollectionNext extends GenericModel { protected String href; + protected LoadBalancerCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentity.java index f05e187666..f183d496a9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentity.java @@ -28,8 +28,7 @@ public class LoadBalancerIdentity extends GenericModel { protected String crn; protected String href; - protected LoadBalancerIdentity() { - } + protected LoadBalancerIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentityByCRN.java index fe00402e6f..bfa08cf08d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentityByCRN.java @@ -24,6 +24,11 @@ public class LoadBalancerIdentityByCRN extends LoadBalancerIdentity { public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing LoadBalancerIdentityByCRN instance. + * + * @param loadBalancerIdentityByCrn the instance to initialize the Builder with + */ public Builder(LoadBalancerIdentity loadBalancerIdentityByCrn) { this.crn = loadBalancerIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected LoadBalancerIdentityByCRN() { } + protected LoadBalancerIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentityByHref.java index c2710446c2..eaa304a8ab 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentityByHref.java @@ -24,6 +24,11 @@ public class LoadBalancerIdentityByHref extends LoadBalancerIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing LoadBalancerIdentityByHref instance. + * + * @param loadBalancerIdentityByHref the instance to initialize the Builder with + */ public Builder(LoadBalancerIdentity loadBalancerIdentityByHref) { this.href = loadBalancerIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected LoadBalancerIdentityByHref() { } + protected LoadBalancerIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentityById.java index c991e8aef4..57dc22006b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerIdentityById.java @@ -24,6 +24,11 @@ public class LoadBalancerIdentityById extends LoadBalancerIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing LoadBalancerIdentityById instance. + * + * @param loadBalancerIdentityById the instance to initialize the Builder with + */ public Builder(LoadBalancerIdentity loadBalancerIdentityById) { this.id = loadBalancerIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected LoadBalancerIdentityById() { } + protected LoadBalancerIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListener.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListener.java index 405758dc63..1f10be98f8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListener.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListener.java @@ -24,9 +24,7 @@ public class LoadBalancerListener extends GenericModel { /** - * The listener protocol. Load balancers in the `network` family support `tcp` and - * `udp` (if `udp_supported` is `true`). Load balancers in the `application` family support `tcp`, `http`, and - * `https`. Each listener in the load balancer must have a unique `port` and `protocol` combination. + * The listener protocol. * * The enumerated values for this property are expected to expand in the future. When processing this property, check * for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the @@ -44,7 +42,11 @@ public interface Protocol { } /** - * The provisioning status of this listener. + * The provisioning status of this listener + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the + * unexpected property value was encountered. */ public interface ProvisioningStatus { /** active. */ @@ -55,8 +57,6 @@ public interface ProvisioningStatus { String DELETE_PENDING = "delete_pending"; /** failed. */ String FAILED = "failed"; - /** maintenance_pending. */ - String MAINTENANCE_PENDING = "maintenance_pending"; /** update_pending. */ String UPDATE_PENDING = "update_pending"; } @@ -85,6 +85,8 @@ public interface ProvisioningStatus { @SerializedName("provisioning_status") protected String provisioningStatus; + protected LoadBalancerListener() { } + /** * Gets the acceptProxyProtocol. * @@ -104,8 +106,9 @@ public Boolean isAcceptProxyProtocol() { /** * Gets the certificateInstance. * - * The certificate instance used for SSL termination. It is applicable only to `https` - * protocol. + * The certificate instance used for SSL termination. + * + * If absent, this listener is not using a certificate instance. * * @return the certificateInstance */ @@ -160,7 +163,7 @@ public String getHref() { /** * Gets the httpsRedirect. * - * If specified, the target listener that requests are redirected to. + * If present, the target listener that requests are redirected to. * * @return the httpsRedirect */ @@ -230,9 +233,7 @@ public Long getPortMin() { /** * Gets the protocol. * - * The listener protocol. Load balancers in the `network` family support `tcp` and - * `udp` (if `udp_supported` is `true`). Load balancers in the `application` family support `tcp`, `http`, and - * `https`. Each listener in the load balancer must have a unique `port` and `protocol` combination. + * The listener protocol. * * The enumerated values for this property are expected to expand in the future. When processing this property, check * for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the @@ -247,7 +248,11 @@ public String getProtocol() { /** * Gets the provisioningStatus. * - * The provisioning status of this listener. + * The provisioning status of this listener + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the + * unexpected property value was encountered. * * @return the provisioningStatus */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerCollection.java index 5826f8383e..929aaaf2c0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerCollection.java @@ -23,6 +23,8 @@ public class LoadBalancerListenerCollection extends GenericModel { protected List listeners; + protected LoadBalancerListenerCollection() { } + /** * Gets the listeners. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerHTTPSRedirect.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerHTTPSRedirect.java index 0871530842..624f17cefe 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerHTTPSRedirect.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerHTTPSRedirect.java @@ -25,6 +25,8 @@ public class LoadBalancerListenerHTTPSRedirect extends GenericModel { protected LoadBalancerListenerReference listener; protected String uri; + protected LoadBalancerListenerHTTPSRedirect() { } + /** * Gets the httpStatusCode. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerHTTPSRedirectPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerHTTPSRedirectPatch.java index bafcb360c7..a2e3572213 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerHTTPSRedirectPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerHTTPSRedirectPatch.java @@ -33,6 +33,11 @@ public static class Builder { private LoadBalancerListenerIdentity listener; private String uri; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerHTTPSRedirectPatch instance. + * + * @param loadBalancerListenerHttpsRedirectPatch the instance to initialize the Builder with + */ private Builder(LoadBalancerListenerHTTPSRedirectPatch loadBalancerListenerHttpsRedirectPatch) { this.httpStatusCode = loadBalancerListenerHttpsRedirectPatch.httpStatusCode; this.listener = loadBalancerListenerHttpsRedirectPatch.listener; @@ -88,6 +93,8 @@ public Builder uri(String uri) { } } + protected LoadBalancerListenerHTTPSRedirectPatch() { } + protected LoadBalancerListenerHTTPSRedirectPatch(Builder builder) { httpStatusCode = builder.httpStatusCode; listener = builder.listener; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerHTTPSRedirectPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerHTTPSRedirectPrototype.java index 2ff0119dc8..83df6e624e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerHTTPSRedirectPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerHTTPSRedirectPrototype.java @@ -33,6 +33,11 @@ public static class Builder { private LoadBalancerListenerIdentity listener; private String uri; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerHTTPSRedirectPrototype instance. + * + * @param loadBalancerListenerHttpsRedirectPrototype the instance to initialize the Builder with + */ private Builder(LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototype) { this.httpStatusCode = loadBalancerListenerHttpsRedirectPrototype.httpStatusCode; this.listener = loadBalancerListenerHttpsRedirectPrototype.listener; @@ -99,6 +104,8 @@ public Builder uri(String uri) { } } + protected LoadBalancerListenerHTTPSRedirectPrototype() { } + protected LoadBalancerListenerHTTPSRedirectPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.httpStatusCode, "httpStatusCode cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerIdentity.java index 9d43986412..5ee992f388 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerIdentity.java @@ -26,8 +26,7 @@ public class LoadBalancerListenerIdentity extends GenericModel { protected String id; protected String href; - protected LoadBalancerListenerIdentity() { - } + protected LoadBalancerListenerIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerIdentityByHref.java index be16b0017d..4c2483dc97 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerIdentityByHref.java @@ -24,6 +24,11 @@ public class LoadBalancerListenerIdentityByHref extends LoadBalancerListenerIden public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerIdentityByHref instance. + * + * @param loadBalancerListenerIdentityByHref the instance to initialize the Builder with + */ public Builder(LoadBalancerListenerIdentity loadBalancerListenerIdentityByHref) { this.href = loadBalancerListenerIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected LoadBalancerListenerIdentityByHref() { } + protected LoadBalancerListenerIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerIdentityById.java index 019c702257..21cc042858 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerIdentityById.java @@ -24,6 +24,11 @@ public class LoadBalancerListenerIdentityById extends LoadBalancerListenerIdenti public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerIdentityById instance. + * + * @param loadBalancerListenerIdentityById the instance to initialize the Builder with + */ public Builder(LoadBalancerListenerIdentity loadBalancerListenerIdentityById) { this.id = loadBalancerListenerIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected LoadBalancerListenerIdentityById() { } + protected LoadBalancerListenerIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPatch.java index eb3d0abceb..e963908580 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPatch.java @@ -25,12 +25,15 @@ public class LoadBalancerListenerPatch extends GenericModel { /** * The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. + * + * Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in + * the `application` family support `tcp`, `http` and + * `https`. + * * Additional restrictions: - * - If this load balancer is in the `network` family, the protocol must be `tcp` - * or `udp` (if `udp_supported` is `true`) , and it cannot be changed while - * `default_pool` is set. + * - If `default_pool` is set, the protocol cannot be changed. * - If `https_redirect` is set, the protocol must be `http`. - * - If this listener is a listener's `https_redirect` target, the protocol must be + * - If another listener's `https_redirect` targets this listener, the protocol must be * `https`. */ public interface Protocol { @@ -75,6 +78,11 @@ public static class Builder { private Long portMin; private String protocol; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPatch instance. + * + * @param loadBalancerListenerPatch the instance to initialize the Builder with + */ private Builder(LoadBalancerListenerPatch loadBalancerListenerPatch) { this.acceptProxyProtocol = loadBalancerListenerPatch.acceptProxyProtocol; this.certificateInstance = loadBalancerListenerPatch.certificateInstance; @@ -202,6 +210,8 @@ public Builder protocol(String protocol) { } } + protected LoadBalancerListenerPatch() { } + protected LoadBalancerListenerPatch(Builder builder) { acceptProxyProtocol = builder.acceptProxyProtocol; certificateInstance = builder.certificateInstance; @@ -242,8 +252,8 @@ public Boolean acceptProxyProtocol() { /** * Gets the certificateInstance. * - * The certificate instance used for SSL termination. It is applicable only to `https` - * protocol. + * The certificate instance to use for SSL termination. The listener must have a + * `protocol` of `https`. * * @return the certificateInstance */ @@ -348,12 +358,15 @@ public Long portMin() { * Gets the protocol. * * The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. + * + * Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in + * the `application` family support `tcp`, `http` and + * `https`. + * * Additional restrictions: - * - If this load balancer is in the `network` family, the protocol must be `tcp` - * or `udp` (if `udp_supported` is `true`) , and it cannot be changed while - * `default_pool` is set. + * - If `default_pool` is set, the protocol cannot be changed. * - If `https_redirect` is set, the protocol must be `http`. - * - If this listener is a listener's `https_redirect` target, the protocol must be + * - If another listener's `https_redirect` targets this listener, the protocol must be * `https`. * * @return the protocol diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicy.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicy.java index a1eace96be..2d17389a80 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicy.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicy.java @@ -42,7 +42,11 @@ public interface Action { } /** - * The provisioning status of this policy. + * The provisioning status of this policy + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the + * unexpected property value was encountered. */ public interface ProvisioningStatus { /** active. */ @@ -53,8 +57,6 @@ public interface ProvisioningStatus { String DELETE_PENDING = "delete_pending"; /** failed. */ String FAILED = "failed"; - /** maintenance_pending. */ - String MAINTENANCE_PENDING = "maintenance_pending"; /** update_pending. */ String UPDATE_PENDING = "update_pending"; } @@ -71,6 +73,8 @@ public interface ProvisioningStatus { protected List rules; protected LoadBalancerListenerPolicyTarget target; + protected LoadBalancerListenerPolicy() { } + /** * Gets the action. * @@ -144,7 +148,11 @@ public Long getPriority() { /** * Gets the provisioningStatus. * - * The provisioning status of this policy. + * The provisioning status of this policy + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the + * unexpected property value was encountered. * * @return the provisioningStatus */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyCollection.java index 7add18c20a..8acd96a3dd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyCollection.java @@ -23,6 +23,8 @@ public class LoadBalancerListenerPolicyCollection extends GenericModel { protected List policies; + protected LoadBalancerListenerPolicyCollection() { } + /** * Gets the policies. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyPatch.java index 878f3b33e5..848e63ff07 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyPatch.java @@ -34,6 +34,11 @@ public static class Builder { private Long priority; private LoadBalancerListenerPolicyTargetPatch target; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPolicyPatch instance. + * + * @param loadBalancerListenerPolicyPatch the instance to initialize the Builder with + */ private Builder(LoadBalancerListenerPolicyPatch loadBalancerListenerPolicyPatch) { this.name = loadBalancerListenerPolicyPatch.name; this.priority = loadBalancerListenerPolicyPatch.priority; @@ -89,6 +94,8 @@ public Builder target(LoadBalancerListenerPolicyTargetPatch target) { } } + protected LoadBalancerListenerPolicyPatch() { } + protected LoadBalancerListenerPolicyPatch(Builder builder) { name = builder.name; priority = builder.priority; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyPrototype.java index a3e394d766..75f7437049 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyPrototype.java @@ -56,6 +56,11 @@ public static class Builder { private List rules; private LoadBalancerListenerPolicyTargetPrototype target; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPolicyPrototype instance. + * + * @param loadBalancerListenerPolicyPrototype the instance to initialize the Builder with + */ private Builder(LoadBalancerListenerPolicyPrototype loadBalancerListenerPolicyPrototype) { this.action = loadBalancerListenerPolicyPrototype.action; this.name = loadBalancerListenerPolicyPrototype.name; @@ -163,6 +168,8 @@ public Builder target(LoadBalancerListenerPolicyTargetPrototype target) { } } + protected LoadBalancerListenerPolicyPrototype() { } + protected LoadBalancerListenerPolicyPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, "action cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyReference.java index d108f15c08..7ee08fc7cc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyReference.java @@ -23,10 +23,12 @@ public class LoadBalancerListenerPolicyReference extends GenericModel { protected String href; protected String id; + protected LoadBalancerListenerPolicyReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyReferenceDeleted.java index 3f0ffcf38b..f6d26babe4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class LoadBalancerListenerPolicyReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class LoadBalancerListenerPolicyReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected LoadBalancerListenerPolicyReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRule.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRule.java index f06230a229..7825860d9b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRule.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRule.java @@ -35,7 +35,11 @@ public interface Condition { } /** - * The provisioning status of this rule. + * The provisioning status of this rule + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the rule on which the + * unexpected property value was encountered. */ public interface ProvisioningStatus { /** active. */ @@ -46,8 +50,6 @@ public interface ProvisioningStatus { String DELETE_PENDING = "delete_pending"; /** failed. */ String FAILED = "failed"; - /** maintenance_pending. */ - String MAINTENANCE_PENDING = "maintenance_pending"; /** update_pending. */ String UPDATE_PENDING = "update_pending"; } @@ -81,6 +83,8 @@ public interface Type { protected String type; protected String value; + protected LoadBalancerListenerPolicyRule() { } + /** * Gets the condition. * @@ -146,7 +150,11 @@ public String getId() { /** * Gets the provisioningStatus. * - * The provisioning status of this rule. + * The provisioning status of this rule + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the rule on which the + * unexpected property value was encountered. * * @return the provisioningStatus */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRuleCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRuleCollection.java index 72d40c6273..8248e6808a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRuleCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRuleCollection.java @@ -23,6 +23,8 @@ public class LoadBalancerListenerPolicyRuleCollection extends GenericModel { protected List rules; + protected LoadBalancerListenerPolicyRuleCollection() { } + /** * Gets the rules. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRulePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRulePatch.java index 06daafd9f3..9e758c7a61 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRulePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRulePatch.java @@ -66,6 +66,11 @@ public static class Builder { private String type; private String value; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPolicyRulePatch instance. + * + * @param loadBalancerListenerPolicyRulePatch the instance to initialize the Builder with + */ private Builder(LoadBalancerListenerPolicyRulePatch loadBalancerListenerPolicyRulePatch) { this.condition = loadBalancerListenerPolicyRulePatch.condition; this.field = loadBalancerListenerPolicyRulePatch.field; @@ -133,6 +138,8 @@ public Builder value(String value) { } } + protected LoadBalancerListenerPolicyRulePatch() { } + protected LoadBalancerListenerPolicyRulePatch(Builder builder) { condition = builder.condition; field = builder.field; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRulePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRulePrototype.java index aae5841457..58447f6961 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRulePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRulePrototype.java @@ -63,6 +63,11 @@ public static class Builder { private String type; private String value; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPolicyRulePrototype instance. + * + * @param loadBalancerListenerPolicyRulePrototype the instance to initialize the Builder with + */ private Builder(LoadBalancerListenerPolicyRulePrototype loadBalancerListenerPolicyRulePrototype) { this.condition = loadBalancerListenerPolicyRulePrototype.condition; this.field = loadBalancerListenerPolicyRulePrototype.field; @@ -143,6 +148,8 @@ public Builder value(String value) { } } + protected LoadBalancerListenerPolicyRulePrototype() { } + protected LoadBalancerListenerPolicyRulePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.condition, "condition cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRuleReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRuleReference.java index 8fadc0f7be..4155b78469 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRuleReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRuleReference.java @@ -23,10 +23,12 @@ public class LoadBalancerListenerPolicyRuleReference extends GenericModel { protected String href; protected String id; + protected LoadBalancerListenerPolicyRuleReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRuleReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRuleReferenceDeleted.java index bc8895a161..583f7a473f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRuleReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyRuleReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class LoadBalancerListenerPolicyRuleReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class LoadBalancerListenerPolicyRuleReferenceDeleted extends GenericModel @SerializedName("more_info") protected String moreInfo; + protected LoadBalancerListenerPolicyRuleReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTarget.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTarget.java index 45ea88ea1b..3df8f5be5a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTarget.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTarget.java @@ -37,13 +37,12 @@ public class LoadBalancerListenerPolicyTarget extends GenericModel { protected LoadBalancerListenerReference listener; protected String uri; - protected LoadBalancerListenerPolicyTarget() { - } + protected LoadBalancerListenerPolicyTarget() { } /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect.java index 3febe88207..7a06628181 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect.java @@ -17,5 +17,7 @@ */ public class LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect extends LoadBalancerListenerPolicyTarget { + + protected LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.java index fa61c74388..c34e251ef4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.java @@ -17,5 +17,7 @@ */ public class LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL extends LoadBalancerListenerPolicyTarget { + + protected LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.java index 434396b45b..55029b93d0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.java @@ -17,5 +17,7 @@ */ public class LoadBalancerListenerPolicyTargetLoadBalancerPoolReference extends LoadBalancerListenerPolicyTarget { + + protected LoadBalancerListenerPolicyTargetLoadBalancerPoolReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatch.java index 8b16952b61..a3095bd972 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatch.java @@ -36,8 +36,7 @@ public class LoadBalancerListenerPolicyTargetPatch extends GenericModel { protected LoadBalancerListenerIdentity listener; protected String uri; - protected LoadBalancerListenerPolicyTargetPatch() { - } + protected LoadBalancerListenerPolicyTargetPatch() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch.java index 099098dc09..2e0b6dd03c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch.java @@ -26,6 +26,11 @@ public static class Builder { private LoadBalancerListenerIdentity listener; private String uri; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch instance. + * + * @param loadBalancerListenerPolicyTargetPatchLoadBalancerListenerHttpsRedirectPatch the instance to initialize the Builder with + */ public Builder(LoadBalancerListenerPolicyTargetPatch loadBalancerListenerPolicyTargetPatchLoadBalancerListenerHttpsRedirectPatch) { this.httpStatusCode = loadBalancerListenerPolicyTargetPatchLoadBalancerListenerHttpsRedirectPatch.httpStatusCode; this.listener = loadBalancerListenerPolicyTargetPatchLoadBalancerListenerHttpsRedirectPatch.listener; @@ -81,6 +86,8 @@ public Builder uri(String uri) { } } + protected LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch() { } + protected LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch(Builder builder) { httpStatusCode = builder.httpStatusCode; listener = builder.listener; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.java index acf96d8aba..c0c40d9004 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.java @@ -25,6 +25,11 @@ public static class Builder { private Long httpStatusCode; private String url; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch instance. + * + * @param loadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectUrlPatch the instance to initialize the Builder with + */ public Builder(LoadBalancerListenerPolicyTargetPatch loadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectUrlPatch) { this.httpStatusCode = loadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectUrlPatch.httpStatusCode; this.url = loadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectUrlPatch.url; @@ -68,6 +73,8 @@ public Builder url(String url) { } } + protected LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch() { } + protected LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(Builder builder) { httpStatusCode = builder.httpStatusCode; url = builder.url; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity.java index 44c02fd8d4..245f41d1f1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity.java @@ -22,7 +22,6 @@ public class LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity extends LoadBalancerListenerPolicyTargetPatch { - protected LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity() { - } + protected LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.java index 885bf0be29..16ece90d64 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.java @@ -24,6 +24,11 @@ public class LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBa public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref instance. + * + * @param loadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref the instance to initialize the Builder with + */ public Builder(LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity loadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref) { this.href = loadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref() { } + protected LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.java index 72de79df1d..3ada95ce42 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.java @@ -24,6 +24,11 @@ public class LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBa public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById instance. + * + * @param loadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById the instance to initialize the Builder with + */ public Builder(LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity loadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById) { this.id = loadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById() { } + protected LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototype.java index 232fc27f29..82a77de564 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototype.java @@ -36,8 +36,7 @@ public class LoadBalancerListenerPolicyTargetPrototype extends GenericModel { protected LoadBalancerListenerIdentity listener; protected String uri; - protected LoadBalancerListenerPolicyTargetPrototype() { - } + protected LoadBalancerListenerPolicyTargetPrototype() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype.java index 090d7c87c1..5a2cf2de80 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype.java @@ -26,6 +26,11 @@ public static class Builder { private LoadBalancerListenerIdentity listener; private String uri; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype instance. + * + * @param loadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHttpsRedirectPrototype the instance to initialize the Builder with + */ public Builder(LoadBalancerListenerPolicyTargetPrototype loadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHttpsRedirectPrototype) { this.httpStatusCode = loadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHttpsRedirectPrototype.httpStatusCode; this.listener = loadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHttpsRedirectPrototype.listener; @@ -92,6 +97,8 @@ public Builder uri(String uri) { } } + protected LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype() { } + protected LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.httpStatusCode, "httpStatusCode cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.java index 2327f8d21a..802ff7d8d5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.java @@ -25,6 +25,11 @@ public static class Builder { private Long httpStatusCode; private String url; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype instance. + * + * @param loadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectUrlPrototype the instance to initialize the Builder with + */ public Builder(LoadBalancerListenerPolicyTargetPrototype loadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectUrlPrototype) { this.httpStatusCode = loadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectUrlPrototype.httpStatusCode; this.url = loadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectUrlPrototype.url; @@ -79,6 +84,8 @@ public Builder url(String url) { } } + protected LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype() { } + protected LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.httpStatusCode, "httpStatusCode cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity.java index 0a8859a4c9..a1ab169de7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity.java @@ -22,7 +22,6 @@ public class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity extends LoadBalancerListenerPolicyTargetPrototype { - protected LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity() { - } + protected LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.java index eb3655f92e..f29b502043 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.java @@ -24,6 +24,11 @@ public class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLo public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref instance. + * + * @param loadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref the instance to initialize the Builder with + */ public Builder(LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity loadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref) { this.href = loadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref() { } + protected LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.java index f937423542..8232c288e1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.java @@ -24,6 +24,11 @@ public class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLo public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById instance. + * + * @param loadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById the instance to initialize the Builder with + */ public Builder(LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity loadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById) { this.id = loadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById() { } + protected LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPrototypeLoadBalancerContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPrototypeLoadBalancerContext.java index b7fe2e260e..daf54dcf1a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPrototypeLoadBalancerContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPrototypeLoadBalancerContext.java @@ -21,13 +21,17 @@ public class LoadBalancerListenerPrototypeLoadBalancerContext extends GenericModel { /** - * The listener protocol. Load balancers in the `network` family support `tcp` and - * `udp` (if `udp_supported` is `true`). Load balancers in the `application` family support `tcp`, `http`, and - * `https`. Each listener in the load balancer must have a unique `port` and `protocol` combination. + * The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. * - * The enumerated values for this property are expected to expand in the future. When processing this property, check - * for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the - * unexpected property value was encountered. + * Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in + * the `application` family support `tcp`, `http` and + * `https`. + * + * Additional restrictions: + * - If `default_pool` is set, the pool's protocol must match, or be compatible with + * the listener's protocol. At present, the compatible protocols are `http` and + * `https`. + * - If `https_redirect` is set, the protocol must be `http`. */ public interface Protocol { /** http. */ @@ -42,10 +46,14 @@ public interface Protocol { @SerializedName("accept_proxy_protocol") protected Boolean acceptProxyProtocol; + @SerializedName("certificate_instance") + protected CertificateInstanceIdentity certificateInstance; @SerializedName("connection_limit") protected Long connectionLimit; @SerializedName("default_pool") protected LoadBalancerPoolIdentityByName defaultPool; + @SerializedName("https_redirect") + protected LoadBalancerListenerHTTPSRedirectPrototype httpsRedirect; protected Long port; @SerializedName("port_max") protected Long portMax; @@ -58,17 +66,26 @@ public interface Protocol { */ public static class Builder { private Boolean acceptProxyProtocol; + private CertificateInstanceIdentity certificateInstance; private Long connectionLimit; private LoadBalancerPoolIdentityByName defaultPool; + private LoadBalancerListenerHTTPSRedirectPrototype httpsRedirect; private Long port; private Long portMax; private Long portMin; private String protocol; + /** + * Instantiates a new Builder from an existing LoadBalancerListenerPrototypeLoadBalancerContext instance. + * + * @param loadBalancerListenerPrototypeLoadBalancerContext the instance to initialize the Builder with + */ private Builder(LoadBalancerListenerPrototypeLoadBalancerContext loadBalancerListenerPrototypeLoadBalancerContext) { this.acceptProxyProtocol = loadBalancerListenerPrototypeLoadBalancerContext.acceptProxyProtocol; + this.certificateInstance = loadBalancerListenerPrototypeLoadBalancerContext.certificateInstance; this.connectionLimit = loadBalancerListenerPrototypeLoadBalancerContext.connectionLimit; this.defaultPool = loadBalancerListenerPrototypeLoadBalancerContext.defaultPool; + this.httpsRedirect = loadBalancerListenerPrototypeLoadBalancerContext.httpsRedirect; this.port = loadBalancerListenerPrototypeLoadBalancerContext.port; this.portMax = loadBalancerListenerPrototypeLoadBalancerContext.portMax; this.portMin = loadBalancerListenerPrototypeLoadBalancerContext.portMin; @@ -110,6 +127,17 @@ public Builder acceptProxyProtocol(Boolean acceptProxyProtocol) { return this; } + /** + * Set the certificateInstance. + * + * @param certificateInstance the certificateInstance + * @return the LoadBalancerListenerPrototypeLoadBalancerContext builder + */ + public Builder certificateInstance(CertificateInstanceIdentity certificateInstance) { + this.certificateInstance = certificateInstance; + return this; + } + /** * Set the connectionLimit. * @@ -132,6 +160,17 @@ public Builder defaultPool(LoadBalancerPoolIdentityByName defaultPool) { return this; } + /** + * Set the httpsRedirect. + * + * @param httpsRedirect the httpsRedirect + * @return the LoadBalancerListenerPrototypeLoadBalancerContext builder + */ + public Builder httpsRedirect(LoadBalancerListenerHTTPSRedirectPrototype httpsRedirect) { + this.httpsRedirect = httpsRedirect; + return this; + } + /** * Set the port. * @@ -177,12 +216,16 @@ public Builder protocol(String protocol) { } } + protected LoadBalancerListenerPrototypeLoadBalancerContext() { } + protected LoadBalancerListenerPrototypeLoadBalancerContext(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, "protocol cannot be null"); acceptProxyProtocol = builder.acceptProxyProtocol; + certificateInstance = builder.certificateInstance; connectionLimit = builder.connectionLimit; defaultPool = builder.defaultPool; + httpsRedirect = builder.httpsRedirect; port = builder.port; portMax = builder.portMax; portMin = builder.portMin; @@ -214,6 +257,18 @@ public Boolean acceptProxyProtocol() { return acceptProxyProtocol; } + /** + * Gets the certificateInstance. + * + * The certificate instance to use for SSL termination. The listener must have a + * `protocol` of `https`. + * + * @return the certificateInstance + */ + public CertificateInstanceIdentity certificateInstance() { + return certificateInstance; + } + /** * Gets the connectionLimit. * @@ -228,9 +283,11 @@ public Long connectionLimit() { /** * Gets the defaultPool. * - * The default pool for this listener. If specified, the pool's protocol must match the - * listener's protocol, or the protocols must be compatible. At present, the compatible - * protocols are `http` and `https`. + * The default pool for this listener. If specified, the pool must: + * - Belong to this load balancer. + * - Have the same `protocol` as this listener, or have a compatible protocol. + * At present, the compatible protocols are `http` and `https`. + * - Not already be the `default_pool` for another listener. * * If unspecified, this listener will be created with no default pool, but one may be * subsequently set. @@ -241,6 +298,18 @@ public LoadBalancerPoolIdentityByName defaultPool() { return defaultPool; } + /** + * Gets the httpsRedirect. + * + * The target listener that requests will be redirected to. This listener must have a + * `protocol` of `http`, and the target listener must have a `protocol` of `https`. + * + * @return the httpsRedirect + */ + public LoadBalancerListenerHTTPSRedirectPrototype httpsRedirect() { + return httpsRedirect; + } + /** * Gets the port. * @@ -294,13 +363,17 @@ public Long portMin() { /** * Gets the protocol. * - * The listener protocol. Load balancers in the `network` family support `tcp` and - * `udp` (if `udp_supported` is `true`). Load balancers in the `application` family support `tcp`, `http`, and - * `https`. Each listener in the load balancer must have a unique `port` and `protocol` combination. + * The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. + * + * Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in + * the `application` family support `tcp`, `http` and + * `https`. * - * The enumerated values for this property are expected to expand in the future. When processing this property, check - * for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the - * unexpected property value was encountered. + * Additional restrictions: + * - If `default_pool` is set, the pool's protocol must match, or be compatible with + * the listener's protocol. At present, the compatible protocols are `http` and + * `https`. + * - If `https_redirect` is set, the protocol must be `http`. * * @return the protocol */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerReference.java index de7ff54bc1..15b2f469ec 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerReference.java @@ -23,10 +23,12 @@ public class LoadBalancerListenerReference extends GenericModel { protected String href; protected String id; + protected LoadBalancerListenerReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerReferenceDeleted.java index cb41327d66..4e34b3442e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class LoadBalancerListenerReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class LoadBalancerListenerReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected LoadBalancerListenerReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerLogging.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerLogging.java index b3f1512297..e482ec1beb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerLogging.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerLogging.java @@ -15,7 +15,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * The logging configuration for this load balancer. + * LoadBalancerLogging. */ public class LoadBalancerLogging extends GenericModel { @@ -27,6 +27,11 @@ public class LoadBalancerLogging extends GenericModel { public static class Builder { private LoadBalancerLoggingDatapath datapath; + /** + * Instantiates a new Builder from an existing LoadBalancerLogging instance. + * + * @param loadBalancerLogging the instance to initialize the Builder with + */ private Builder(LoadBalancerLogging loadBalancerLogging) { this.datapath = loadBalancerLogging.datapath; } @@ -58,6 +63,8 @@ public Builder datapath(LoadBalancerLoggingDatapath datapath) { } } + protected LoadBalancerLogging() { } + protected LoadBalancerLogging(Builder builder) { datapath = builder.datapath; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerLoggingDatapath.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerLoggingDatapath.java index 8edfe9e13e..c95c29f794 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerLoggingDatapath.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerLoggingDatapath.java @@ -27,6 +27,11 @@ public class LoadBalancerLoggingDatapath extends GenericModel { public static class Builder { private Boolean active; + /** + * Instantiates a new Builder from an existing LoadBalancerLoggingDatapath instance. + * + * @param loadBalancerLoggingDatapath the instance to initialize the Builder with + */ private Builder(LoadBalancerLoggingDatapath loadBalancerLoggingDatapath) { this.active = loadBalancerLoggingDatapath.active; } @@ -67,6 +72,8 @@ public Builder active(Boolean active) { } } + protected LoadBalancerLoggingDatapath() { } + protected LoadBalancerLoggingDatapath(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.active, "active cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPatch.java index c585477b04..f9cec45356 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPatch.java @@ -12,6 +12,8 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -24,6 +26,7 @@ public class LoadBalancerPatch extends GenericModel { protected LoadBalancerLogging logging; protected String name; + protected List subnets; /** * Builder. @@ -31,10 +34,17 @@ public class LoadBalancerPatch extends GenericModel { public static class Builder { private LoadBalancerLogging logging; private String name; + private List subnets; + /** + * Instantiates a new Builder from an existing LoadBalancerPatch instance. + * + * @param loadBalancerPatch the instance to initialize the Builder with + */ private Builder(LoadBalancerPatch loadBalancerPatch) { this.logging = loadBalancerPatch.logging; this.name = loadBalancerPatch.name; + this.subnets = loadBalancerPatch.subnets; } /** @@ -52,6 +62,22 @@ public LoadBalancerPatch build() { return new LoadBalancerPatch(this); } + /** + * Adds an subnets to subnets. + * + * @param subnets the new subnets + * @return the LoadBalancerPatch builder + */ + public Builder addSubnets(SubnetIdentity subnets) { + com.ibm.cloud.sdk.core.util.Validator.notNull(subnets, + "subnets cannot be null"); + if (this.subnets == null) { + this.subnets = new ArrayList(); + } + this.subnets.add(subnets); + return this; + } + /** * Set the logging. * @@ -73,11 +99,26 @@ public Builder name(String name) { this.name = name; return this; } + + /** + * Set the subnets. + * Existing subnets will be replaced. + * + * @param subnets the subnets + * @return the LoadBalancerPatch builder + */ + public Builder subnets(List subnets) { + this.subnets = subnets; + return this; + } } + protected LoadBalancerPatch() { } + protected LoadBalancerPatch(Builder builder) { logging = builder.logging; name = builder.name; + subnets = builder.subnets; } /** @@ -113,6 +154,23 @@ public String name() { return name; } + /** + * Gets the subnets. + * + * The subnets to provision this load balancer in. The load balancer's availability will depend on the availability of + * the zones that the subnets reside in. + * + * The specified subnets must be in the same VPC as the existing subnets, and will completely replace the existing + * subnets. + * + * The load balancer must be in the `application` family. + * + * @return the subnets + */ + public List subnets() { + return subnets; + } + /** * Construct a JSON merge-patch from the LoadBalancerPatch. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPool.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPool.java index 9242c761ad..babf799c1a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPool.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPool.java @@ -36,7 +36,7 @@ public interface Algorithm { } /** - * The protocol used for this load balancer pool. + * The protocol for this load balancer pool. * * The enumerated values for this property are expected to expand in the future. When processing this property, check * for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the @@ -54,7 +54,11 @@ public interface Protocol { } /** - * The provisioning status of this pool. + * The provisioning status of this pool + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the + * unexpected property value was encountered. */ public interface ProvisioningStatus { /** active. */ @@ -65,8 +69,6 @@ public interface ProvisioningStatus { String DELETE_PENDING = "delete_pending"; /** failed. */ String FAILED = "failed"; - /** maintenance_pending. */ - String MAINTENANCE_PENDING = "maintenance_pending"; /** update_pending. */ String UPDATE_PENDING = "update_pending"; } @@ -107,6 +109,8 @@ public interface ProxyProtocol { @SerializedName("session_persistence") protected LoadBalancerPoolSessionPersistence sessionPersistence; + protected LoadBalancerPool() { } + /** * Gets the algorithm. * @@ -198,7 +202,7 @@ public String getName() { /** * Gets the protocol. * - * The protocol used for this load balancer pool. + * The protocol for this load balancer pool. * * The enumerated values for this property are expected to expand in the future. When processing this property, check * for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the @@ -213,7 +217,11 @@ public String getProtocol() { /** * Gets the provisioningStatus. * - * The provisioning status of this pool. + * The provisioning status of this pool + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the + * unexpected property value was encountered. * * @return the provisioningStatus */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolCollection.java index ff818f0e84..2a91daac6d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolCollection.java @@ -23,6 +23,8 @@ public class LoadBalancerPoolCollection extends GenericModel { protected List pools; + protected LoadBalancerPoolCollection() { } + /** * Gets the pools. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolHealthMonitor.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolHealthMonitor.java index 3328d39944..13880039fe 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolHealthMonitor.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolHealthMonitor.java @@ -21,7 +21,7 @@ public class LoadBalancerPoolHealthMonitor extends GenericModel { /** - * The protocol type of this load balancer pool health monitor. + * The protocol type to use for health checks. * * The enumerated values for this property are expected to expand in the future. When processing this property, check * for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which @@ -45,10 +45,12 @@ public interface Type { @SerializedName("url_path") protected String urlPath; + protected LoadBalancerPoolHealthMonitor() { } + /** * Gets the delay. * - * The health check interval in seconds. Interval must be greater than timeout value. + * The seconds to wait between health checks. * * @return the delay */ @@ -70,7 +72,9 @@ public Long getMaxRetries() { /** * Gets the port. * - * The health check port number. If specified, this overrides the ports specified in the server member resources. + * The health check port. + * + * If present, this overrides the pool member port values. * * @return the port */ @@ -81,7 +85,7 @@ public Long getPort() { /** * Gets the timeout. * - * The health check timeout in seconds. + * The seconds to wait for a response to a health check. * * @return the timeout */ @@ -92,7 +96,7 @@ public Long getTimeout() { /** * Gets the type. * - * The protocol type of this load balancer pool health monitor. + * The protocol type to use for health checks. * * The enumerated values for this property are expected to expand in the future. When processing this property, check * for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which @@ -107,9 +111,9 @@ public String getType() { /** * Gets the urlPath. * - * The health check URL path. Applicable only if the health monitor `type` is `http` or - * `https`. This value must be in the format of an [origin-form request - * target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + * The health check URL path. Applicable when `type` is `http` or `https`. + * + * Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). * * @return the urlPath */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolHealthMonitorPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolHealthMonitorPatch.java index d99671d1fc..d105559a18 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolHealthMonitorPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolHealthMonitorPatch.java @@ -21,7 +21,7 @@ public class LoadBalancerPoolHealthMonitorPatch extends GenericModel { /** - * The protocol type of this load balancer pool health monitor. + * The protocol type to use for health checks. */ public interface Type { /** http. */ @@ -52,6 +52,11 @@ public static class Builder { private String type; private String urlPath; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolHealthMonitorPatch instance. + * + * @param loadBalancerPoolHealthMonitorPatch the instance to initialize the Builder with + */ private Builder(LoadBalancerPoolHealthMonitorPatch loadBalancerPoolHealthMonitorPatch) { this.delay = loadBalancerPoolHealthMonitorPatch.delay; this.maxRetries = loadBalancerPoolHealthMonitorPatch.maxRetries; @@ -158,6 +163,8 @@ public Builder urlPath(String urlPath) { } } + protected LoadBalancerPoolHealthMonitorPatch() { } + protected LoadBalancerPoolHealthMonitorPatch(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.delay, "delay cannot be null"); @@ -187,7 +194,7 @@ public Builder newBuilder() { /** * Gets the delay. * - * The health check interval in seconds. Interval must be greater than timeout value. + * The seconds to wait between health checks. Must be greater than `timeout`. * * @return the delay */ @@ -209,8 +216,11 @@ public Long maxRetries() { /** * Gets the port. * - * The health check port number. If specified, this overrides the ports specified in the server member resources. - * Specify `null` to remove an existing port value. + * The health check port. + * + * If set, this overrides the pool member port values. + * + * Specify `null` to remove an existing health check port. * * @return the port */ @@ -221,7 +231,7 @@ public Long port() { /** * Gets the timeout. * - * The health check timeout in seconds. + * The seconds to wait for a response to a health check. Must be less than `delay`. * * @return the timeout */ @@ -232,7 +242,7 @@ public Long timeout() { /** * Gets the type. * - * The protocol type of this load balancer pool health monitor. + * The protocol type to use for health checks. * * @return the type */ @@ -243,9 +253,9 @@ public String type() { /** * Gets the urlPath. * - * The health check URL path. Applicable only if the health monitor `type` is `http` or - * `https`. This value must be in the format of an [origin-form request - * target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + * The health check URL path. Applicable when `type` is `http` or `https`. + * + * Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). * * @return the urlPath */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolHealthMonitorPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolHealthMonitorPrototype.java index b601279d7c..09f027a64e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolHealthMonitorPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolHealthMonitorPrototype.java @@ -21,7 +21,7 @@ public class LoadBalancerPoolHealthMonitorPrototype extends GenericModel { /** - * The protocol type of this load balancer pool health monitor. + * The protocol type to use for health checks. */ public interface Type { /** http. */ @@ -52,6 +52,11 @@ public static class Builder { private String type; private String urlPath; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolHealthMonitorPrototype instance. + * + * @param loadBalancerPoolHealthMonitorPrototype the instance to initialize the Builder with + */ private Builder(LoadBalancerPoolHealthMonitorPrototype loadBalancerPoolHealthMonitorPrototype) { this.delay = loadBalancerPoolHealthMonitorPrototype.delay; this.maxRetries = loadBalancerPoolHealthMonitorPrototype.maxRetries; @@ -158,6 +163,8 @@ public Builder urlPath(String urlPath) { } } + protected LoadBalancerPoolHealthMonitorPrototype() { } + protected LoadBalancerPoolHealthMonitorPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.delay, "delay cannot be null"); @@ -187,7 +194,7 @@ public Builder newBuilder() { /** * Gets the delay. * - * The health check interval in seconds. Interval must be greater than timeout value. + * The seconds to wait between health checks. Must be greater than `timeout`. * * @return the delay */ @@ -209,7 +216,9 @@ public Long maxRetries() { /** * Gets the port. * - * The health check port number. If specified, this overrides the ports specified in the server member resources. + * The health check port. + * + * If specified, this overrides the pool member port values. * * @return the port */ @@ -220,7 +229,7 @@ public Long port() { /** * Gets the timeout. * - * The health check timeout in seconds. + * The seconds to wait for a response to a health check. Must be less than `delay`. * * @return the timeout */ @@ -231,7 +240,7 @@ public Long timeout() { /** * Gets the type. * - * The protocol type of this load balancer pool health monitor. + * The protocol type to use for health checks. * * @return the type */ @@ -242,9 +251,9 @@ public String type() { /** * Gets the urlPath. * - * The health check URL path. Applicable only if the health monitor `type` is `http` or - * `https`. This value must be in the format of an [origin-form request - * target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + * The health check URL path. Applicable when `type` is `http` or `https`. + * + * Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). * * @return the urlPath */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentity.java index 848f9de7d8..b0662048f1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentity.java @@ -26,8 +26,7 @@ public class LoadBalancerPoolIdentity extends GenericModel { protected String id; protected String href; - protected LoadBalancerPoolIdentity() { - } + protected LoadBalancerPoolIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentityByHref.java index c33be0750d..d45e165150 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentityByHref.java @@ -24,6 +24,11 @@ public class LoadBalancerPoolIdentityByHref extends LoadBalancerPoolIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolIdentityByHref instance. + * + * @param loadBalancerPoolIdentityByHref the instance to initialize the Builder with + */ public Builder(LoadBalancerPoolIdentity loadBalancerPoolIdentityByHref) { this.href = loadBalancerPoolIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected LoadBalancerPoolIdentityByHref() { } + protected LoadBalancerPoolIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentityById.java index 546ed9d944..69243d5d63 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentityById.java @@ -24,6 +24,11 @@ public class LoadBalancerPoolIdentityById extends LoadBalancerPoolIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolIdentityById instance. + * + * @param loadBalancerPoolIdentityById the instance to initialize the Builder with + */ public Builder(LoadBalancerPoolIdentity loadBalancerPoolIdentityById) { this.id = loadBalancerPoolIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected LoadBalancerPoolIdentityById() { } + protected LoadBalancerPoolIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentityByName.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentityByName.java index e2528520c6..60baa345ff 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentityByName.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolIdentityByName.java @@ -27,6 +27,11 @@ public class LoadBalancerPoolIdentityByName extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolIdentityByName instance. + * + * @param loadBalancerPoolIdentityByName the instance to initialize the Builder with + */ private Builder(LoadBalancerPoolIdentityByName loadBalancerPoolIdentityByName) { this.name = loadBalancerPoolIdentityByName.name; } @@ -67,6 +72,8 @@ public Builder name(String name) { } } + protected LoadBalancerPoolIdentityByName() { } + protected LoadBalancerPoolIdentityByName(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMember.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMember.java index a5c4f1cdd7..4a74a901c6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMember.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMember.java @@ -35,7 +35,11 @@ public interface Health { } /** - * The provisioning status of this member. + * The provisioning status of this member + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the pool member on which + * the unexpected property value was encountered. */ public interface ProvisioningStatus { /** active. */ @@ -46,8 +50,6 @@ public interface ProvisioningStatus { String DELETE_PENDING = "delete_pending"; /** failed. */ String FAILED = "failed"; - /** maintenance_pending. */ - String MAINTENANCE_PENDING = "maintenance_pending"; /** update_pending. */ String UPDATE_PENDING = "update_pending"; } @@ -63,6 +65,8 @@ public interface ProvisioningStatus { protected LoadBalancerPoolMemberTarget target; protected Long weight; + protected LoadBalancerPoolMember() { } + /** * Gets the createdAt. * @@ -126,7 +130,11 @@ public Long getPort() { /** * Gets the provisioningStatus. * - * The provisioning status of this member. + * The provisioning status of this member + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the pool member on which + * the unexpected property value was encountered. * * @return the provisioningStatus */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberCollection.java index 572edcf02e..07d320b058 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberCollection.java @@ -23,6 +23,8 @@ public class LoadBalancerPoolMemberCollection extends GenericModel { protected List members; + protected LoadBalancerPoolMemberCollection() { } + /** * Gets the members. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberPatch.java index 3c9e2dc023..f34e162ca2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberPatch.java @@ -34,6 +34,11 @@ public static class Builder { private LoadBalancerPoolMemberTargetPrototype target; private Long weight; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolMemberPatch instance. + * + * @param loadBalancerPoolMemberPatch the instance to initialize the Builder with + */ private Builder(LoadBalancerPoolMemberPatch loadBalancerPoolMemberPatch) { this.port = loadBalancerPoolMemberPatch.port; this.target = loadBalancerPoolMemberPatch.target; @@ -89,6 +94,8 @@ public Builder weight(long weight) { } } + protected LoadBalancerPoolMemberPatch() { } + protected LoadBalancerPoolMemberPatch(Builder builder) { port = builder.port; target = builder.target; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberPrototype.java index 65e483b8da..136f1cd437 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberPrototype.java @@ -31,6 +31,11 @@ public static class Builder { private LoadBalancerPoolMemberTargetPrototype target; private Long weight; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolMemberPrototype instance. + * + * @param loadBalancerPoolMemberPrototype the instance to initialize the Builder with + */ private Builder(LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototype) { this.port = loadBalancerPoolMemberPrototype.port; this.target = loadBalancerPoolMemberPrototype.target; @@ -97,6 +102,8 @@ public Builder weight(long weight) { } } + protected LoadBalancerPoolMemberPrototype() { } + protected LoadBalancerPoolMemberPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.port, "port cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberReference.java index 3f68d6e6a5..7dbaacecdd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberReference.java @@ -23,10 +23,12 @@ public class LoadBalancerPoolMemberReference extends GenericModel { protected String href; protected String id; + protected LoadBalancerPoolMemberReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberReferenceDeleted.java index e7ff0638f5..7c3feef045 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class LoadBalancerPoolMemberReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class LoadBalancerPoolMemberReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected LoadBalancerPoolMemberReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTarget.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTarget.java index ca55c70ed0..b8e57040cb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTarget.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTarget.java @@ -32,8 +32,7 @@ public class LoadBalancerPoolMemberTarget extends GenericModel { protected String name; protected String address; - protected LoadBalancerPoolMemberTarget() { - } + protected LoadBalancerPoolMemberTarget() { } /** * Gets the crn. @@ -49,7 +48,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIP.java index 5db9a849b7..762f7eb851 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIP.java @@ -17,5 +17,7 @@ */ public class LoadBalancerPoolMemberTargetIP extends LoadBalancerPoolMemberTarget { + + protected LoadBalancerPoolMemberTargetIP() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetInstanceReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetInstanceReference.java index 104a7182f3..6396729ecf 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetInstanceReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetInstanceReference.java @@ -17,5 +17,7 @@ */ public class LoadBalancerPoolMemberTargetInstanceReference extends LoadBalancerPoolMemberTarget { + + protected LoadBalancerPoolMemberTargetInstanceReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototype.java index 873fc8aaf5..6a5046e5ce 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototype.java @@ -30,8 +30,7 @@ public class LoadBalancerPoolMemberTargetPrototype extends GenericModel { protected String href; protected String address; - protected LoadBalancerPoolMemberTargetPrototype() { - } + protected LoadBalancerPoolMemberTargetPrototype() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeIP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeIP.java index a85e1fe87e..89e30f7250 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeIP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeIP.java @@ -24,6 +24,11 @@ public class LoadBalancerPoolMemberTargetPrototypeIP extends LoadBalancerPoolMem public static class Builder { private String address; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolMemberTargetPrototypeIP instance. + * + * @param loadBalancerPoolMemberTargetPrototypeIp the instance to initialize the Builder with + */ public Builder(LoadBalancerPoolMemberTargetPrototype loadBalancerPoolMemberTargetPrototypeIp) { this.address = loadBalancerPoolMemberTargetPrototypeIp.address; } @@ -64,6 +69,8 @@ public Builder address(String address) { } } + protected LoadBalancerPoolMemberTargetPrototypeIP() { } + protected LoadBalancerPoolMemberTargetPrototypeIP(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.address, "address cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentity.java index 5451c34652..4f4524c8ca 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentity.java @@ -23,7 +23,6 @@ public class LoadBalancerPoolMemberTargetPrototypeInstanceIdentity extends LoadBalancerPoolMemberTargetPrototype { - protected LoadBalancerPoolMemberTargetPrototypeInstanceIdentity() { - } + protected LoadBalancerPoolMemberTargetPrototypeInstanceIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN.java index ea539dcbe4..2aa013f0e7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN.java @@ -24,6 +24,11 @@ public class LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdenti public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN instance. + * + * @param loadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCrn the instance to initialize the Builder with + */ public Builder(LoadBalancerPoolMemberTargetPrototypeInstanceIdentity loadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCrn) { this.crn = loadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN() { } + protected LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref.java index a8a4457f09..799d35e4ed 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref.java @@ -24,6 +24,11 @@ public class LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdenti public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref instance. + * + * @param loadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref the instance to initialize the Builder with + */ public Builder(LoadBalancerPoolMemberTargetPrototypeInstanceIdentity loadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref) { this.href = loadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref() { } + protected LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.java index 3d022d8318..2488066c23 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.java @@ -24,6 +24,11 @@ public class LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdenti public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById instance. + * + * @param loadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById the instance to initialize the Builder with + */ public Builder(LoadBalancerPoolMemberTargetPrototypeInstanceIdentity loadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById) { this.id = loadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById() { } + protected LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolPatch.java index 7cf0cb2607..76f0c1244d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolPatch.java @@ -36,11 +36,14 @@ public interface Algorithm { } /** - * The protocol to use for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if - * `udp_supported` is `true`). Load balancers in the `application` family support `tcp`, `http` and `https`. + * The protocol for this load balancer pool. * - * If this pool is associated with a load balancer listener, the specified protocol must be compatible with the - * listener's protocol. At present, the compatible protocols are `http` and `https`. + * Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in + * the `application` family support `tcp`, `http` and + * `https`. + * + * If this pool is associated with a load balancer listener, the specified protocol must match, or be compatible with + * the listener's protocol. At present, the compatible protocols are `http` and `https`. */ public interface Protocol { /** http. */ @@ -91,6 +94,11 @@ public static class Builder { private String proxyProtocol; private LoadBalancerPoolSessionPersistencePatch sessionPersistence; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolPatch instance. + * + * @param loadBalancerPoolPatch the instance to initialize the Builder with + */ private Builder(LoadBalancerPoolPatch loadBalancerPoolPatch) { this.algorithm = loadBalancerPoolPatch.algorithm; this.healthMonitor = loadBalancerPoolPatch.healthMonitor; @@ -182,6 +190,8 @@ public Builder sessionPersistence(LoadBalancerPoolSessionPersistencePatch sessio } } + protected LoadBalancerPoolPatch() { } + protected LoadBalancerPoolPatch(Builder builder) { algorithm = builder.algorithm; healthMonitor = builder.healthMonitor; @@ -236,11 +246,14 @@ public String name() { /** * Gets the protocol. * - * The protocol to use for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if - * `udp_supported` is `true`). Load balancers in the `application` family support `tcp`, `http` and `https`. + * The protocol for this load balancer pool. + * + * Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in + * the `application` family support `tcp`, `http` and + * `https`. * - * If this pool is associated with a load balancer listener, the specified protocol must be compatible with the - * listener's protocol. At present, the compatible protocols are `http` and `https`. + * If this pool is associated with a load balancer listener, the specified protocol must match, or be compatible with + * the listener's protocol. At present, the compatible protocols are `http` and `https`. * * @return the protocol */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolPrototype.java index e28ffee422..b858bdf8e4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolPrototype.java @@ -91,6 +91,11 @@ public static class Builder { private String proxyProtocol; private LoadBalancerPoolSessionPersistencePrototype sessionPersistence; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolPrototype instance. + * + * @param loadBalancerPoolPrototype the instance to initialize the Builder with + */ private Builder(LoadBalancerPoolPrototype loadBalancerPoolPrototype) { this.algorithm = loadBalancerPoolPrototype.algorithm; this.healthMonitor = loadBalancerPoolPrototype.healthMonitor; @@ -224,6 +229,8 @@ public Builder sessionPersistence(LoadBalancerPoolSessionPersistencePrototype se } } + protected LoadBalancerPoolPrototype() { } + protected LoadBalancerPoolPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.algorithm, "algorithm cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolReference.java index 49aa28e0ad..5d710660f0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolReference.java @@ -24,10 +24,12 @@ public class LoadBalancerPoolReference extends GenericModel { protected String id; protected String name; + protected LoadBalancerPoolReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolReferenceDeleted.java index 4196d942ba..fa2ec64ceb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class LoadBalancerPoolReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class LoadBalancerPoolReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected LoadBalancerPoolReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolSessionPersistence.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolSessionPersistence.java index c33e5d88bc..b26bc04179 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolSessionPersistence.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolSessionPersistence.java @@ -37,6 +37,8 @@ public interface Type { protected String cookieName; protected String type; + protected LoadBalancerPoolSessionPersistence() { } + /** * Gets the cookieName. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolSessionPersistencePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolSessionPersistencePatch.java index 5f2d55983d..377dd4d537 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolSessionPersistencePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolSessionPersistencePatch.java @@ -44,6 +44,11 @@ public static class Builder { private String cookieName; private String type; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolSessionPersistencePatch instance. + * + * @param loadBalancerPoolSessionPersistencePatch the instance to initialize the Builder with + */ private Builder(LoadBalancerPoolSessionPersistencePatch loadBalancerPoolSessionPersistencePatch) { this.cookieName = loadBalancerPoolSessionPersistencePatch.cookieName; this.type = loadBalancerPoolSessionPersistencePatch.type; @@ -87,6 +92,8 @@ public Builder type(String type) { } } + protected LoadBalancerPoolSessionPersistencePatch() { } + protected LoadBalancerPoolSessionPersistencePatch(Builder builder) { cookieName = builder.cookieName; type = builder.type; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolSessionPersistencePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolSessionPersistencePrototype.java index f24045da8c..4adf9ea825 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolSessionPersistencePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolSessionPersistencePrototype.java @@ -44,6 +44,11 @@ public static class Builder { private String cookieName; private String type; + /** + * Instantiates a new Builder from an existing LoadBalancerPoolSessionPersistencePrototype instance. + * + * @param loadBalancerPoolSessionPersistencePrototype the instance to initialize the Builder with + */ private Builder(LoadBalancerPoolSessionPersistencePrototype loadBalancerPoolSessionPersistencePrototype) { this.cookieName = loadBalancerPoolSessionPersistencePrototype.cookieName; this.type = loadBalancerPoolSessionPersistencePrototype.type; @@ -96,6 +101,8 @@ public Builder type(String type) { } } + protected LoadBalancerPoolSessionPersistencePrototype() { } + protected LoadBalancerPoolSessionPersistencePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.type, "type cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPrivateIpsItem.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPrivateIpsItem.java index bc64cbfae8..c3abb04258 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPrivateIpsItem.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPrivateIpsItem.java @@ -36,6 +36,8 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected LoadBalancerPrivateIpsItem() { } + /** * Gets the address. * @@ -56,7 +58,7 @@ public String getAddress() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfile.java index 7c0a7b89ac..8d3040deae 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfile.java @@ -32,6 +32,8 @@ public class LoadBalancerProfile extends GenericModel { @SerializedName("udp_supported") protected LoadBalancerProfileUDPSupported udpSupported; + protected LoadBalancerProfile() { } + /** * Gets the family. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollection.java index fc3bc40f43..c9b79caff8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollection.java @@ -29,6 +29,8 @@ public class LoadBalancerProfileCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected LoadBalancerProfileCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionFirst.java index 5150f3de2d..5e9a7e0237 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionFirst.java @@ -21,6 +21,8 @@ public class LoadBalancerProfileCollectionFirst extends GenericModel { protected String href; + protected LoadBalancerProfileCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionNext.java index b89a389a0d..50be4d8e21 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionNext.java @@ -21,6 +21,8 @@ public class LoadBalancerProfileCollectionNext extends GenericModel { protected String href; + protected LoadBalancerProfileCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileIdentity.java index 61b1a0a5b2..19c8d80d8e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileIdentity.java @@ -26,8 +26,7 @@ public class LoadBalancerProfileIdentity extends GenericModel { protected String name; protected String href; - protected LoadBalancerProfileIdentity() { - } + protected LoadBalancerProfileIdentity() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileIdentityByHref.java index aab5e84462..a77962bb70 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileIdentityByHref.java @@ -24,6 +24,11 @@ public class LoadBalancerProfileIdentityByHref extends LoadBalancerProfileIdenti public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing LoadBalancerProfileIdentityByHref instance. + * + * @param loadBalancerProfileIdentityByHref the instance to initialize the Builder with + */ public Builder(LoadBalancerProfileIdentity loadBalancerProfileIdentityByHref) { this.href = loadBalancerProfileIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected LoadBalancerProfileIdentityByHref() { } + protected LoadBalancerProfileIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileIdentityByName.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileIdentityByName.java index 59984ce7fc..0a4ae9e77a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileIdentityByName.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileIdentityByName.java @@ -24,6 +24,11 @@ public class LoadBalancerProfileIdentityByName extends LoadBalancerProfileIdenti public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing LoadBalancerProfileIdentityByName instance. + * + * @param loadBalancerProfileIdentityByName the instance to initialize the Builder with + */ public Builder(LoadBalancerProfileIdentity loadBalancerProfileIdentityByName) { this.name = loadBalancerProfileIdentityByName.name; } @@ -64,6 +69,8 @@ public Builder name(String name) { } } + protected LoadBalancerProfileIdentityByName() { } + protected LoadBalancerProfileIdentityByName(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileLoggingSupported.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileLoggingSupported.java index 54759b59d5..fe714ce0c6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileLoggingSupported.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileLoggingSupported.java @@ -32,6 +32,8 @@ public interface Type { protected String type; protected List value; + protected LoadBalancerProfileLoggingSupported() { } + /** * Gets the type. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileReference.java index dc8cf3f697..258a796953 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileReference.java @@ -23,6 +23,8 @@ public class LoadBalancerProfileReference extends GenericModel { protected String href; protected String name; + protected LoadBalancerProfileReference() { } + /** * Gets the family. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileRouteModeSupported.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileRouteModeSupported.java index 882638e12d..cf31bbb941 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileRouteModeSupported.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileRouteModeSupported.java @@ -34,8 +34,7 @@ public interface Type { protected String type; protected Boolean value; - protected LoadBalancerProfileRouteModeSupported() { - } + protected LoadBalancerProfileRouteModeSupported() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileRouteModeSupportedDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileRouteModeSupportedDependent.java index d4bf229213..ce7db892fb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileRouteModeSupportedDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileRouteModeSupportedDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected LoadBalancerProfileRouteModeSupportedDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileRouteModeSupportedFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileRouteModeSupportedFixed.java index 943f00652e..776871a409 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileRouteModeSupportedFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileRouteModeSupportedFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected LoadBalancerProfileRouteModeSupportedFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileSecurityGroupsSupported.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileSecurityGroupsSupported.java index 286ef0c52f..bfbd664d78 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileSecurityGroupsSupported.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileSecurityGroupsSupported.java @@ -34,8 +34,7 @@ public interface Type { protected String type; protected Boolean value; - protected LoadBalancerProfileSecurityGroupsSupported() { - } + protected LoadBalancerProfileSecurityGroupsSupported() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileSecurityGroupsSupportedDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileSecurityGroupsSupportedDependent.java index d60a8e49f4..2e5caa2fde 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileSecurityGroupsSupportedDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileSecurityGroupsSupportedDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected LoadBalancerProfileSecurityGroupsSupportedDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileSecurityGroupsSupportedFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileSecurityGroupsSupportedFixed.java index 561df04d27..268eecaf93 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileSecurityGroupsSupportedFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileSecurityGroupsSupportedFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected LoadBalancerProfileSecurityGroupsSupportedFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileUDPSupported.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileUDPSupported.java index 98b7dae8cc..bead6a39e0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileUDPSupported.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileUDPSupported.java @@ -34,8 +34,7 @@ public interface Type { protected String type; protected Boolean value; - protected LoadBalancerProfileUDPSupported() { - } + protected LoadBalancerProfileUDPSupported() { } /** * Gets the type. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileUDPSupportedDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileUDPSupportedDependent.java index 9036ceec4b..680d7dc376 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileUDPSupportedDependent.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileUDPSupportedDependent.java @@ -25,5 +25,7 @@ public interface Type { String DEPENDENT = "dependent"; } + + protected LoadBalancerProfileUDPSupportedDependent() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileUDPSupportedFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileUDPSupportedFixed.java index 9f703e90f0..447f76155a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileUDPSupportedFixed.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileUDPSupportedFixed.java @@ -25,5 +25,7 @@ public interface Type { String FIXED = "fixed"; } + + protected LoadBalancerProfileUDPSupportedFixed() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfilesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfilesPager.java new file mode 100644 index 0000000000..6ae76ba53e --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfilesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * LoadBalancerProfilesPager can be used to simplify the use of the "listLoadBalancerProfiles" method. + */ +public class LoadBalancerProfilesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListLoadBalancerProfilesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected LoadBalancerProfilesPager() { } + + /** + * Constructs a new LoadBalancerProfilesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listLoadBalancerProfiles" method + * @param options the ListLoadBalancerProfilesOptions instance to be used to invoke the "listLoadBalancerProfiles" method + */ + public LoadBalancerProfilesPager(Vpc client, ListLoadBalancerProfilesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<LoadBalancerProfile> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListLoadBalancerProfilesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + LoadBalancerProfileCollection result = client.listLoadBalancerProfiles(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getProfiles(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<LoadBalancerProfile> containing all results returned by the "listLoadBalancerProfiles" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerReferenceDeleted.java index 7b3af5886b..3272b70f88 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class LoadBalancerReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class LoadBalancerReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected LoadBalancerReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerStatistics.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerStatistics.java index fee457062e..f8e4332c12 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerStatistics.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerStatistics.java @@ -28,6 +28,8 @@ public class LoadBalancerStatistics extends GenericModel { protected Long dataProcessedThisMonth; protected Float throughput; + protected LoadBalancerStatistics() { } + /** * Gets the activeConnections. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancersPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancersPager.java new file mode 100644 index 0000000000..c46df34263 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancersPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * LoadBalancersPager can be used to simplify the use of the "listLoadBalancers" method. + */ +public class LoadBalancersPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListLoadBalancersOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected LoadBalancersPager() { } + + /** + * Constructs a new LoadBalancersPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listLoadBalancers" method + * @param options the ListLoadBalancersOptions instance to be used to invoke the "listLoadBalancers" method + */ + public LoadBalancersPager(Vpc client, ListLoadBalancersOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<LoadBalancer> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListLoadBalancersOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + LoadBalancerCollection result = client.listLoadBalancers(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getLoadBalancers(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<LoadBalancer> containing all results returned by the "listLoadBalancers" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACL.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACL.java index 96504a0f3c..c2584a4766 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACL.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACL.java @@ -35,6 +35,8 @@ public class NetworkACL extends GenericModel { protected List subnets; protected VPCReference vpc; + protected NetworkACL() { } + /** * Gets the createdAt. * @@ -126,7 +128,7 @@ public List getSubnets() { /** * Gets the vpc. * - * The VPC this network ACL is a part of. + * The VPC this network ACL resides in. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollection.java index ed248eb3f0..7c00ac59d4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollection.java @@ -30,6 +30,8 @@ public class NetworkACLCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected NetworkACLCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionFirst.java index c7cb4c198a..812ac836fd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionFirst.java @@ -21,6 +21,8 @@ public class NetworkACLCollectionFirst extends GenericModel { protected String href; + protected NetworkACLCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionNext.java index 31a7716ab8..46275e511d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionNext.java @@ -21,6 +21,8 @@ public class NetworkACLCollectionNext extends GenericModel { protected String href; + protected NetworkACLCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentity.java index 61ae7c5402..57a359a956 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentity.java @@ -28,8 +28,7 @@ public class NetworkACLIdentity extends GenericModel { protected String crn; protected String href; - protected NetworkACLIdentity() { - } + protected NetworkACLIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentityByCRN.java index 783e2b7213..d99a105707 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentityByCRN.java @@ -24,6 +24,11 @@ public class NetworkACLIdentityByCRN extends NetworkACLIdentity { public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing NetworkACLIdentityByCRN instance. + * + * @param networkAclIdentityByCrn the instance to initialize the Builder with + */ public Builder(NetworkACLIdentity networkAclIdentityByCrn) { this.crn = networkAclIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected NetworkACLIdentityByCRN() { } + protected NetworkACLIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentityByHref.java index 7c87d23e17..3b8ebb30c0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentityByHref.java @@ -24,6 +24,11 @@ public class NetworkACLIdentityByHref extends NetworkACLIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing NetworkACLIdentityByHref instance. + * + * @param networkAclIdentityByHref the instance to initialize the Builder with + */ public Builder(NetworkACLIdentity networkAclIdentityByHref) { this.href = networkAclIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected NetworkACLIdentityByHref() { } + protected NetworkACLIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentityById.java index 4960506fc5..de3b911fb8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLIdentityById.java @@ -24,6 +24,11 @@ public class NetworkACLIdentityById extends NetworkACLIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing NetworkACLIdentityById instance. + * + * @param networkAclIdentityById the instance to initialize the Builder with + */ public Builder(NetworkACLIdentity networkAclIdentityById) { this.id = networkAclIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected NetworkACLIdentityById() { } + protected NetworkACLIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPatch.java index c4b63a7223..2c1d594c20 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPatch.java @@ -30,6 +30,11 @@ public class NetworkACLPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing NetworkACLPatch instance. + * + * @param networkAclPatch the instance to initialize the Builder with + */ private Builder(NetworkACLPatch networkAclPatch) { this.name = networkAclPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected NetworkACLPatch() { } + protected NetworkACLPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototype.java index 6028c47d47..db18062e5c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototype.java @@ -34,8 +34,7 @@ public class NetworkACLPrototype extends GenericModel { @SerializedName("source_network_acl") protected NetworkACLIdentity sourceNetworkAcl; - protected NetworkACLPrototype() { - } + protected NetworkACLPrototype() { } /** * Gets the name. @@ -64,7 +63,7 @@ public ResourceGroupIdentity resourceGroup() { /** * Gets the vpc. * - * The VPC this network ACL is to be a part of. + * The VPC this network ACL will reside in. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLByRules.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLByRules.java index 353a04200e..7200c77a5f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLByRules.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLByRules.java @@ -30,6 +30,11 @@ public static class Builder { private VPCIdentity vpc; private List rules; + /** + * Instantiates a new Builder from an existing NetworkACLPrototypeNetworkACLByRules instance. + * + * @param networkAclPrototypeNetworkAclByRules the instance to initialize the Builder with + */ public Builder(NetworkACLPrototype networkAclPrototypeNetworkAclByRules) { this.name = networkAclPrototypeNetworkAclByRules.name; this.resourceGroup = networkAclPrototypeNetworkAclByRules.resourceGroup; @@ -123,6 +128,8 @@ public Builder rules(List rules) { } } + protected NetworkACLPrototypeNetworkACLByRules() { } + protected NetworkACLPrototypeNetworkACLByRules(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.vpc, "vpc cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLBySourceNetworkACL.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLBySourceNetworkACL.java index 62ea8f95b4..f4c7087c7f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLBySourceNetworkACL.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLBySourceNetworkACL.java @@ -27,6 +27,11 @@ public static class Builder { private VPCIdentity vpc; private NetworkACLIdentity sourceNetworkAcl; + /** + * Instantiates a new Builder from an existing NetworkACLPrototypeNetworkACLBySourceNetworkACL instance. + * + * @param networkAclPrototypeNetworkAclBySourceNetworkAcl the instance to initialize the Builder with + */ public Builder(NetworkACLPrototype networkAclPrototypeNetworkAclBySourceNetworkAcl) { this.name = networkAclPrototypeNetworkAclBySourceNetworkAcl.name; this.resourceGroup = networkAclPrototypeNetworkAclBySourceNetworkAcl.resourceGroup; @@ -105,6 +110,8 @@ public Builder sourceNetworkAcl(NetworkACLIdentity sourceNetworkAcl) { } } + protected NetworkACLPrototypeNetworkACLBySourceNetworkACL() { } + protected NetworkACLPrototypeNetworkACLBySourceNetworkACL(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.vpc, "vpc cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLReference.java index 3090364fe2..14c4001548 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLReference.java @@ -25,6 +25,8 @@ public class NetworkACLReference extends GenericModel { protected String id; protected String name; + protected NetworkACLReference() { } + /** * Gets the crn. * @@ -39,7 +41,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLReferenceDeleted.java index 839a1df048..796eff3bae 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class NetworkACLReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class NetworkACLReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected NetworkACLReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRule.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRule.java index 4d6c460fdf..f65af383ff 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRule.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRule.java @@ -38,7 +38,7 @@ public class NetworkACLRule extends GenericModel { } /** - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. */ public interface Action { /** allow. */ @@ -48,7 +48,7 @@ public interface Action { } /** - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. */ public interface Direction { /** inbound. */ @@ -63,8 +63,20 @@ public interface Direction { public interface IpVersion { /** ipv4. */ String IPV4 = "ipv4"; - /** ipv6. */ - String IPV6 = "ipv6"; + } + + /** + * The protocol to enforce. + */ + public interface Protocol { + /** all. */ + String ALL = "all"; + /** icmp. */ + String ICMP = "icmp"; + /** tcp. */ + String TCP = "tcp"; + /** udp. */ + String UDP = "udp"; } protected String action; @@ -91,13 +103,12 @@ public interface IpVersion { protected Long code; protected Long type; - protected NetworkACLRule() { - } + protected NetworkACLRule() { } /** * Gets the action. * - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. * * @return the action */ @@ -130,7 +141,7 @@ public Date getCreatedAt() { /** * Gets the destination. * - * The destination CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + * The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. * * @return the destination */ @@ -141,7 +152,7 @@ public String getDestination() { /** * Gets the direction. * - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. * * @return the direction */ @@ -185,8 +196,7 @@ public String getIpVersion() { /** * Gets the name. * - * The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If - * unspecified, the name will be a hyphenated list of randomly-selected words. + * The user-defined name for this network ACL rule. * * @return the name */ @@ -208,7 +218,7 @@ public String getProtocol() { /** * Gets the source. * - * The source CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + * The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. * * @return the source */ @@ -263,8 +273,9 @@ public Long getSourcePortMin() { /** * Gets the code. * - * The ICMP traffic code to allow. If unspecified, all codes are allowed. This can only be specified if type is also - * specified. + * The ICMP traffic code to match. + * + * If absent, all codes are matched. * * @return the code */ @@ -275,7 +286,9 @@ public Long getCode() { /** * Gets the type. * - * The ICMP traffic type to allow. If unspecified, all types are allowed by this rule. + * The ICMP traffic type to match. + * + * If absent, all types are matched. * * @return the type */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePatch.java index 39b9213151..1d9bd54804 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePatch.java @@ -15,7 +15,9 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * The rule to move this rule immediately before. Specify `null` to move this rule after all existing rules. + * The rule to move this rule immediately before. + * + * Specify `null` to move this rule after all existing rules. * * Classes which extend this class: * - NetworkACLRuleBeforePatchNetworkACLRuleIdentityById @@ -26,8 +28,7 @@ public class NetworkACLRuleBeforePatch extends GenericModel { protected String id; protected String href; - protected NetworkACLRuleBeforePatch() { - } + protected NetworkACLRuleBeforePatch() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.java index 18bb771f5b..1ef20cbe39 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.java @@ -24,6 +24,11 @@ public class NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref extends Netwo public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref instance. + * + * @param networkAclRuleBeforePatchNetworkAclRuleIdentityByHref the instance to initialize the Builder with + */ public Builder(NetworkACLRuleBeforePatch networkAclRuleBeforePatchNetworkAclRuleIdentityByHref) { this.href = networkAclRuleBeforePatchNetworkAclRuleIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref() { } + protected NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.java index 05393e4641..c4d09ea3ea 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.java @@ -24,6 +24,11 @@ public class NetworkACLRuleBeforePatchNetworkACLRuleIdentityById extends Network public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing NetworkACLRuleBeforePatchNetworkACLRuleIdentityById instance. + * + * @param networkAclRuleBeforePatchNetworkAclRuleIdentityById the instance to initialize the Builder with + */ public Builder(NetworkACLRuleBeforePatch networkAclRuleBeforePatchNetworkAclRuleIdentityById) { this.id = networkAclRuleBeforePatchNetworkAclRuleIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected NetworkACLRuleBeforePatchNetworkACLRuleIdentityById() { } + protected NetworkACLRuleBeforePatchNetworkACLRuleIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePrototype.java index 5a4d2ceed7..34b3d48188 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePrototype.java @@ -15,7 +15,9 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * The rule to insert this rule immediately before. If omitted, this rule will be inserted after all existing rules. + * The rule to insert this rule immediately before. + * + * If unspecified, this rule will be inserted after all existing rules. * * Classes which extend this class: * - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById @@ -26,8 +28,7 @@ public class NetworkACLRuleBeforePrototype extends GenericModel { protected String id; protected String href; - protected NetworkACLRuleBeforePrototype() { - } + protected NetworkACLRuleBeforePrototype() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.java index 5e6c0c7a78..caf354ee69 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.java @@ -24,6 +24,11 @@ public class NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref extends N public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref instance. + * + * @param networkAclRuleBeforePrototypeNetworkAclRuleIdentityByHref the instance to initialize the Builder with + */ public Builder(NetworkACLRuleBeforePrototype networkAclRuleBeforePrototypeNetworkAclRuleIdentityByHref) { this.href = networkAclRuleBeforePrototypeNetworkAclRuleIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref() { } + protected NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.java index fce019b5af..bef68e8afb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.java @@ -24,6 +24,11 @@ public class NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById extends Net public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById instance. + * + * @param networkAclRuleBeforePrototypeNetworkAclRuleIdentityById the instance to initialize the Builder with + */ public Builder(NetworkACLRuleBeforePrototype networkAclRuleBeforePrototypeNetworkAclRuleIdentityById) { this.id = networkAclRuleBeforePrototypeNetworkAclRuleIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById() { } + protected NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollection.java index 2bbd2b1dae..0d1df54d55 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollection.java @@ -29,6 +29,8 @@ public class NetworkACLRuleCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected NetworkACLRuleCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionFirst.java index fce9a3e3b6..8e5c711fa3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionFirst.java @@ -21,6 +21,8 @@ public class NetworkACLRuleCollectionFirst extends GenericModel { protected String href; + protected NetworkACLRuleCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionNext.java index 0257df814b..9451145bb5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionNext.java @@ -21,6 +21,8 @@ public class NetworkACLRuleCollectionNext extends GenericModel { protected String href; + protected NetworkACLRuleCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItem.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItem.java index 0882b7b8e8..03e05b99b0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItem.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItem.java @@ -38,7 +38,7 @@ public class NetworkACLRuleItem extends GenericModel { } /** - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. */ public interface Action { /** allow. */ @@ -48,7 +48,7 @@ public interface Action { } /** - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. */ public interface Direction { /** inbound. */ @@ -63,8 +63,20 @@ public interface Direction { public interface IpVersion { /** ipv4. */ String IPV4 = "ipv4"; - /** ipv6. */ - String IPV6 = "ipv6"; + } + + /** + * The protocol to enforce. + */ + public interface Protocol { + /** all. */ + String ALL = "all"; + /** icmp. */ + String ICMP = "icmp"; + /** tcp. */ + String TCP = "tcp"; + /** udp. */ + String UDP = "udp"; } protected String action; @@ -91,13 +103,12 @@ public interface IpVersion { protected Long code; protected Long type; - protected NetworkACLRuleItem() { - } + protected NetworkACLRuleItem() { } /** * Gets the action. * - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. * * @return the action */ @@ -131,7 +142,7 @@ public Date getCreatedAt() { /** * Gets the destination. * - * The destination CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + * The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. * * @return the destination */ @@ -142,7 +153,7 @@ public String getDestination() { /** * Gets the direction. * - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. * * @return the direction */ @@ -186,8 +197,7 @@ public String getIpVersion() { /** * Gets the name. * - * The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If - * unspecified, the name will be a hyphenated list of randomly-selected words. + * The user-defined name for this network ACL rule. * * @return the name */ @@ -209,7 +219,7 @@ public String getProtocol() { /** * Gets the source. * - * The source CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + * The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. * * @return the source */ @@ -264,8 +274,9 @@ public Long getSourcePortMin() { /** * Gets the code. * - * The ICMP traffic code to allow. If unspecified, all codes are allowed. This can only be specified if type is also - * specified. + * The ICMP traffic code to match. + * + * If absent, all codes are matched. * * @return the code */ @@ -276,7 +287,9 @@ public Long getCode() { /** * Gets the type. * - * The ICMP traffic type to allow. If unspecified, all types are allowed by this rule. + * The ICMP traffic type to match. + * + * If absent, all types are matched. * * @return the type */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAll.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAll.java index 3a2ad806a1..b61f6145c7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAll.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAll.java @@ -18,7 +18,7 @@ public class NetworkACLRuleItemNetworkACLRuleProtocolAll extends NetworkACLRuleItem { /** - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. */ public interface Action { /** allow. */ @@ -28,7 +28,7 @@ public interface Action { } /** - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. */ public interface Direction { /** inbound. */ @@ -43,8 +43,6 @@ public interface Direction { public interface IpVersion { /** ipv4. */ String IPV4 = "ipv4"; - /** ipv6. */ - String IPV6 = "ipv6"; } /** @@ -55,5 +53,7 @@ public interface Protocol { String ALL = "all"; } + + protected NetworkACLRuleItemNetworkACLRuleProtocolAll() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolICMP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolICMP.java index f81eade24f..c4f3ec2fd1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolICMP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolICMP.java @@ -18,7 +18,7 @@ public class NetworkACLRuleItemNetworkACLRuleProtocolICMP extends NetworkACLRuleItem { /** - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. */ public interface Action { /** allow. */ @@ -28,7 +28,7 @@ public interface Action { } /** - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. */ public interface Direction { /** inbound. */ @@ -43,8 +43,6 @@ public interface Direction { public interface IpVersion { /** ipv4. */ String IPV4 = "ipv4"; - /** ipv6. */ - String IPV6 = "ipv6"; } /** @@ -55,5 +53,7 @@ public interface Protocol { String ICMP = "icmp"; } + + protected NetworkACLRuleItemNetworkACLRuleProtocolICMP() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.java index 0f7a502f6c..3c6eaf51f6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.java @@ -18,7 +18,7 @@ public class NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP extends NetworkACLRuleItem { /** - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. */ public interface Action { /** allow. */ @@ -28,7 +28,7 @@ public interface Action { } /** - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. */ public interface Direction { /** inbound. */ @@ -43,8 +43,6 @@ public interface Direction { public interface IpVersion { /** ipv4. */ String IPV4 = "ipv4"; - /** ipv6. */ - String IPV6 = "ipv6"; } /** @@ -57,5 +55,7 @@ public interface Protocol { String UDP = "udp"; } + + protected NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAll.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAll.java index 0c768f7095..fd329e9223 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAll.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAll.java @@ -18,7 +18,7 @@ public class NetworkACLRuleNetworkACLRuleProtocolAll extends NetworkACLRule { /** - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. */ public interface Action { /** allow. */ @@ -28,7 +28,7 @@ public interface Action { } /** - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. */ public interface Direction { /** inbound. */ @@ -43,8 +43,6 @@ public interface Direction { public interface IpVersion { /** ipv4. */ String IPV4 = "ipv4"; - /** ipv6. */ - String IPV6 = "ipv6"; } /** @@ -55,5 +53,7 @@ public interface Protocol { String ALL = "all"; } + + protected NetworkACLRuleNetworkACLRuleProtocolAll() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolICMP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolICMP.java index 23be76e2ee..aef36e3102 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolICMP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolICMP.java @@ -18,7 +18,7 @@ public class NetworkACLRuleNetworkACLRuleProtocolICMP extends NetworkACLRule { /** - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. */ public interface Action { /** allow. */ @@ -28,7 +28,7 @@ public interface Action { } /** - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. */ public interface Direction { /** inbound. */ @@ -43,8 +43,6 @@ public interface Direction { public interface IpVersion { /** ipv4. */ String IPV4 = "ipv4"; - /** ipv6. */ - String IPV6 = "ipv6"; } /** @@ -55,5 +53,7 @@ public interface Protocol { String ICMP = "icmp"; } + + protected NetworkACLRuleNetworkACLRuleProtocolICMP() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolTCPUDP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolTCPUDP.java index 47f8208e42..378aa31b61 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolTCPUDP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolTCPUDP.java @@ -18,7 +18,7 @@ public class NetworkACLRuleNetworkACLRuleProtocolTCPUDP extends NetworkACLRule { /** - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. */ public interface Action { /** allow. */ @@ -28,7 +28,7 @@ public interface Action { } /** - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. */ public interface Direction { /** inbound. */ @@ -43,8 +43,6 @@ public interface Direction { public interface IpVersion { /** ipv4. */ String IPV4 = "ipv4"; - /** ipv6. */ - String IPV6 = "ipv6"; } /** @@ -57,5 +55,7 @@ public interface Protocol { String UDP = "udp"; } + + protected NetworkACLRuleNetworkACLRuleProtocolTCPUDP() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePatch.java index 6327111ec7..9f7016bb8c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePatch.java @@ -24,7 +24,7 @@ public class NetworkACLRulePatch extends GenericModel { /** - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. */ public interface Action { /** allow. */ @@ -34,7 +34,7 @@ public interface Action { } /** - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. */ public interface Direction { /** inbound. */ @@ -43,6 +43,20 @@ public interface Direction { String OUTBOUND = "outbound"; } + /** + * The protocol to enforce. + */ + public interface Protocol { + /** all. */ + String ALL = "all"; + /** icmp. */ + String ICMP = "icmp"; + /** tcp. */ + String TCP = "tcp"; + /** udp. */ + String UDP = "udp"; + } + protected String action; protected NetworkACLRuleBeforePatch before; protected Long code; @@ -53,6 +67,7 @@ public interface Direction { protected Long destinationPortMin; protected String direction; protected String name; + protected String protocol; protected String source; @SerializedName("source_port_max") protected Long sourcePortMax; @@ -72,11 +87,17 @@ public static class Builder { private Long destinationPortMin; private String direction; private String name; + private String protocol; private String source; private Long sourcePortMax; private Long sourcePortMin; private Long type; + /** + * Instantiates a new Builder from an existing NetworkACLRulePatch instance. + * + * @param networkAclRulePatch the instance to initialize the Builder with + */ private Builder(NetworkACLRulePatch networkAclRulePatch) { this.action = networkAclRulePatch.action; this.before = networkAclRulePatch.before; @@ -86,6 +107,7 @@ private Builder(NetworkACLRulePatch networkAclRulePatch) { this.destinationPortMin = networkAclRulePatch.destinationPortMin; this.direction = networkAclRulePatch.direction; this.name = networkAclRulePatch.name; + this.protocol = networkAclRulePatch.protocol; this.source = networkAclRulePatch.source; this.sourcePortMax = networkAclRulePatch.sourcePortMax; this.sourcePortMin = networkAclRulePatch.sourcePortMin; @@ -195,6 +217,17 @@ public Builder name(String name) { return this; } + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the NetworkACLRulePatch builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + /** * Set the source. * @@ -240,6 +273,8 @@ public Builder type(long type) { } } + protected NetworkACLRulePatch() { } + protected NetworkACLRulePatch(Builder builder) { action = builder.action; before = builder.before; @@ -249,6 +284,7 @@ protected NetworkACLRulePatch(Builder builder) { destinationPortMin = builder.destinationPortMin; direction = builder.direction; name = builder.name; + protocol = builder.protocol; source = builder.source; sourcePortMax = builder.sourcePortMax; sourcePortMin = builder.sourcePortMin; @@ -267,7 +303,7 @@ public Builder newBuilder() { /** * Gets the action. * - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. * * @return the action */ @@ -278,8 +314,9 @@ public String action() { /** * Gets the before. * - * The rule to move this rule immediately before. Specify `null` to move this rule after - * all existing rules. + * The rule to move this rule immediately before. + * + * Specify `null` to move this rule after all existing rules. * * @return the before */ @@ -290,7 +327,7 @@ public NetworkACLRuleBeforePatch before() { /** * Gets the code. * - * The ICMP traffic code to allow. + * The ICMP traffic code to match. * * @return the code */ @@ -301,7 +338,7 @@ public Long code() { /** * Gets the destination. * - * The destination IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + * The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. * * @return the destination */ @@ -334,7 +371,7 @@ public Long destinationPortMin() { /** * Gets the direction. * - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. * * @return the direction */ @@ -353,10 +390,21 @@ public String name() { return name; } + /** + * Gets the protocol. + * + * The protocol to enforce. + * + * @return the protocol + */ + public String protocol() { + return protocol; + } + /** * Gets the source. * - * The source IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + * The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. * * @return the source */ @@ -389,7 +437,7 @@ public Long sourcePortMin() { /** * Gets the type. * - * The ICMP traffic type to allow. + * The ICMP traffic type to match. * * @return the type */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototype.java index 970041f20a..b0a04cf172 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototype.java @@ -19,9 +19,9 @@ * NetworkACLRulePrototype. * * Classes which extend this class: - * - NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP - * - NetworkACLRulePrototypeNetworkACLRuleProtocolICMP - * - NetworkACLRulePrototypeNetworkACLRuleProtocolAll + * - NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype + * - NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype + * - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype */ public class NetworkACLRulePrototype extends GenericModel { @SuppressWarnings("unused") @@ -29,14 +29,14 @@ public class NetworkACLRulePrototype extends GenericModel { protected static java.util.Map> discriminatorMapping; static { discriminatorMapping = new java.util.HashMap<>(); - discriminatorMapping.put("all", NetworkACLRulePrototypeNetworkACLRuleProtocolAll.class); - discriminatorMapping.put("icmp", NetworkACLRulePrototypeNetworkACLRuleProtocolICMP.class); - discriminatorMapping.put("tcp", NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP.class); - discriminatorMapping.put("udp", NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP.class); + discriminatorMapping.put("all", NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.class); + discriminatorMapping.put("icmp", NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.class); + discriminatorMapping.put("tcp", NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.class); + discriminatorMapping.put("udp", NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.class); } /** - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. */ public interface Action { /** allow. */ @@ -46,7 +46,7 @@ public interface Action { } /** - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. */ public interface Direction { /** inbound. */ @@ -55,6 +55,20 @@ public interface Direction { String OUTBOUND = "outbound"; } + /** + * The protocol to enforce. + */ + public interface Protocol { + /** all. */ + String ALL = "all"; + /** icmp. */ + String ICMP = "icmp"; + /** tcp. */ + String TCP = "tcp"; + /** udp. */ + String UDP = "udp"; + } + protected String action; protected NetworkACLRuleBeforePrototype before; protected String destination; @@ -73,13 +87,12 @@ public interface Direction { protected Long code; protected Long type; - protected NetworkACLRulePrototype() { - } + protected NetworkACLRulePrototype() { } /** * Gets the action. * - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. * * @return the action */ @@ -90,8 +103,9 @@ public String action() { /** * Gets the before. * - * The rule to insert this rule immediately before. If omitted, this rule will be - * inserted after all existing rules. + * The rule to insert this rule immediately before. + * + * If unspecified, this rule will be inserted after all existing rules. * * @return the before */ @@ -102,7 +116,7 @@ public NetworkACLRuleBeforePrototype before() { /** * Gets the destination. * - * The destination IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + * The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. * * @return the destination */ @@ -113,7 +127,7 @@ public String destination() { /** * Gets the direction. * - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. * * @return the direction */ @@ -147,7 +161,7 @@ public String protocol() { /** * Gets the source. * - * The source IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + * The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. * * @return the source */ @@ -202,8 +216,9 @@ public Long sourcePortMin() { /** * Gets the code. * - * The ICMP traffic code to allow. If unspecified, all codes are allowed. This can only be specified if type is also - * specified. + * The ICMP traffic code to match. + * + * If specified, `type` must also be specified. If unspecified, all codes are matched. * * @return the code */ @@ -214,7 +229,9 @@ public Long code() { /** * Gets the type. * - * The ICMP traffic type to allow. If unspecified, all types are allowed by this rule. + * The ICMP traffic type to match. + * + * If unspecified, all types are matched. * * @return the type */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContext.java index 851084a624..bc7d09927a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContext.java @@ -19,9 +19,9 @@ * NetworkACLRulePrototypeNetworkACLContext. * * Classes which extend this class: - * - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP - * - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP - * - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll + * - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype + * - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype + * - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype */ public class NetworkACLRulePrototypeNetworkACLContext extends GenericModel { @SuppressWarnings("unused") @@ -29,14 +29,14 @@ public class NetworkACLRulePrototypeNetworkACLContext extends GenericModel { protected static java.util.Map> discriminatorMapping; static { discriminatorMapping = new java.util.HashMap<>(); - discriminatorMapping.put("all", NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll.class); - discriminatorMapping.put("icmp", NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP.class); - discriminatorMapping.put("tcp", NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP.class); - discriminatorMapping.put("udp", NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP.class); + discriminatorMapping.put("all", NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.class); + discriminatorMapping.put("icmp", NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.class); + discriminatorMapping.put("tcp", NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.class); + discriminatorMapping.put("udp", NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.class); } /** - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. */ public interface Action { /** allow. */ @@ -46,7 +46,7 @@ public interface Action { } /** - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. */ public interface Direction { /** inbound. */ @@ -55,6 +55,20 @@ public interface Direction { String OUTBOUND = "outbound"; } + /** + * The protocol to enforce. + */ + public interface Protocol { + /** all. */ + String ALL = "all"; + /** icmp. */ + String ICMP = "icmp"; + /** tcp. */ + String TCP = "tcp"; + /** udp. */ + String UDP = "udp"; + } + protected String action; protected String destination; protected String direction; @@ -72,13 +86,12 @@ public interface Direction { protected Long code; protected Long type; - protected NetworkACLRulePrototypeNetworkACLContext() { - } + protected NetworkACLRulePrototypeNetworkACLContext() { } /** * Gets the action. * - * Whether to allow or deny matching traffic. + * The action to perform for a packet matching the rule. * * @return the action */ @@ -89,7 +102,7 @@ public String action() { /** * Gets the destination. * - * The destination IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + * The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. * * @return the destination */ @@ -100,7 +113,7 @@ public String destination() { /** * Gets the direction. * - * Whether the traffic to be matched is `inbound` or `outbound`. + * The direction of traffic to match. * * @return the direction */ @@ -134,7 +147,7 @@ public String protocol() { /** * Gets the source. * - * The source IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + * The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. * * @return the source */ @@ -189,8 +202,9 @@ public Long sourcePortMin() { /** * Gets the code. * - * The ICMP traffic code to allow. If unspecified, all codes are allowed. This can only be specified if type is also - * specified. + * The ICMP traffic code to match. + * + * If specified, `type` must also be specified. If unspecified, all codes are matched. * * @return the code */ @@ -201,7 +215,9 @@ public Long code() { /** * Gets the type. * - * The ICMP traffic type to allow. If unspecified, all types are allowed by this rule. + * The ICMP traffic type to match. + * + * If unspecified, all types are matched. * * @return the type */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.java new file mode 100644 index 0000000000..1851b6f346 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.java @@ -0,0 +1,203 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype. + */ +public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype extends NetworkACLRulePrototypeNetworkACLContext { + + /** + * The action to perform for a packet matching the rule. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The protocol to enforce. + */ + public interface Protocol { + /** all. */ + String ALL = "all"; + } + + + /** + * Builder. + */ + public static class Builder { + private String action; + private String destination; + private String direction; + private String name; + private String source; + private String protocol; + + /** + * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype instance. + * + * @param networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype the instance to initialize the Builder with + */ + public Builder(NetworkACLRulePrototypeNetworkACLContext networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype) { + this.action = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype.action; + this.destination = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype.destination; + this.direction = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype.direction; + this.name = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype.name; + this.source = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype.source; + this.protocol = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype.protocol; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param action the action + * @param destination the destination + * @param direction the direction + * @param source the source + * @param protocol the protocol + */ + public Builder(String action, String destination, String direction, String source, String protocol) { + this.action = action; + this.destination = destination; + this.direction = direction; + this.source = source; + this.protocol = protocol; + } + + /** + * Builds a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype. + * + * @return the new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype instance + */ + public NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype build() { + return new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(this); + } + + /** + * Set the action. + * + * @param action the action + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + */ + public Builder action(String action) { + this.action = action; + return this; + } + + /** + * Set the destination. + * + * @param destination the destination + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + */ + public Builder destination(String destination) { + this.destination = destination; + return this; + } + + /** + * Set the direction. + * + * @param direction the direction + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + */ + public Builder direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the source. + * + * @param source the source + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + */ + public Builder source(String source) { + this.source = source; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + } + + protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype() { } + + protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, + "action cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.destination, + "destination cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, + "direction cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.source, + "source cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, + "protocol cannot be null"); + action = builder.action; + destination = builder.destination; + direction = builder.direction; + name = builder.name; + source = builder.source; + protocol = builder.protocol; + } + + /** + * New builder. + * + * @return a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.java new file mode 100644 index 0000000000..f5d9e315f2 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.java @@ -0,0 +1,231 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype. + */ +public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype extends NetworkACLRulePrototypeNetworkACLContext { + + /** + * The action to perform for a packet matching the rule. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The protocol to enforce. + */ + public interface Protocol { + /** icmp. */ + String ICMP = "icmp"; + } + + + /** + * Builder. + */ + public static class Builder { + private String action; + private String destination; + private String direction; + private String name; + private String source; + private Long code; + private String protocol; + private Long type; + + /** + * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype instance. + * + * @param networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototype the instance to initialize the Builder with + */ + public Builder(NetworkACLRulePrototypeNetworkACLContext networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototype) { + this.action = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototype.action; + this.destination = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototype.destination; + this.direction = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototype.direction; + this.name = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototype.name; + this.source = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototype.source; + this.code = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototype.code; + this.protocol = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototype.protocol; + this.type = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototype.type; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param action the action + * @param destination the destination + * @param direction the direction + * @param source the source + * @param protocol the protocol + */ + public Builder(String action, String destination, String direction, String source, String protocol) { + this.action = action; + this.destination = destination; + this.direction = direction; + this.source = source; + this.protocol = protocol; + } + + /** + * Builds a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype. + * + * @return the new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype instance + */ + public NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype build() { + return new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype(this); + } + + /** + * Set the action. + * + * @param action the action + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder action(String action) { + this.action = action; + return this; + } + + /** + * Set the destination. + * + * @param destination the destination + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder destination(String destination) { + this.destination = destination; + return this; + } + + /** + * Set the direction. + * + * @param direction the direction + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the source. + * + * @param source the source + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder source(String source) { + this.source = source; + return this; + } + + /** + * Set the code. + * + * @param code the code + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder code(long code) { + this.code = code; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Set the type. + * + * @param type the type + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder type(long type) { + this.type = type; + return this; + } + } + + protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype() { } + + protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, + "action cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.destination, + "destination cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, + "direction cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.source, + "source cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, + "protocol cannot be null"); + action = builder.action; + destination = builder.destination; + direction = builder.direction; + name = builder.name; + source = builder.source; + code = builder.code; + protocol = builder.protocol; + type = builder.type; + } + + /** + * New builder. + * + * @return a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.java new file mode 100644 index 0000000000..b9e11f78ec --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.java @@ -0,0 +1,261 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype. + */ +public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype extends NetworkACLRulePrototypeNetworkACLContext { + + /** + * The action to perform for a packet matching the rule. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The protocol to enforce. + */ + public interface Protocol { + /** tcp. */ + String TCP = "tcp"; + /** udp. */ + String UDP = "udp"; + } + + + /** + * Builder. + */ + public static class Builder { + private String action; + private String destination; + private String direction; + private String name; + private String source; + private Long destinationPortMax; + private Long destinationPortMin; + private String protocol; + private Long sourcePortMax; + private Long sourcePortMin; + + /** + * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype instance. + * + * @param networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototype the instance to initialize the Builder with + */ + public Builder(NetworkACLRulePrototypeNetworkACLContext networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototype) { + this.action = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototype.action; + this.destination = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototype.destination; + this.direction = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototype.direction; + this.name = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototype.name; + this.source = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototype.source; + this.destinationPortMax = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototype.destinationPortMax; + this.destinationPortMin = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototype.destinationPortMin; + this.protocol = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototype.protocol; + this.sourcePortMax = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototype.sourcePortMax; + this.sourcePortMin = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototype.sourcePortMin; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param action the action + * @param destination the destination + * @param direction the direction + * @param source the source + * @param protocol the protocol + */ + public Builder(String action, String destination, String direction, String source, String protocol) { + this.action = action; + this.destination = destination; + this.direction = direction; + this.source = source; + this.protocol = protocol; + } + + /** + * Builds a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype. + * + * @return the new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype instance + */ + public NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype build() { + return new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype(this); + } + + /** + * Set the action. + * + * @param action the action + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder action(String action) { + this.action = action; + return this; + } + + /** + * Set the destination. + * + * @param destination the destination + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder destination(String destination) { + this.destination = destination; + return this; + } + + /** + * Set the direction. + * + * @param direction the direction + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the source. + * + * @param source the source + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder source(String source) { + this.source = source; + return this; + } + + /** + * Set the destinationPortMax. + * + * @param destinationPortMax the destinationPortMax + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder destinationPortMax(long destinationPortMax) { + this.destinationPortMax = destinationPortMax; + return this; + } + + /** + * Set the destinationPortMin. + * + * @param destinationPortMin the destinationPortMin + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder destinationPortMin(long destinationPortMin) { + this.destinationPortMin = destinationPortMin; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Set the sourcePortMax. + * + * @param sourcePortMax the sourcePortMax + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder sourcePortMax(long sourcePortMax) { + this.sourcePortMax = sourcePortMax; + return this; + } + + /** + * Set the sourcePortMin. + * + * @param sourcePortMin the sourcePortMin + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder sourcePortMin(long sourcePortMin) { + this.sourcePortMin = sourcePortMin; + return this; + } + } + + protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype() { } + + protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, + "action cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.destination, + "destination cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, + "direction cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.source, + "source cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, + "protocol cannot be null"); + action = builder.action; + destination = builder.destination; + direction = builder.direction; + name = builder.name; + source = builder.source; + destinationPortMax = builder.destinationPortMax; + destinationPortMin = builder.destinationPortMin; + protocol = builder.protocol; + sourcePortMax = builder.sourcePortMax; + sourcePortMin = builder.sourcePortMin; + } + + /** + * New builder. + * + * @return a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.java new file mode 100644 index 0000000000..d57553d2e1 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.java @@ -0,0 +1,217 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype. + */ +public class NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype extends NetworkACLRulePrototype { + + /** + * The action to perform for a packet matching the rule. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The protocol to enforce. + */ + public interface Protocol { + /** all. */ + String ALL = "all"; + } + + + /** + * Builder. + */ + public static class Builder { + private String action; + private NetworkACLRuleBeforePrototype before; + private String destination; + private String direction; + private String name; + private String source; + private String protocol; + + /** + * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype instance. + * + * @param networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype the instance to initialize the Builder with + */ + public Builder(NetworkACLRulePrototype networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype) { + this.action = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.action; + this.before = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.before; + this.destination = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.destination; + this.direction = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.direction; + this.name = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.name; + this.source = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.source; + this.protocol = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.protocol; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param action the action + * @param destination the destination + * @param direction the direction + * @param source the source + * @param protocol the protocol + */ + public Builder(String action, String destination, String direction, String source, String protocol) { + this.action = action; + this.destination = destination; + this.direction = direction; + this.source = source; + this.protocol = protocol; + } + + /** + * Builds a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype. + * + * @return the new NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype instance + */ + public NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype build() { + return new NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(this); + } + + /** + * Set the action. + * + * @param action the action + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + */ + public Builder action(String action) { + this.action = action; + return this; + } + + /** + * Set the before. + * + * @param before the before + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + */ + public Builder before(NetworkACLRuleBeforePrototype before) { + this.before = before; + return this; + } + + /** + * Set the destination. + * + * @param destination the destination + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + */ + public Builder destination(String destination) { + this.destination = destination; + return this; + } + + /** + * Set the direction. + * + * @param direction the direction + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + */ + public Builder direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the source. + * + * @param source the source + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + */ + public Builder source(String source) { + this.source = source; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + } + + protected NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype() { } + + protected NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, + "action cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.destination, + "destination cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, + "direction cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.source, + "source cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, + "protocol cannot be null"); + action = builder.action; + before = builder.before; + destination = builder.destination; + direction = builder.direction; + name = builder.name; + source = builder.source; + protocol = builder.protocol; + } + + /** + * New builder. + * + * @return a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.java new file mode 100644 index 0000000000..f76f20a0ee --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.java @@ -0,0 +1,245 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype. + */ +public class NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype extends NetworkACLRulePrototype { + + /** + * The action to perform for a packet matching the rule. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The protocol to enforce. + */ + public interface Protocol { + /** icmp. */ + String ICMP = "icmp"; + } + + + /** + * Builder. + */ + public static class Builder { + private String action; + private NetworkACLRuleBeforePrototype before; + private String destination; + private String direction; + private String name; + private String source; + private Long code; + private String protocol; + private Long type; + + /** + * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype instance. + * + * @param networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototype the instance to initialize the Builder with + */ + public Builder(NetworkACLRulePrototype networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototype) { + this.action = networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototype.action; + this.before = networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototype.before; + this.destination = networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototype.destination; + this.direction = networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototype.direction; + this.name = networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototype.name; + this.source = networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototype.source; + this.code = networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototype.code; + this.protocol = networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototype.protocol; + this.type = networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototype.type; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param action the action + * @param destination the destination + * @param direction the direction + * @param source the source + * @param protocol the protocol + */ + public Builder(String action, String destination, String direction, String source, String protocol) { + this.action = action; + this.destination = destination; + this.direction = direction; + this.source = source; + this.protocol = protocol; + } + + /** + * Builds a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype. + * + * @return the new NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype instance + */ + public NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype build() { + return new NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype(this); + } + + /** + * Set the action. + * + * @param action the action + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder action(String action) { + this.action = action; + return this; + } + + /** + * Set the before. + * + * @param before the before + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder before(NetworkACLRuleBeforePrototype before) { + this.before = before; + return this; + } + + /** + * Set the destination. + * + * @param destination the destination + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder destination(String destination) { + this.destination = destination; + return this; + } + + /** + * Set the direction. + * + * @param direction the direction + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the source. + * + * @param source the source + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder source(String source) { + this.source = source; + return this; + } + + /** + * Set the code. + * + * @param code the code + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder code(long code) { + this.code = code; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Set the type. + * + * @param type the type + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder type(long type) { + this.type = type; + return this; + } + } + + protected NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype() { } + + protected NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, + "action cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.destination, + "destination cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, + "direction cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.source, + "source cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, + "protocol cannot be null"); + action = builder.action; + before = builder.before; + destination = builder.destination; + direction = builder.direction; + name = builder.name; + source = builder.source; + code = builder.code; + protocol = builder.protocol; + type = builder.type; + } + + /** + * New builder. + * + * @return a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.java new file mode 100644 index 0000000000..1d077358ef --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.java @@ -0,0 +1,275 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype. + */ +public class NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype extends NetworkACLRulePrototype { + + /** + * The action to perform for a packet matching the rule. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The protocol to enforce. + */ + public interface Protocol { + /** tcp. */ + String TCP = "tcp"; + /** udp. */ + String UDP = "udp"; + } + + + /** + * Builder. + */ + public static class Builder { + private String action; + private NetworkACLRuleBeforePrototype before; + private String destination; + private String direction; + private String name; + private String source; + private Long destinationPortMax; + private Long destinationPortMin; + private String protocol; + private Long sourcePortMax; + private Long sourcePortMin; + + /** + * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype instance. + * + * @param networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototype the instance to initialize the Builder with + */ + public Builder(NetworkACLRulePrototype networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototype) { + this.action = networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototype.action; + this.before = networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototype.before; + this.destination = networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototype.destination; + this.direction = networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototype.direction; + this.name = networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototype.name; + this.source = networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototype.source; + this.destinationPortMax = networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototype.destinationPortMax; + this.destinationPortMin = networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototype.destinationPortMin; + this.protocol = networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototype.protocol; + this.sourcePortMax = networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototype.sourcePortMax; + this.sourcePortMin = networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototype.sourcePortMin; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param action the action + * @param destination the destination + * @param direction the direction + * @param source the source + * @param protocol the protocol + */ + public Builder(String action, String destination, String direction, String source, String protocol) { + this.action = action; + this.destination = destination; + this.direction = direction; + this.source = source; + this.protocol = protocol; + } + + /** + * Builds a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype. + * + * @return the new NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype instance + */ + public NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype build() { + return new NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype(this); + } + + /** + * Set the action. + * + * @param action the action + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder action(String action) { + this.action = action; + return this; + } + + /** + * Set the before. + * + * @param before the before + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder before(NetworkACLRuleBeforePrototype before) { + this.before = before; + return this; + } + + /** + * Set the destination. + * + * @param destination the destination + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder destination(String destination) { + this.destination = destination; + return this; + } + + /** + * Set the direction. + * + * @param direction the direction + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the source. + * + * @param source the source + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder source(String source) { + this.source = source; + return this; + } + + /** + * Set the destinationPortMax. + * + * @param destinationPortMax the destinationPortMax + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder destinationPortMax(long destinationPortMax) { + this.destinationPortMax = destinationPortMax; + return this; + } + + /** + * Set the destinationPortMin. + * + * @param destinationPortMin the destinationPortMin + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder destinationPortMin(long destinationPortMin) { + this.destinationPortMin = destinationPortMin; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Set the sourcePortMax. + * + * @param sourcePortMax the sourcePortMax + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder sourcePortMax(long sourcePortMax) { + this.sourcePortMax = sourcePortMax; + return this; + } + + /** + * Set the sourcePortMin. + * + * @param sourcePortMin the sourcePortMin + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder sourcePortMin(long sourcePortMin) { + this.sourcePortMin = sourcePortMin; + return this; + } + } + + protected NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype() { } + + protected NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, + "action cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.destination, + "destination cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, + "direction cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.source, + "source cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, + "protocol cannot be null"); + action = builder.action; + before = builder.before; + destination = builder.destination; + direction = builder.direction; + name = builder.name; + source = builder.source; + destinationPortMax = builder.destinationPortMax; + destinationPortMin = builder.destinationPortMin; + protocol = builder.protocol; + sourcePortMax = builder.sourcePortMax; + sourcePortMin = builder.sourcePortMin; + } + + /** + * New builder. + * + * @return a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleReference.java index 74350e4e61..59e29bdd39 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleReference.java @@ -24,10 +24,12 @@ public class NetworkACLRuleReference extends GenericModel { protected String id; protected String name; + protected NetworkACLRuleReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleReferenceDeleted.java index dccc65dec9..c314cd3459 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class NetworkACLRuleReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class NetworkACLRuleReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected NetworkACLRuleReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkAclRulesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkAclRulesPager.java new file mode 100644 index 0000000000..f419b4b331 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkAclRulesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * NetworkAclRulesPager can be used to simplify the use of the "listNetworkAclRules" method. + */ +public class NetworkAclRulesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListNetworkAclRulesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected NetworkAclRulesPager() { } + + /** + * Constructs a new NetworkAclRulesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listNetworkAclRules" method + * @param options the ListNetworkAclRulesOptions instance to be used to invoke the "listNetworkAclRules" method + */ + public NetworkAclRulesPager(Vpc client, ListNetworkAclRulesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<NetworkACLRuleItem> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListNetworkAclRulesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + NetworkACLRuleCollection result = client.listNetworkAclRules(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getRules(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<NetworkACLRuleItem> containing all results returned by the "listNetworkAclRules" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkAclsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkAclsPager.java new file mode 100644 index 0000000000..3cd068b2d3 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkAclsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * NetworkAclsPager can be used to simplify the use of the "listNetworkAcls" method. + */ +public class NetworkAclsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListNetworkAclsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected NetworkAclsPager() { } + + /** + * Constructs a new NetworkAclsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listNetworkAcls" method + * @param options the ListNetworkAclsOptions instance to be used to invoke the "listNetworkAcls" method + */ + public NetworkAclsPager(Vpc client, ListNetworkAclsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<NetworkACL> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListNetworkAclsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + NetworkACLCollection result = client.listNetworkAcls(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getNetworkAcls(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<NetworkACL> containing all results returned by the "listNetworkAcls" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterface.java index a06ea1b6c5..b8fa2985ab 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterface.java @@ -76,6 +76,8 @@ public interface Type { protected SubnetReference subnet; protected String type; + protected NetworkInterface() { } + /** * Gets the allowIpSpoofing. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceBareMetalServerContextReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceBareMetalServerContextReference.java index 6de26db08c..a9393cab3f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceBareMetalServerContextReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceBareMetalServerContextReference.java @@ -38,10 +38,12 @@ public interface ResourceType { protected String resourceType; protected SubnetReference subnet; + protected NetworkInterfaceBareMetalServerContextReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceBareMetalServerContextReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceBareMetalServerContextReferenceDeleted.java index 43ce8371f4..5b42ea639a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceBareMetalServerContextReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceBareMetalServerContextReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class NetworkInterfaceBareMetalServerContextReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class NetworkInterfaceBareMetalServerContextReferenceDeleted extends Gene @SerializedName("more_info") protected String moreInfo; + protected NetworkInterfaceBareMetalServerContextReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototype.java index 2ab68d6386..35be5624d7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototype.java @@ -31,8 +31,7 @@ public class NetworkInterfaceIPPrototype extends GenericModel { protected Boolean autoDelete; protected String name; - protected NetworkInterfaceIPPrototype() { - } + protected NetworkInterfaceIPPrototype() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPIdentity.java index 607f91d479..aa5155f553 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPIdentity.java @@ -22,7 +22,6 @@ public class NetworkInterfaceIPPrototypeReservedIPIdentity extends NetworkInterfaceIPPrototype { - protected NetworkInterfaceIPPrototypeReservedIPIdentity() { - } + protected NetworkInterfaceIPPrototypeReservedIPIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref.java index 3614635bc0..3d209dfd64 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref.java @@ -24,6 +24,11 @@ public class NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHr public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref instance. + * + * @param networkInterfaceIpPrototypeReservedIpIdentityReservedIpIdentityByHref the instance to initialize the Builder with + */ public Builder(NetworkInterfaceIPPrototypeReservedIPIdentity networkInterfaceIpPrototypeReservedIpIdentityReservedIpIdentityByHref) { this.href = networkInterfaceIpPrototypeReservedIpIdentityReservedIpIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref() { } + protected NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById.java index c0729f92a1..3015d79ae2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById.java @@ -24,6 +24,11 @@ public class NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById instance. + * + * @param networkInterfaceIpPrototypeReservedIpIdentityReservedIpIdentityById the instance to initialize the Builder with + */ public Builder(NetworkInterfaceIPPrototypeReservedIPIdentity networkInterfaceIpPrototypeReservedIpIdentityReservedIpIdentityById) { this.id = networkInterfaceIpPrototypeReservedIpIdentityReservedIpIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById() { } + protected NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.java index e550d14018..fb053f9a7a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.java @@ -26,6 +26,11 @@ public static class Builder { private Boolean autoDelete; private String name; + /** + * Instantiates a new Builder from an existing NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext instance. + * + * @param networkInterfaceIpPrototypeReservedIpPrototypeNetworkInterfaceContext the instance to initialize the Builder with + */ public Builder(NetworkInterfaceIPPrototype networkInterfaceIpPrototypeReservedIpPrototypeNetworkInterfaceContext) { this.address = networkInterfaceIpPrototypeReservedIpPrototypeNetworkInterfaceContext.address; this.autoDelete = networkInterfaceIpPrototypeReservedIpPrototypeNetworkInterfaceContext.autoDelete; @@ -81,6 +86,8 @@ public Builder name(String name) { } } + protected NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext() { } + protected NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(Builder builder) { address = builder.address; autoDelete = builder.autoDelete; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceInstanceContextReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceInstanceContextReference.java index 07029de34d..2f5ffa3e71 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceInstanceContextReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceInstanceContextReference.java @@ -38,10 +38,12 @@ public interface ResourceType { protected String resourceType; protected SubnetReference subnet; + protected NetworkInterfaceInstanceContextReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceInstanceContextReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceInstanceContextReferenceDeleted.java index 69e9c33a4f..bed4e0c52f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceInstanceContextReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceInstanceContextReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class NetworkInterfaceInstanceContextReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class NetworkInterfaceInstanceContextReferenceDeleted extends GenericMode @SerializedName("more_info") protected String moreInfo; + protected NetworkInterfaceInstanceContextReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePatch.java index b4fb7b0a2a..232935ae63 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePatch.java @@ -34,6 +34,11 @@ public static class Builder { private Boolean allowIpSpoofing; private String name; + /** + * Instantiates a new Builder from an existing NetworkInterfacePatch instance. + * + * @param networkInterfacePatch the instance to initialize the Builder with + */ private Builder(NetworkInterfacePatch networkInterfacePatch) { this.allowIpSpoofing = networkInterfacePatch.allowIpSpoofing; this.name = networkInterfacePatch.name; @@ -77,6 +82,8 @@ public Builder name(String name) { } } + protected NetworkInterfacePatch() { } + protected NetworkInterfacePatch(Builder builder) { allowIpSpoofing = builder.allowIpSpoofing; name = builder.name; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePrototype.java index d41f7fc043..f0abce3fc7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePrototype.java @@ -42,6 +42,11 @@ public static class Builder { private List securityGroups; private SubnetIdentity subnet; + /** + * Instantiates a new Builder from an existing NetworkInterfacePrototype instance. + * + * @param networkInterfacePrototype the instance to initialize the Builder with + */ private Builder(NetworkInterfacePrototype networkInterfacePrototype) { this.allowIpSpoofing = networkInterfacePrototype.allowIpSpoofing; this.name = networkInterfacePrototype.name; @@ -147,6 +152,8 @@ public Builder subnet(SubnetIdentity subnet) { } } + protected NetworkInterfacePrototype() { } + protected NetworkInterfacePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.subnet, "subnet cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceReferenceDeleted.java index fb6056da59..7b651e8a49 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class NetworkInterfaceReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class NetworkInterfaceReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected NetworkInterfaceReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceReferenceTargetContextDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceReferenceTargetContextDeleted.java index 9156fb698f..c7f5213eed 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceReferenceTargetContextDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceReferenceTargetContextDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class NetworkInterfaceReferenceTargetContextDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class NetworkInterfaceReferenceTargetContextDeleted extends GenericModel @SerializedName("more_info") protected String moreInfo; + protected NetworkInterfaceReferenceTargetContextDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceUnpaginatedCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceUnpaginatedCollection.java index 2e68cf088d..2d981d23ff 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceUnpaginatedCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceUnpaginatedCollection.java @@ -25,6 +25,8 @@ public class NetworkInterfaceUnpaginatedCollection extends GenericModel { @SerializedName("network_interfaces") protected List networkInterfaces; + protected NetworkInterfaceUnpaginatedCollection() { } + /** * Gets the networkInterfaces. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystem.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystem.java index 1f2001be66..b648981e04 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystem.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystem.java @@ -31,6 +31,8 @@ public class OperatingSystem extends GenericModel { protected String vendor; protected String version; + protected OperatingSystem() { } + /** * Gets the architecture. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollection.java index 8120cc2b25..5198c159b7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollection.java @@ -28,6 +28,8 @@ public class OperatingSystemCollection extends GenericModel { @SerializedName("operating_systems") protected List operatingSystems; + protected OperatingSystemCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollectionFirst.java index d00121476d..1f3a11d1e8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollectionFirst.java @@ -21,6 +21,8 @@ public class OperatingSystemCollectionFirst extends GenericModel { protected String href; + protected OperatingSystemCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollectionNext.java index 69a0093661..a8d8b73463 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollectionNext.java @@ -21,6 +21,8 @@ public class OperatingSystemCollectionNext extends GenericModel { protected String href; + protected OperatingSystemCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemIdentity.java index bada65366f..e795aa6e68 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemIdentity.java @@ -26,8 +26,7 @@ public class OperatingSystemIdentity extends GenericModel { protected String name; protected String href; - protected OperatingSystemIdentity() { - } + protected OperatingSystemIdentity() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemIdentityByHref.java index d2d63ac769..54b9206a25 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemIdentityByHref.java @@ -24,6 +24,11 @@ public class OperatingSystemIdentityByHref extends OperatingSystemIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing OperatingSystemIdentityByHref instance. + * + * @param operatingSystemIdentityByHref the instance to initialize the Builder with + */ public Builder(OperatingSystemIdentity operatingSystemIdentityByHref) { this.href = operatingSystemIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected OperatingSystemIdentityByHref() { } + protected OperatingSystemIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemIdentityByName.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemIdentityByName.java index 6012c7c54e..21979fc8d6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemIdentityByName.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemIdentityByName.java @@ -24,6 +24,11 @@ public class OperatingSystemIdentityByName extends OperatingSystemIdentity { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing OperatingSystemIdentityByName instance. + * + * @param operatingSystemIdentityByName the instance to initialize the Builder with + */ public Builder(OperatingSystemIdentity operatingSystemIdentityByName) { this.name = operatingSystemIdentityByName.name; } @@ -64,6 +69,8 @@ public Builder name(String name) { } } + protected OperatingSystemIdentityByName() { } + protected OperatingSystemIdentityByName(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemReference.java index 3352946c98..24684fc043 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemReference.java @@ -22,6 +22,8 @@ public class OperatingSystemReference extends GenericModel { protected String href; protected String name; + protected OperatingSystemReference() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemsPager.java new file mode 100644 index 0000000000..9db017e48f --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * OperatingSystemsPager can be used to simplify the use of the "listOperatingSystems" method. + */ +public class OperatingSystemsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListOperatingSystemsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected OperatingSystemsPager() { } + + /** + * Constructs a new OperatingSystemsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listOperatingSystems" method + * @param options the ListOperatingSystemsOptions instance to be used to invoke the "listOperatingSystems" method + */ + public OperatingSystemsPager(Vpc client, ListOperatingSystemsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<OperatingSystem> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListOperatingSystemsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + OperatingSystemCollection result = client.listOperatingSystems(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getOperatingSystems(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<OperatingSystem> containing all results returned by the "listOperatingSystems" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroup.java index 3a36c09f5d..61aa31b599 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroup.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroup.java @@ -80,6 +80,8 @@ public interface Strategy { protected String resourceType; protected String strategy; + protected PlacementGroup() { } + /** * Gets the createdAt. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupCollection.java index 56e0af9480..d4fe520abc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupCollection.java @@ -30,6 +30,8 @@ public class PlacementGroupCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected PlacementGroupCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupCollectionFirst.java index f4e1775da2..9953ae0861 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupCollectionFirst.java @@ -21,6 +21,8 @@ public class PlacementGroupCollectionFirst extends GenericModel { protected String href; + protected PlacementGroupCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupCollectionNext.java index c65fd48ed7..18fecf4620 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupCollectionNext.java @@ -21,6 +21,8 @@ public class PlacementGroupCollectionNext extends GenericModel { protected String href; + protected PlacementGroupCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupPatch.java index 9a242cecc3..912939057a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupPatch.java @@ -30,6 +30,11 @@ public class PlacementGroupPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing PlacementGroupPatch instance. + * + * @param placementGroupPatch the instance to initialize the Builder with + */ private Builder(PlacementGroupPatch placementGroupPatch) { this.name = placementGroupPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected PlacementGroupPatch() { } + protected PlacementGroupPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupReferenceDeleted.java index 5e4efc810c..9e2446c54c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class PlacementGroupReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class PlacementGroupReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected PlacementGroupReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupsPager.java new file mode 100644 index 0000000000..b11229ca09 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PlacementGroupsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * PlacementGroupsPager can be used to simplify the use of the "listPlacementGroups" method. + */ +public class PlacementGroupsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListPlacementGroupsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected PlacementGroupsPager() { } + + /** + * Constructs a new PlacementGroupsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listPlacementGroups" method + * @param options the ListPlacementGroupsOptions instance to be used to invoke the "listPlacementGroups" method + */ + public PlacementGroupsPager(Vpc client, ListPlacementGroupsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<PlacementGroup> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListPlacementGroupsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + PlacementGroupCollection result = client.listPlacementGroups(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getPlacementGroups(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<PlacementGroup> containing all results returned by the "listPlacementGroups" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGateway.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGateway.java index 685d098120..53b4c2ee54 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGateway.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGateway.java @@ -31,7 +31,7 @@ public interface ResourceType { } /** - * The status of the volume. + * The status of this public gateway. */ public interface Status { /** available. */ @@ -60,6 +60,8 @@ public interface Status { protected VPCReference vpc; protected ZoneReference zone; + protected PublicGateway() { } + /** * Gets the createdAt. * @@ -151,7 +153,7 @@ public String getResourceType() { /** * Gets the status. * - * The status of the volume. + * The status of this public gateway. * * @return the status */ @@ -162,7 +164,7 @@ public String getStatus() { /** * Gets the vpc. * - * The VPC this public gateway serves. + * The VPC this public gateway resides in. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayCollection.java index 65dda57fa9..118317243f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayCollection.java @@ -30,6 +30,8 @@ public class PublicGatewayCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected PublicGatewayCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayCollectionFirst.java index 65963e2bf5..0e19ca3987 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayCollectionFirst.java @@ -21,6 +21,8 @@ public class PublicGatewayCollectionFirst extends GenericModel { protected String href; + protected PublicGatewayCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayCollectionNext.java index 67d5ccd504..c3c2a318e4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayCollectionNext.java @@ -21,6 +21,8 @@ public class PublicGatewayCollectionNext extends GenericModel { protected String href; + protected PublicGatewayCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototype.java index c602e46d1a..27386635dc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototype.java @@ -32,8 +32,7 @@ public class PublicGatewayFloatingIPPrototype extends GenericModel { @SerializedName("resource_group") protected ResourceGroupIdentity resourceGroup; - protected PublicGatewayFloatingIPPrototype() { - } + protected PublicGatewayFloatingIPPrototype() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentity.java index 20af80b83c..442f8de9ee 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentity.java @@ -24,7 +24,6 @@ public class PublicGatewayFloatingIPPrototypeFloatingIPIdentity extends PublicGatewayFloatingIPPrototype { - protected PublicGatewayFloatingIPPrototypeFloatingIPIdentity() { - } + protected PublicGatewayFloatingIPPrototypeFloatingIPIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress.java index 2619c5fbcd..88444d3cf4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress.java @@ -24,6 +24,11 @@ public class PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentit public static class Builder { private String address; + /** + * Instantiates a new Builder from an existing PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress instance. + * + * @param publicGatewayFloatingIpPrototypeFloatingIpIdentityFloatingIpIdentityByAddress the instance to initialize the Builder with + */ public Builder(PublicGatewayFloatingIPPrototypeFloatingIPIdentity publicGatewayFloatingIpPrototypeFloatingIpIdentityFloatingIpIdentityByAddress) { this.address = publicGatewayFloatingIpPrototypeFloatingIpIdentityFloatingIpIdentityByAddress.address; } @@ -64,6 +69,8 @@ public Builder address(String address) { } } + protected PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress() { } + protected PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.address, "address cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN.java index b971952c24..7ea44ffdad 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN.java @@ -24,6 +24,11 @@ public class PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentit public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN instance. + * + * @param publicGatewayFloatingIpPrototypeFloatingIpIdentityFloatingIpIdentityByCrn the instance to initialize the Builder with + */ public Builder(PublicGatewayFloatingIPPrototypeFloatingIPIdentity publicGatewayFloatingIpPrototypeFloatingIpIdentityFloatingIpIdentityByCrn) { this.crn = publicGatewayFloatingIpPrototypeFloatingIpIdentityFloatingIpIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN() { } + protected PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref.java index dacd718266..26eaceedcf 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref.java @@ -24,6 +24,11 @@ public class PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentit public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref instance. + * + * @param publicGatewayFloatingIpPrototypeFloatingIpIdentityFloatingIpIdentityByHref the instance to initialize the Builder with + */ public Builder(PublicGatewayFloatingIPPrototypeFloatingIPIdentity publicGatewayFloatingIpPrototypeFloatingIpIdentityFloatingIpIdentityByHref) { this.href = publicGatewayFloatingIpPrototypeFloatingIpIdentityFloatingIpIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref() { } + protected PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.java index fe50e05254..5a2bda2fc9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.java @@ -24,6 +24,11 @@ public class PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentit public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById instance. + * + * @param publicGatewayFloatingIpPrototypeFloatingIpIdentityFloatingIpIdentityById the instance to initialize the Builder with + */ public Builder(PublicGatewayFloatingIPPrototypeFloatingIPIdentity publicGatewayFloatingIpPrototypeFloatingIpIdentityFloatingIpIdentityById) { this.id = publicGatewayFloatingIpPrototypeFloatingIpIdentityFloatingIpIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById() { } + protected PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.java index 72ab4a9cfa..6d0f4bf665 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.java @@ -25,6 +25,11 @@ public static class Builder { private String name; private ResourceGroupIdentity resourceGroup; + /** + * Instantiates a new Builder from an existing PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext instance. + * + * @param publicGatewayFloatingIpPrototypeFloatingIpPrototypeTargetContext the instance to initialize the Builder with + */ public Builder(PublicGatewayFloatingIPPrototype publicGatewayFloatingIpPrototypeFloatingIpPrototypeTargetContext) { this.name = publicGatewayFloatingIpPrototypeFloatingIpPrototypeTargetContext.name; this.resourceGroup = publicGatewayFloatingIpPrototypeFloatingIpPrototypeTargetContext.resourceGroup; @@ -68,6 +73,8 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { } } + protected PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext() { } + protected PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(Builder builder) { name = builder.name; resourceGroup = builder.resourceGroup; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIp.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIp.java index f1daf45b47..d6d8a76589 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIp.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayFloatingIp.java @@ -26,6 +26,8 @@ public class PublicGatewayFloatingIp extends GenericModel { protected String id; protected String name; + protected PublicGatewayFloatingIp() { } + /** * Gets the address. * @@ -51,7 +53,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentity.java index 1dbb301ae4..559abb62e8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentity.java @@ -28,8 +28,7 @@ public class PublicGatewayIdentity extends GenericModel { protected String crn; protected String href; - protected PublicGatewayIdentity() { - } + protected PublicGatewayIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentityPublicGatewayIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentityPublicGatewayIdentityByCRN.java index 0f2eac9812..6794771d20 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentityPublicGatewayIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentityPublicGatewayIdentityByCRN.java @@ -24,6 +24,11 @@ public class PublicGatewayIdentityPublicGatewayIdentityByCRN extends PublicGatew public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing PublicGatewayIdentityPublicGatewayIdentityByCRN instance. + * + * @param publicGatewayIdentityPublicGatewayIdentityByCrn the instance to initialize the Builder with + */ public Builder(PublicGatewayIdentity publicGatewayIdentityPublicGatewayIdentityByCrn) { this.crn = publicGatewayIdentityPublicGatewayIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected PublicGatewayIdentityPublicGatewayIdentityByCRN() { } + protected PublicGatewayIdentityPublicGatewayIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentityPublicGatewayIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentityPublicGatewayIdentityByHref.java index 559218a253..c187302099 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentityPublicGatewayIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentityPublicGatewayIdentityByHref.java @@ -24,6 +24,11 @@ public class PublicGatewayIdentityPublicGatewayIdentityByHref extends PublicGate public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing PublicGatewayIdentityPublicGatewayIdentityByHref instance. + * + * @param publicGatewayIdentityPublicGatewayIdentityByHref the instance to initialize the Builder with + */ public Builder(PublicGatewayIdentity publicGatewayIdentityPublicGatewayIdentityByHref) { this.href = publicGatewayIdentityPublicGatewayIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected PublicGatewayIdentityPublicGatewayIdentityByHref() { } + protected PublicGatewayIdentityPublicGatewayIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentityPublicGatewayIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentityPublicGatewayIdentityById.java index d1035a9343..45820af819 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentityPublicGatewayIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayIdentityPublicGatewayIdentityById.java @@ -24,6 +24,11 @@ public class PublicGatewayIdentityPublicGatewayIdentityById extends PublicGatewa public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing PublicGatewayIdentityPublicGatewayIdentityById instance. + * + * @param publicGatewayIdentityPublicGatewayIdentityById the instance to initialize the Builder with + */ public Builder(PublicGatewayIdentity publicGatewayIdentityPublicGatewayIdentityById) { this.id = publicGatewayIdentityPublicGatewayIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected PublicGatewayIdentityPublicGatewayIdentityById() { } + protected PublicGatewayIdentityPublicGatewayIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayPatch.java index e26b13d017..bd850d3403 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayPatch.java @@ -30,6 +30,11 @@ public class PublicGatewayPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing PublicGatewayPatch instance. + * + * @param publicGatewayPatch the instance to initialize the Builder with + */ private Builder(PublicGatewayPatch publicGatewayPatch) { this.name = publicGatewayPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected PublicGatewayPatch() { } + protected PublicGatewayPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayReference.java index eba393efaf..ccf0d4bf3b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayReference.java @@ -36,6 +36,8 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected PublicGatewayReference() { } + /** * Gets the crn. * @@ -50,7 +52,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayReferenceDeleted.java index acded8ed96..0b022ae6a8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewayReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class PublicGatewayReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class PublicGatewayReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected PublicGatewayReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewaysPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewaysPager.java new file mode 100644 index 0000000000..0389cd5c70 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/PublicGatewaysPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * PublicGatewaysPager can be used to simplify the use of the "listPublicGateways" method. + */ +public class PublicGatewaysPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListPublicGatewaysOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected PublicGatewaysPager() { } + + /** + * Constructs a new PublicGatewaysPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listPublicGateways" method + * @param options the ListPublicGatewaysOptions instance to be used to invoke the "listPublicGateways" method + */ + public PublicGatewaysPager(Vpc client, ListPublicGatewaysOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<PublicGateway> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListPublicGatewaysOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + PublicGatewayCollection result = client.listPublicGateways(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getPublicGateways(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<PublicGateway> containing all results returned by the "listPublicGateways" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Region.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Region.java index fd0b4bb0f5..caf4f32e3a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Region.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Region.java @@ -34,6 +34,8 @@ public interface Status { protected String name; protected String status; + protected Region() { } + /** * Gets the endpoint. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionCollection.java index 492096056d..f1885ccf2b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionCollection.java @@ -23,6 +23,8 @@ public class RegionCollection extends GenericModel { protected List regions; + protected RegionCollection() { } + /** * Gets the regions. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionReference.java index 0d1948ba51..4d8e48efdd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionReference.java @@ -22,6 +22,8 @@ public class RegionReference extends GenericModel { protected String href; protected String name; + protected RegionReference() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveBareMetalServerNetworkInterfaceFloatingIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveBareMetalServerNetworkInterfaceFloatingIpOptions.java index 8130820373..d6f531bee4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveBareMetalServerNetworkInterfaceFloatingIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveBareMetalServerNetworkInterfaceFloatingIpOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String networkInterfaceId; private String id; + /** + * Instantiates a new Builder from an existing RemoveBareMetalServerNetworkInterfaceFloatingIpOptions instance. + * + * @param removeBareMetalServerNetworkInterfaceFloatingIpOptions the instance to initialize the Builder with + */ private Builder(RemoveBareMetalServerNetworkInterfaceFloatingIpOptions removeBareMetalServerNetworkInterfaceFloatingIpOptions) { this.bareMetalServerId = removeBareMetalServerNetworkInterfaceFloatingIpOptions.bareMetalServerId; this.networkInterfaceId = removeBareMetalServerNetworkInterfaceFloatingIpOptions.networkInterfaceId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected RemoveBareMetalServerNetworkInterfaceFloatingIpOptions() { } + protected RemoveBareMetalServerNetworkInterfaceFloatingIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveEndpointGatewayIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveEndpointGatewayIpOptions.java index 2a914ef396..7c34ac1231 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveEndpointGatewayIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveEndpointGatewayIpOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String endpointGatewayId; private String id; + /** + * Instantiates a new Builder from an existing RemoveEndpointGatewayIpOptions instance. + * + * @param removeEndpointGatewayIpOptions the instance to initialize the Builder with + */ private Builder(RemoveEndpointGatewayIpOptions removeEndpointGatewayIpOptions) { this.endpointGatewayId = removeEndpointGatewayIpOptions.endpointGatewayId; this.id = removeEndpointGatewayIpOptions.id; @@ -83,6 +88,8 @@ public Builder id(String id) { } } + protected RemoveEndpointGatewayIpOptions() { } + protected RemoveEndpointGatewayIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.endpointGatewayId, "endpointGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveInstanceNetworkInterfaceFloatingIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveInstanceNetworkInterfaceFloatingIpOptions.java index c762a28a6a..88ed7519a6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveInstanceNetworkInterfaceFloatingIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveInstanceNetworkInterfaceFloatingIpOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String networkInterfaceId; private String id; + /** + * Instantiates a new Builder from an existing RemoveInstanceNetworkInterfaceFloatingIpOptions instance. + * + * @param removeInstanceNetworkInterfaceFloatingIpOptions the instance to initialize the Builder with + */ private Builder(RemoveInstanceNetworkInterfaceFloatingIpOptions removeInstanceNetworkInterfaceFloatingIpOptions) { this.instanceId = removeInstanceNetworkInterfaceFloatingIpOptions.instanceId; this.networkInterfaceId = removeInstanceNetworkInterfaceFloatingIpOptions.networkInterfaceId; @@ -99,6 +104,8 @@ public Builder id(String id) { } } + protected RemoveInstanceNetworkInterfaceFloatingIpOptions() { } + protected RemoveInstanceNetworkInterfaceFloatingIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayConnectionLocalCidrOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayConnectionLocalCidrOptions.java index f5a85481bc..ff5b44e694 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayConnectionLocalCidrOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayConnectionLocalCidrOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String cidrPrefix; private String prefixLength; + /** + * Instantiates a new Builder from an existing RemoveVpnGatewayConnectionLocalCidrOptions instance. + * + * @param removeVpnGatewayConnectionLocalCidrOptions the instance to initialize the Builder with + */ private Builder(RemoveVpnGatewayConnectionLocalCidrOptions removeVpnGatewayConnectionLocalCidrOptions) { this.vpnGatewayId = removeVpnGatewayConnectionLocalCidrOptions.vpnGatewayId; this.id = removeVpnGatewayConnectionLocalCidrOptions.id; @@ -115,6 +120,8 @@ public Builder prefixLength(String prefixLength) { } } + protected RemoveVpnGatewayConnectionLocalCidrOptions() { } + protected RemoveVpnGatewayConnectionLocalCidrOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, "vpnGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayConnectionPeerCidrOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayConnectionPeerCidrOptions.java index 5ad4e60188..36e3a76a64 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayConnectionPeerCidrOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayConnectionPeerCidrOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String cidrPrefix; private String prefixLength; + /** + * Instantiates a new Builder from an existing RemoveVpnGatewayConnectionPeerCidrOptions instance. + * + * @param removeVpnGatewayConnectionPeerCidrOptions the instance to initialize the Builder with + */ private Builder(RemoveVpnGatewayConnectionPeerCidrOptions removeVpnGatewayConnectionPeerCidrOptions) { this.vpnGatewayId = removeVpnGatewayConnectionPeerCidrOptions.vpnGatewayId; this.id = removeVpnGatewayConnectionPeerCidrOptions.id; @@ -115,6 +120,8 @@ public Builder prefixLength(String prefixLength) { } } + protected RemoveVpnGatewayConnectionPeerCidrOptions() { } + protected RemoveVpnGatewayConnectionPeerCidrOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, "vpnGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceLoadBalancerPoolMembersOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceLoadBalancerPoolMembersOptions.java index a1794e14d9..3925911351 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceLoadBalancerPoolMembersOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceLoadBalancerPoolMembersOptions.java @@ -34,6 +34,11 @@ public static class Builder { private String poolId; private List members; + /** + * Instantiates a new Builder from an existing ReplaceLoadBalancerPoolMembersOptions instance. + * + * @param replaceLoadBalancerPoolMembersOptions the instance to initialize the Builder with + */ private Builder(ReplaceLoadBalancerPoolMembersOptions replaceLoadBalancerPoolMembersOptions) { this.loadBalancerId = replaceLoadBalancerPoolMembersOptions.loadBalancerId; this.poolId = replaceLoadBalancerPoolMembersOptions.poolId; @@ -119,6 +124,8 @@ public Builder members(List members) { } } + protected ReplaceLoadBalancerPoolMembersOptions() { } + protected ReplaceLoadBalancerPoolMembersOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceSubnetNetworkAclOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceSubnetNetworkAclOptions.java index ee302467cf..7568b65469 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceSubnetNetworkAclOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceSubnetNetworkAclOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String id; private NetworkACLIdentity networkAclIdentity; + /** + * Instantiates a new Builder from an existing ReplaceSubnetNetworkAclOptions instance. + * + * @param replaceSubnetNetworkAclOptions the instance to initialize the Builder with + */ private Builder(ReplaceSubnetNetworkAclOptions replaceSubnetNetworkAclOptions) { this.id = replaceSubnetNetworkAclOptions.id; this.networkAclIdentity = replaceSubnetNetworkAclOptions.networkAclIdentity; @@ -83,6 +88,8 @@ public Builder networkAclIdentity(NetworkACLIdentity networkAclIdentity) { } } + protected ReplaceSubnetNetworkAclOptions() { } + protected ReplaceSubnetNetworkAclOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceSubnetRoutingTableOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceSubnetRoutingTableOptions.java index 5aeaacf334..a9381eb7d1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceSubnetRoutingTableOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceSubnetRoutingTableOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String id; private RoutingTableIdentity routingTableIdentity; + /** + * Instantiates a new Builder from an existing ReplaceSubnetRoutingTableOptions instance. + * + * @param replaceSubnetRoutingTableOptions the instance to initialize the Builder with + */ private Builder(ReplaceSubnetRoutingTableOptions replaceSubnetRoutingTableOptions) { this.id = replaceSubnetRoutingTableOptions.id; this.routingTableIdentity = replaceSubnetRoutingTableOptions.routingTableIdentity; @@ -83,6 +88,8 @@ public Builder routingTableIdentity(RoutingTableIdentity routingTableIdentity) { } } + protected ReplaceSubnetRoutingTableOptions() { } + protected ReplaceSubnetRoutingTableOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIP.java index 911dc91ecc..32fe75e5b4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIP.java @@ -75,6 +75,8 @@ public interface ResourceType { protected String resourceType; protected ReservedIPTarget target; + protected ReservedIP() { } + /** * Gets the address. * @@ -184,7 +186,7 @@ public String getResourceType() { /** * Gets the target. * - * The target of this reserved IP. + * The target this reserved IP is bound to. * * If absent, this reserved IP is provider-owned or unbound. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollection.java index d3ab308024..368408b30b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollection.java @@ -30,6 +30,8 @@ public class ReservedIPCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected ReservedIPCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionEndpointGatewayContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionEndpointGatewayContext.java index cbb4c3f1d0..4c62367c7c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionEndpointGatewayContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionEndpointGatewayContext.java @@ -29,6 +29,8 @@ public class ReservedIPCollectionEndpointGatewayContext extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected ReservedIPCollectionEndpointGatewayContext() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionEndpointGatewayContextFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionEndpointGatewayContextFirst.java index 88747cfd1b..fa62dce304 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionEndpointGatewayContextFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionEndpointGatewayContextFirst.java @@ -21,6 +21,8 @@ public class ReservedIPCollectionEndpointGatewayContextFirst extends GenericMode protected String href; + protected ReservedIPCollectionEndpointGatewayContextFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionEndpointGatewayContextNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionEndpointGatewayContextNext.java index eb732a1024..f9048fd733 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionEndpointGatewayContextNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionEndpointGatewayContextNext.java @@ -21,6 +21,8 @@ public class ReservedIPCollectionEndpointGatewayContextNext extends GenericModel protected String href; + protected ReservedIPCollectionEndpointGatewayContextNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionFirst.java index b5493fcf0f..fdf94c3cad 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionFirst.java @@ -21,6 +21,8 @@ public class ReservedIPCollectionFirst extends GenericModel { protected String href; + protected ReservedIPCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNetworkInterfaceContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNetworkInterfaceContext.java index 7ad6dd5bc6..7e98813289 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNetworkInterfaceContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNetworkInterfaceContext.java @@ -29,6 +29,8 @@ public class ReservedIPCollectionNetworkInterfaceContext extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected ReservedIPCollectionNetworkInterfaceContext() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNetworkInterfaceContextFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNetworkInterfaceContextFirst.java index ab929b3950..0ab9bb6fc9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNetworkInterfaceContextFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNetworkInterfaceContextFirst.java @@ -21,6 +21,8 @@ public class ReservedIPCollectionNetworkInterfaceContextFirst extends GenericMod protected String href; + protected ReservedIPCollectionNetworkInterfaceContextFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNetworkInterfaceContextNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNetworkInterfaceContextNext.java index 7476d70cbc..b3c8d314bb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNetworkInterfaceContextNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNetworkInterfaceContextNext.java @@ -21,6 +21,8 @@ public class ReservedIPCollectionNetworkInterfaceContextNext extends GenericMode protected String href; + protected ReservedIPCollectionNetworkInterfaceContextNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNext.java index 0120779c78..3a65b741d0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPCollectionNext.java @@ -21,6 +21,8 @@ public class ReservedIPCollectionNext extends GenericModel { protected String href; + protected ReservedIPCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPPatch.java index 9691b7c52f..048f4be7eb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPPatch.java @@ -34,6 +34,11 @@ public static class Builder { private Boolean autoDelete; private String name; + /** + * Instantiates a new Builder from an existing ReservedIPPatch instance. + * + * @param reservedIpPatch the instance to initialize the Builder with + */ private Builder(ReservedIPPatch reservedIpPatch) { this.autoDelete = reservedIpPatch.autoDelete; this.name = reservedIpPatch.name; @@ -77,6 +82,8 @@ public Builder name(String name) { } } + protected ReservedIPPatch() { } + protected ReservedIPPatch(Builder builder) { autoDelete = builder.autoDelete; name = builder.name; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPReference.java index 02ee782975..b2b92f488b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPReference.java @@ -36,6 +36,8 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected ReservedIPReference() { } + /** * Gets the address. * @@ -56,7 +58,7 @@ public String getAddress() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPReferenceDeleted.java index 2cfa3b5f2a..33657edcc8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class ReservedIPReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class ReservedIPReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected ReservedIPReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTarget.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTarget.java index 2579a8f91a..f5f15a5006 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTarget.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTarget.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * The target of this reserved IP. + * The target this reserved IP is bound to. * * If absent, this reserved IP is provider-owned or unbound. * @@ -46,8 +46,7 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; - protected ReservedIPTarget() { - } + protected ReservedIPTarget() { } /** * Gets the crn. @@ -63,7 +62,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetEndpointGatewayReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetEndpointGatewayReference.java index 39c4c06871..7c5db24d14 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetEndpointGatewayReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetEndpointGatewayReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String ENDPOINT_GATEWAY = "endpoint_gateway"; } + + protected ReservedIPTargetEndpointGatewayReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetGenericResourceReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetGenericResourceReference.java index 0a6436b2f7..b66fc69aab 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetGenericResourceReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetGenericResourceReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String CLOUD_RESOURCE = "cloud_resource"; } + + protected ReservedIPTargetGenericResourceReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetLoadBalancerReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetLoadBalancerReference.java index a04f86b300..c4e72acd2c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetLoadBalancerReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetLoadBalancerReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String LOAD_BALANCER = "load_balancer"; } + + protected ReservedIPTargetLoadBalancerReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetNetworkInterfaceReferenceTargetContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetNetworkInterfaceReferenceTargetContext.java index 21db0854a6..03821cc47e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetNetworkInterfaceReferenceTargetContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetNetworkInterfaceReferenceTargetContext.java @@ -25,5 +25,7 @@ public interface ResourceType { String NETWORK_INTERFACE = "network_interface"; } + + protected ReservedIPTargetNetworkInterfaceReferenceTargetContext() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototype.java index 1bd988dc42..9b3456a21f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototype.java @@ -15,8 +15,12 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * The target this reserved IP is to be bound to. The target must be an endpoint gateway not already bound to a reserved - * IP in the subnet's zone. + * The target to bind this reserved IP to. The target must be in the same VPC. + * + * At present, only endpoint gateway targets are supported. The endpoint gateway must not be already bound to a + * reserved IP in the subnet's zone. + * + * If unspecified, the reserved IP will be created unbound. * * Classes which extend this class: * - ReservedIPTargetPrototypeEndpointGatewayIdentity @@ -27,8 +31,7 @@ public class ReservedIPTargetPrototype extends GenericModel { protected String crn; protected String href; - protected ReservedIPTargetPrototype() { - } + protected ReservedIPTargetPrototype() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentity.java index 098b60d140..ac24090b6e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentity.java @@ -23,7 +23,6 @@ public class ReservedIPTargetPrototypeEndpointGatewayIdentity extends ReservedIPTargetPrototype { - protected ReservedIPTargetPrototypeEndpointGatewayIdentity() { - } + protected ReservedIPTargetPrototypeEndpointGatewayIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN.java index 27ae697bde..29b4dd9939 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN.java @@ -24,6 +24,11 @@ public class ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIden public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN instance. + * + * @param reservedIpTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCrn the instance to initialize the Builder with + */ public Builder(ReservedIPTargetPrototypeEndpointGatewayIdentity reservedIpTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCrn) { this.crn = reservedIpTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN() { } + protected ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref.java index 08d3a41652..2d09f4cf97 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref.java @@ -24,6 +24,11 @@ public class ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIden public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref instance. + * + * @param reservedIpTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref the instance to initialize the Builder with + */ public Builder(ReservedIPTargetPrototypeEndpointGatewayIdentity reservedIpTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref) { this.href = reservedIpTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref() { } + protected ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.java index f0f53a26ae..cdc2342e27 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.java @@ -24,6 +24,11 @@ public class ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIden public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById instance. + * + * @param reservedIpTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById the instance to initialize the Builder with + */ public Builder(ReservedIPTargetPrototypeEndpointGatewayIdentity reservedIpTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById) { this.id = reservedIpTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById() { } + protected ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetVPNGatewayReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetVPNGatewayReference.java index 7a1b16aa90..475ce9a867 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetVPNGatewayReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetVPNGatewayReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String VPN_GATEWAY = "vpn_gateway"; } + + protected ReservedIPTargetVPNGatewayReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetVPNServerReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetVPNServerReference.java index 9dd000b42c..9d18e3e76b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetVPNServerReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReservedIPTargetVPNServerReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String VPN_SERVER = "vpn_server"; } + + protected ReservedIPTargetVPNServerReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceFilter.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceFilter.java index 37ff842075..989c6828c3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceFilter.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceFilter.java @@ -29,6 +29,11 @@ public class ResourceFilter extends GenericModel { public static class Builder { private String resourceType; + /** + * Instantiates a new Builder from an existing ResourceFilter instance. + * + * @param resourceFilter the instance to initialize the Builder with + */ private Builder(ResourceFilter resourceFilter) { this.resourceType = resourceFilter.resourceType; } @@ -60,6 +65,8 @@ public Builder resourceType(String resourceType) { } } + protected ResourceFilter() { } + protected ResourceFilter(Builder builder) { resourceType = builder.resourceType; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceGroupIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceGroupIdentity.java index d369ac7bf8..930478b19d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceGroupIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceGroupIdentity.java @@ -25,8 +25,7 @@ public class ResourceGroupIdentity extends GenericModel { protected String id; - protected ResourceGroupIdentity() { - } + protected ResourceGroupIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceGroupIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceGroupIdentityById.java index 3b57bb47a8..059e92f799 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceGroupIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceGroupIdentityById.java @@ -24,6 +24,11 @@ public class ResourceGroupIdentityById extends ResourceGroupIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing ResourceGroupIdentityById instance. + * + * @param resourceGroupIdentityById the instance to initialize the Builder with + */ public Builder(ResourceGroupIdentity resourceGroupIdentityById) { this.id = resourceGroupIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected ResourceGroupIdentityById() { } + protected ResourceGroupIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceGroupReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceGroupReference.java index 446dd8b43b..9bed77b2b0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceGroupReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ResourceGroupReference.java @@ -23,6 +23,8 @@ public class ResourceGroupReference extends GenericModel { protected String id; protected String name; + protected ResourceGroupReference() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RestartBareMetalServerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RestartBareMetalServerOptions.java index 115c2cbdc2..b99065d423 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RestartBareMetalServerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RestartBareMetalServerOptions.java @@ -27,6 +27,11 @@ public class RestartBareMetalServerOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing RestartBareMetalServerOptions instance. + * + * @param restartBareMetalServerOptions the instance to initialize the Builder with + */ private Builder(RestartBareMetalServerOptions restartBareMetalServerOptions) { this.id = restartBareMetalServerOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected RestartBareMetalServerOptions() { } + protected RestartBareMetalServerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Route.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Route.java index 18a466fdc4..38c73bd6b0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Route.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Route.java @@ -24,9 +24,8 @@ public class Route extends GenericModel { /** * The action to perform with a packet matching the route: - * - `delegate`: delegate to the system's built-in routes - * - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound - * routes + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes * - `deliver`: deliver the packet to the specified `next_hop` * - `drop`: drop the packet. */ @@ -92,13 +91,14 @@ public interface Origin { protected String origin; protected ZoneReference zone; + protected Route() { } + /** * Gets the action. * * The action to perform with a packet matching the route: - * - `delegate`: delegate to the system's built-in routes - * - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound - * routes + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes * - `deliver`: deliver the packet to the specified `next_hop` * - `drop`: drop the packet. * @@ -122,9 +122,9 @@ public Date getCreatedAt() { /** * Gets the creator. * - * If present, the resource that created the route. Routes with this property present cannot be - * directly deleted. All routes with an `origin` of `learned` or `service` will have this - * property set, and future `origin` values may also have this property set. + * If present, the resource that created the route. Routes with this property present cannot + * be directly deleted. All routes with an `origin` of `service` will have this property set, + * and future `origin` values may also have this property set. * * @return the creator */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollection.java index 30aa61b1e2..4b80e5f826 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollection.java @@ -29,6 +29,8 @@ public class RouteCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected RouteCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionFirst.java index f402d08809..20ad7dd8ab 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionFirst.java @@ -21,6 +21,8 @@ public class RouteCollectionFirst extends GenericModel { protected String href; + protected RouteCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionNext.java index 34296bff0b..a84647735e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionNext.java @@ -21,6 +21,8 @@ public class RouteCollectionNext extends GenericModel { protected String href; + protected RouteCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCreator.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCreator.java index 7e28008abe..a34dc2c085 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCreator.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCreator.java @@ -17,8 +17,8 @@ /** * If present, the resource that created the route. Routes with this property present cannot be directly deleted. All - * routes with an `origin` of `learned` or `service` will have this property set, and future `origin` values may also - * have this property set. + * routes with an `origin` of `service` will have this property set, and future `origin` values may also have this + * property set. * * Classes which extend this class: * - RouteCreatorVPNGatewayReference @@ -42,8 +42,7 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; - protected RouteCreator() { - } + protected RouteCreator() { } /** * Gets the crn. @@ -59,7 +58,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCreatorVPNGatewayReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCreatorVPNGatewayReference.java index 03632574c5..c51d6d0892 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCreatorVPNGatewayReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCreatorVPNGatewayReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String VPN_GATEWAY = "vpn_gateway"; } + + protected RouteCreatorVPNGatewayReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCreatorVPNServerReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCreatorVPNServerReference.java index d820ed0f89..03a9d626ff 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCreatorVPNServerReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCreatorVPNServerReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String VPN_SERVER = "vpn_server"; } + + protected RouteCreatorVPNServerReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteNextHop.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteNextHop.java index 4d29b315ce..b81e9b5380 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteNextHop.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteNextHop.java @@ -40,8 +40,7 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; - protected RouteNextHop() { - } + protected RouteNextHop() { } /** * Gets the address. @@ -61,7 +60,7 @@ public String getAddress() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteNextHopIP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteNextHopIP.java index d0b6f112bd..d69d387379 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteNextHopIP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteNextHopIP.java @@ -17,5 +17,7 @@ */ public class RouteNextHopIP extends RouteNextHop { + + protected RouteNextHopIP() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteNextHopVPNGatewayConnectionReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteNextHopVPNGatewayConnectionReference.java index 011dd8f65c..9310950376 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteNextHopVPNGatewayConnectionReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteNextHopVPNGatewayConnectionReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String VPN_GATEWAY_CONNECTION = "vpn_gateway_connection"; } + + protected RouteNextHopVPNGatewayConnectionReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePatch.java index 94c798db8f..1408358506 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePatch.java @@ -30,6 +30,11 @@ public class RoutePatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing RoutePatch instance. + * + * @param routePatch the instance to initialize the Builder with + */ private Builder(RoutePatch routePatch) { this.name = routePatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected RoutePatch() { } + protected RoutePatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototype.java index 75ea59b021..5c9c3472c2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototype.java @@ -22,9 +22,8 @@ public class RoutePrototype extends GenericModel { /** * The action to perform with a packet matching the route: - * - `delegate`: delegate to the system's built-in routes - * - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound - * routes + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes * - `deliver`: deliver the packet to the specified `next_hop` * - `drop`: drop the packet. */ @@ -56,6 +55,11 @@ public static class Builder { private RoutePrototypeNextHop nextHop; private ZoneIdentity zone; + /** + * Instantiates a new Builder from an existing RoutePrototype instance. + * + * @param routePrototype the instance to initialize the Builder with + */ private Builder(RoutePrototype routePrototype) { this.action = routePrototype.action; this.destination = routePrototype.destination; @@ -146,6 +150,8 @@ public Builder zone(ZoneIdentity zone) { } } + protected RoutePrototype() { } + protected RoutePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.destination, "destination cannot be null"); @@ -171,9 +177,8 @@ public Builder newBuilder() { * Gets the action. * * The action to perform with a packet matching the route: - * - `delegate`: delegate to the system's built-in routes - * - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound - * routes + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes * - `deliver`: deliver the packet to the specified `next_hop` * - `drop`: drop the packet. * @@ -187,8 +192,7 @@ public String action() { * Gets the destination. * * The destination of the route. At most two routes per `zone` in a table can have the same destination, and only if - * both routes have an `action` of `deliver` and the - * `next_hop` is an IP address. + * both routes have an `action` of `deliver` and the `next_hop` is an IP address. * * @return the destination */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHop.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHop.java index 90114a6c9e..69d546f7b5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHop.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHop.java @@ -28,8 +28,7 @@ public class RoutePrototypeNextHop extends GenericModel { protected String id; protected String href; - protected RoutePrototypeNextHop() { - } + protected RoutePrototypeNextHop() { } /** * Gets the address. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP.java index 68553dd56b..7f28964e83 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP.java @@ -24,6 +24,11 @@ public class RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP extends Ro public static class Builder { private String address; + /** + * Instantiates a new Builder from an existing RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP instance. + * + * @param routePrototypeNextHopRouteNextHopPrototypeRouteNextHopIp the instance to initialize the Builder with + */ public Builder(RoutePrototypeNextHop routePrototypeNextHopRouteNextHopPrototypeRouteNextHopIp) { this.address = routePrototypeNextHopRouteNextHopPrototypeRouteNextHopIp.address; } @@ -64,6 +69,8 @@ public Builder address(String address) { } } + protected RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP() { } + protected RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.address, "address cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity.java index cbd11084cd..4de1f9cd0f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity.java @@ -22,7 +22,6 @@ public class RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity extends RoutePrototypeNextHop { - protected RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity() { - } + protected RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref.java index afb8bed11b..8303d356f4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref.java @@ -24,6 +24,11 @@ public class RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdent public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref instance. + * + * @param routePrototypeNextHopRouteNextHopPrototypeVpnGatewayConnectionIdentityRouteNextHopPrototypeVpnGatewayConnectionIdentityVpnGatewayConnectionIdentityByHref the instance to initialize the Builder with + */ public Builder(RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity routePrototypeNextHopRouteNextHopPrototypeVpnGatewayConnectionIdentityRouteNextHopPrototypeVpnGatewayConnectionIdentityVpnGatewayConnectionIdentityByHref) { this.href = routePrototypeNextHopRouteNextHopPrototypeVpnGatewayConnectionIdentityRouteNextHopPrototypeVpnGatewayConnectionIdentityVpnGatewayConnectionIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref() { } + protected RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById.java index 8bd2ddf227..61c6778e98 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById.java @@ -24,6 +24,11 @@ public class RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdent public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById instance. + * + * @param routePrototypeNextHopRouteNextHopPrototypeVpnGatewayConnectionIdentityRouteNextHopPrototypeVpnGatewayConnectionIdentityVpnGatewayConnectionIdentityById the instance to initialize the Builder with + */ public Builder(RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity routePrototypeNextHopRouteNextHopPrototypeVpnGatewayConnectionIdentityRouteNextHopPrototypeVpnGatewayConnectionIdentityVpnGatewayConnectionIdentityById) { this.id = routePrototypeNextHopRouteNextHopPrototypeVpnGatewayConnectionIdentityRouteNextHopPrototypeVpnGatewayConnectionIdentityVpnGatewayConnectionIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById() { } + protected RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteReference.java index f23e4c5c82..02d601b54c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteReference.java @@ -24,10 +24,12 @@ public class RouteReference extends GenericModel { protected String id; protected String name; + protected RouteReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteReferenceDeleted.java index 5281b34919..fefa48310b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class RouteReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class RouteReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected RouteReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTable.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTable.java index 3f5979554d..9ea90d7d90 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTable.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTable.java @@ -73,6 +73,8 @@ public interface ResourceType { protected List routes; protected List subnets; + protected RoutingTable() { } + /** * Gets the acceptRoutesFrom. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollection.java index 64ce465735..e4c1b066f0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollection.java @@ -30,6 +30,8 @@ public class RoutingTableCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected RoutingTableCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollectionFirst.java index f131735747..ed8b847e7e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollectionFirst.java @@ -21,6 +21,8 @@ public class RoutingTableCollectionFirst extends GenericModel { protected String href; + protected RoutingTableCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollectionNext.java index e990dd5d59..5d28d8a925 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollectionNext.java @@ -21,6 +21,8 @@ public class RoutingTableCollectionNext extends GenericModel { protected String href; + protected RoutingTableCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableIdentity.java index 7a0167f9bc..c61eb506d6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableIdentity.java @@ -26,8 +26,7 @@ public class RoutingTableIdentity extends GenericModel { protected String id; protected String href; - protected RoutingTableIdentity() { - } + protected RoutingTableIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableIdentityByHref.java index b0f5de44df..cd9badc49b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableIdentityByHref.java @@ -24,6 +24,11 @@ public class RoutingTableIdentityByHref extends RoutingTableIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing RoutingTableIdentityByHref instance. + * + * @param routingTableIdentityByHref the instance to initialize the Builder with + */ public Builder(RoutingTableIdentity routingTableIdentityByHref) { this.href = routingTableIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected RoutingTableIdentityByHref() { } + protected RoutingTableIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableIdentityById.java index 1a401d59ac..016ef464fb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableIdentityById.java @@ -24,6 +24,11 @@ public class RoutingTableIdentityById extends RoutingTableIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing RoutingTableIdentityById instance. + * + * @param routingTableIdentityById the instance to initialize the Builder with + */ public Builder(RoutingTableIdentity routingTableIdentityById) { this.id = routingTableIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected RoutingTableIdentityById() { } + protected RoutingTableIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTablePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTablePatch.java index d4fc3ae265..abbd95a4f7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTablePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTablePatch.java @@ -45,6 +45,11 @@ public static class Builder { private Boolean routeTransitGatewayIngress; private Boolean routeVpcZoneIngress; + /** + * Instantiates a new Builder from an existing RoutingTablePatch instance. + * + * @param routingTablePatch the instance to initialize the Builder with + */ private Builder(RoutingTablePatch routingTablePatch) { this.acceptRoutesFrom = routingTablePatch.acceptRoutesFrom; this.name = routingTablePatch.name; @@ -141,6 +146,8 @@ public Builder routeVpcZoneIngress(Boolean routeVpcZoneIngress) { } } + protected RoutingTablePatch() { } + protected RoutingTablePatch(Builder builder) { acceptRoutesFrom = builder.acceptRoutesFrom; name = builder.name; @@ -162,9 +169,9 @@ public Builder newBuilder() { * Gets the acceptRoutesFrom. * * The filters specifying the resources that may create routes in this routing table - * (replacing any existing filters). All routes learned from resources that match a given filter will be removed when - * an existing filter is removed. Therefore, if an empty array is specified, all filters will be removed, resulting in - * all learned routes being removed. + * (replacing any existing filters). All routes created by resources that match a given filter will be removed when an + * existing filter is removed. Therefore, if an empty array is specified, all filters will be removed, resulting in + * all routes not directly created by the user being removed. * * At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter * support is expected to expand in the future. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableReference.java index f1b5e2c625..a7302eb116 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableReference.java @@ -35,10 +35,12 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected RoutingTableReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableReferenceDeleted.java index 9baa0db6a6..19fd737665 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class RoutingTableReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class RoutingTableReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected RoutingTableReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroup.java index e793b2e127..5aeadbd301 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroup.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroup.java @@ -35,6 +35,8 @@ public class SecurityGroup extends GenericModel { protected List targets; protected VPCReference vpc; + protected SecurityGroup() { } + /** * Gets the createdAt. * @@ -126,7 +128,7 @@ public List getTargets() { /** * Gets the vpc. * - * The VPC this security group is a part of. + * The VPC this security group resides in. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollection.java index 74c13e49d3..56615363d6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollection.java @@ -30,6 +30,8 @@ public class SecurityGroupCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected SecurityGroupCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollectionFirst.java index 3c801893df..73966960c5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollectionFirst.java @@ -21,6 +21,8 @@ public class SecurityGroupCollectionFirst extends GenericModel { protected String href; + protected SecurityGroupCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollectionNext.java index 5b55431bb5..df729c0f74 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollectionNext.java @@ -21,6 +21,8 @@ public class SecurityGroupCollectionNext extends GenericModel { protected String href; + protected SecurityGroupCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentity.java index 0fce142e7f..84361c3772 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentity.java @@ -28,8 +28,7 @@ public class SecurityGroupIdentity extends GenericModel { protected String crn; protected String href; - protected SecurityGroupIdentity() { - } + protected SecurityGroupIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentityByCRN.java index c167148da0..9c323abcac 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentityByCRN.java @@ -24,6 +24,11 @@ public class SecurityGroupIdentityByCRN extends SecurityGroupIdentity { public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing SecurityGroupIdentityByCRN instance. + * + * @param securityGroupIdentityByCrn the instance to initialize the Builder with + */ public Builder(SecurityGroupIdentity securityGroupIdentityByCrn) { this.crn = securityGroupIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected SecurityGroupIdentityByCRN() { } + protected SecurityGroupIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentityByHref.java index ccfbf9277a..23c53c1200 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentityByHref.java @@ -24,6 +24,11 @@ public class SecurityGroupIdentityByHref extends SecurityGroupIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing SecurityGroupIdentityByHref instance. + * + * @param securityGroupIdentityByHref the instance to initialize the Builder with + */ public Builder(SecurityGroupIdentity securityGroupIdentityByHref) { this.href = securityGroupIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected SecurityGroupIdentityByHref() { } + protected SecurityGroupIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentityById.java index ccde17f7f8..c4378021c5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupIdentityById.java @@ -24,6 +24,11 @@ public class SecurityGroupIdentityById extends SecurityGroupIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing SecurityGroupIdentityById instance. + * + * @param securityGroupIdentityById the instance to initialize the Builder with + */ public Builder(SecurityGroupIdentity securityGroupIdentityById) { this.id = securityGroupIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected SecurityGroupIdentityById() { } + protected SecurityGroupIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupPatch.java index 086a0f51be..8d37cbd55b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupPatch.java @@ -30,6 +30,11 @@ public class SecurityGroupPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing SecurityGroupPatch instance. + * + * @param securityGroupPatch the instance to initialize the Builder with + */ private Builder(SecurityGroupPatch securityGroupPatch) { this.name = securityGroupPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected SecurityGroupPatch() { } + protected SecurityGroupPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupReference.java index c19b654c3f..036cca26ca 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupReference.java @@ -25,6 +25,8 @@ public class SecurityGroupReference extends GenericModel { protected String id; protected String name; + protected SecurityGroupReference() { } + /** * Gets the crn. * @@ -39,7 +41,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupReferenceDeleted.java index 54260149b2..50966915ef 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class SecurityGroupReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class SecurityGroupReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected SecurityGroupReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRule.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRule.java index 7048daa056..6f013151da 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRule.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRule.java @@ -36,7 +36,7 @@ public class SecurityGroupRule extends GenericModel { } /** - * The direction of traffic to enforce, either `inbound` or `outbound`. + * The direction of traffic to enforce. */ public interface Direction { /** inbound. */ @@ -55,6 +55,20 @@ public interface IpVersion { String IPV4 = "ipv4"; } + /** + * The protocol to enforce. + */ + public interface Protocol { + /** all. */ + String ALL = "all"; + /** icmp. */ + String ICMP = "icmp"; + /** tcp. */ + String TCP = "tcp"; + /** udp. */ + String UDP = "udp"; + } + protected String direction; protected String href; protected String id; @@ -69,13 +83,12 @@ public interface IpVersion { @SerializedName("port_min") protected Long portMin; - protected SecurityGroupRule() { - } + protected SecurityGroupRule() { } /** * Gets the direction. * - * The direction of traffic to enforce, either `inbound` or `outbound`. + * The direction of traffic to enforce. * * @return the direction */ @@ -132,10 +145,10 @@ public String getProtocol() { /** * Gets the remote. * - * The IP addresses or security groups from which this rule allows traffic (or to which, - * for outbound rules). Can be specified as an IP address, a CIDR block, or a security - * group. A CIDR block of `0.0.0.0/0` allows traffic from any source (or to any source, - * for outbound rules). + * The IP addresses or security groups from which this rule allows traffic (or to which, for + * outbound rules). Can be specified as an IP address, a CIDR block, or a security group. A + * CIDR block of `0.0.0.0/0` allows traffic from any source (or to any destination, for + * outbound rules). * * @return the remote */ @@ -146,7 +159,7 @@ public SecurityGroupRuleRemote getRemote() { /** * Gets the code. * - * The ICMP traffic code to allow. + * The ICMP traffic code to allow. If absent, all codes are allowed. * * @return the code */ @@ -157,7 +170,7 @@ public Long getCode() { /** * Gets the type. * - * The ICMP traffic type to allow. + * The ICMP traffic type to allow. If absent, all types are allowed. * * @return the type */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleCollection.java index 1240de495f..b4c17ab01d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleCollection.java @@ -23,6 +23,8 @@ public class SecurityGroupRuleCollection extends GenericModel { protected List rules; + protected SecurityGroupRuleCollection() { } + /** * Gets the rules. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePatch.java index b872e381c7..b535aa3c0d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePatch.java @@ -24,7 +24,7 @@ public class SecurityGroupRulePatch extends GenericModel { /** - * The direction of traffic to enforce, either `inbound` or `outbound`. + * The direction of traffic to enforce. */ public interface Direction { /** inbound. */ @@ -66,6 +66,11 @@ public static class Builder { private SecurityGroupRuleRemotePatch remote; private Long type; + /** + * Instantiates a new Builder from an existing SecurityGroupRulePatch instance. + * + * @param securityGroupRulePatch the instance to initialize the Builder with + */ private Builder(SecurityGroupRulePatch securityGroupRulePatch) { this.code = securityGroupRulePatch.code; this.direction = securityGroupRulePatch.direction; @@ -169,6 +174,8 @@ public Builder type(long type) { } } + protected SecurityGroupRulePatch() { } + protected SecurityGroupRulePatch(Builder builder) { code = builder.code; direction = builder.direction; @@ -191,7 +198,9 @@ public Builder newBuilder() { /** * Gets the code. * - * The ICMP traffic code to allow. Specify `null` to remove an existing ICMP traffic code value. + * The ICMP traffic code to allow. If set, `type` must also be set. + * + * Specify `null` to remove an existing ICMP traffic code. * * @return the code */ @@ -202,7 +211,7 @@ public Long code() { /** * Gets the direction. * - * The direction of traffic to enforce, either `inbound` or `outbound`. + * The direction of traffic to enforce. * * @return the direction */ @@ -226,8 +235,9 @@ public String ipVersion() { /** * Gets the portMax. * - * The inclusive upper bound of the protocol port range. Specify `null` to clear an existing upper bound. If a lower - * bound has been set, the upper bound must also be set, and must not be smaller. + * The inclusive upper bound of the protocol port range. If set, `port_min` must also be set, and must not be larger. + * + * Specify `null` to remove an existing upper bound. * * @return the portMax */ @@ -238,8 +248,9 @@ public Long portMax() { /** * Gets the portMin. * - * The inclusive lower bound of the protocol port range. Specify `null` to clear an existing lower bound. If an upper - * bound has been set, the lower bound must also be set, and must not be larger. + * The inclusive lower bound of the protocol port range. If set, `port_max` must also be set, and must not be smaller. + * + * Specify `null` to remove an existing lower bound. * * @return the portMin */ @@ -253,7 +264,7 @@ public Long portMin() { * The IP addresses or security groups from which this rule will allow traffic (or to * which, for outbound rules). Can be specified as an IP address, a CIDR block, or a * security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to - * any source, for outbound rules). + * any destination, for outbound rules). * * @return the remote */ @@ -264,7 +275,9 @@ public SecurityGroupRuleRemotePatch remote() { /** * Gets the type. * - * The ICMP traffic type to allow. Specify `null` to remove an existing ICMP traffic type value. + * The ICMP traffic type to allow. + * + * Specify `null` to remove an existing ICMP traffic type value. * * @return the type */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototype.java index 01179118f6..149ac3349f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototype.java @@ -36,7 +36,7 @@ public class SecurityGroupRulePrototype extends GenericModel { } /** - * The direction of traffic to enforce, either `inbound` or `outbound`. + * The direction of traffic to enforce. */ public interface Direction { /** inbound. */ @@ -55,6 +55,20 @@ public interface IpVersion { String IPV4 = "ipv4"; } + /** + * The protocol to enforce. + */ + public interface Protocol { + /** all. */ + String ALL = "all"; + /** icmp. */ + String ICMP = "icmp"; + /** tcp. */ + String TCP = "tcp"; + /** udp. */ + String UDP = "udp"; + } + protected String direction; @SerializedName("ip_version") protected String ipVersion; @@ -67,13 +81,12 @@ public interface IpVersion { @SerializedName("port_min") protected Long portMin; - protected SecurityGroupRulePrototype() { - } + protected SecurityGroupRulePrototype() { } /** * Gets the direction. * - * The direction of traffic to enforce, either `inbound` or `outbound`. + * The direction of traffic to enforce. * * @return the direction */ @@ -108,10 +121,12 @@ public String protocol() { /** * Gets the remote. * - * The IP addresses or security groups from which this rule will allow traffic (or to - * which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - * security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow traffic - * from any source (or to any source, for outbound rules). + * The IP addresses or security groups from which this rule will allow traffic (or to which, + * for outbound rules). Can be specified as an IP address, a CIDR block, or a security group + * within the VPC. + * + * If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source + * (or to any destination, for outbound rules). * * @return the remote */ @@ -124,6 +139,8 @@ public SecurityGroupRuleRemotePrototype remote() { * * The ICMP traffic code to allow. * + * If specified, `type` must also be specified. If unspecified, all codes are allowed. + * * @return the code */ public Long code() { @@ -135,6 +152,8 @@ public Long code() { * * The ICMP traffic type to allow. * + * If unspecified, all types are allowed. + * * @return the type */ public Long type() { @@ -146,6 +165,9 @@ public Long type() { * * The inclusive upper bound of TCP/UDP port range. * + * If specified, `port_min` must also be specified, and must not be larger. If unspecified, `port_min` must also be + * unspecified, allowing traffic on all ports. + * * @return the portMax */ public Long portMax() { @@ -155,7 +177,10 @@ public Long portMax() { /** * Gets the portMin. * - * The inclusive lower bound of TCP/UDP port range. + * The inclusive lower bound of TCP/UDP port range + * + * If specified, `port_max` must also be specified, and must not be smaller. If unspecified, `port_max` must also be + * unspecified, allowing traffic on all ports. * * @return the portMin */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.java index 9a1bada0ed..33e13f4289 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.java @@ -13,13 +13,12 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * When `protocol` is `all`, then it's invalid to specify `port_min`, `port_max`, `type` or - * `code`. + * A rule allowing traffic for all supported protocols. */ public class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll extends SecurityGroupRulePrototype { /** - * The direction of traffic to enforce, either `inbound` or `outbound`. + * The direction of traffic to enforce. */ public interface Direction { /** inbound. */ @@ -56,6 +55,11 @@ public static class Builder { private String protocol; private SecurityGroupRuleRemotePrototype remote; + /** + * Instantiates a new Builder from an existing SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll instance. + * + * @param securityGroupRulePrototypeSecurityGroupRuleProtocolAll the instance to initialize the Builder with + */ public Builder(SecurityGroupRulePrototype securityGroupRulePrototypeSecurityGroupRuleProtocolAll) { this.direction = securityGroupRulePrototypeSecurityGroupRuleProtocolAll.direction; this.ipVersion = securityGroupRulePrototypeSecurityGroupRuleProtocolAll.ipVersion; @@ -134,6 +138,8 @@ public Builder remote(SecurityGroupRuleRemotePrototype remote) { } } + protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll() { } + protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, "direction cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.java index 32ac9dc9e2..166a9bb140 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.java @@ -13,14 +13,12 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * When `protocol` is `icmp`, the `type` property may optionally be specified. If specified, then ICMP traffic is - * allowed only for the specified ICMP type. Further, if `type` is specified, the `code` property may optionally be - * specified to allow traffic only for the specified ICMP code. + * A rule specifying the ICMP traffic to allow. */ public class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP extends SecurityGroupRulePrototype { /** - * The direction of traffic to enforce, either `inbound` or `outbound`. + * The direction of traffic to enforce. */ public interface Direction { /** inbound. */ @@ -59,6 +57,11 @@ public static class Builder { private SecurityGroupRuleRemotePrototype remote; private Long type; + /** + * Instantiates a new Builder from an existing SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP instance. + * + * @param securityGroupRulePrototypeSecurityGroupRuleProtocolIcmp the instance to initialize the Builder with + */ public Builder(SecurityGroupRulePrototype securityGroupRulePrototypeSecurityGroupRuleProtocolIcmp) { this.code = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.code; this.direction = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.direction; @@ -161,6 +164,8 @@ public Builder type(long type) { } } + protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP() { } + protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, "direction cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.java index b05c2893f6..4e8d4c1402 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.java @@ -13,14 +13,15 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * If `protocol` is either `tcp` or `udp`, then the rule may also contain `port_min` and - * `port_max`. Either both must be set, or neither. When neither is set then traffic is allowed on all ports. For a - * single port, set both to the same value. + * A rule specifying the TCP or UDP traffic to allow. + * + * Either both `port_min` and `port_max` will be present, or neither. When neither is present, all ports are allowed for + * the protocol. When both have the same value, that single port is allowed. */ public class SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP extends SecurityGroupRulePrototype { /** - * The direction of traffic to enforce, either `inbound` or `outbound`. + * The direction of traffic to enforce. */ public interface Direction { /** inbound. */ @@ -61,6 +62,11 @@ public static class Builder { private String protocol; private SecurityGroupRuleRemotePrototype remote; + /** + * Instantiates a new Builder from an existing SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP instance. + * + * @param securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp the instance to initialize the Builder with + */ public Builder(SecurityGroupRulePrototype securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) { this.direction = securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.direction; this.ipVersion = securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.ipVersion; @@ -163,6 +169,8 @@ public Builder remote(SecurityGroupRuleRemotePrototype remote) { } } + protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP() { } + protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, "direction cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemote.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemote.java index 033a66bcc9..3b1687b95d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemote.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemote.java @@ -18,7 +18,7 @@ /** * The IP addresses or security groups from which this rule allows traffic (or to which, for outbound rules). Can be * specified as an IP address, a CIDR block, or a security group. A CIDR block of `0.0.0.0/0` allows traffic from any - * source (or to any source, for outbound rules). + * source (or to any destination, for outbound rules). * * Classes which extend this class: * - SecurityGroupRuleRemoteIP @@ -36,8 +36,7 @@ public class SecurityGroupRuleRemote extends GenericModel { protected String id; protected String name; - protected SecurityGroupRuleRemote() { - } + protected SecurityGroupRuleRemote() { } /** * Gets the address. @@ -81,7 +80,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemoteCIDR.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemoteCIDR.java index 39fc272418..0baba950c2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemoteCIDR.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemoteCIDR.java @@ -17,5 +17,7 @@ */ public class SecurityGroupRuleRemoteCIDR extends SecurityGroupRuleRemote { + + protected SecurityGroupRuleRemoteCIDR() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemoteIP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemoteIP.java index 6cc0922611..5ea5bd04ad 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemoteIP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemoteIP.java @@ -17,5 +17,7 @@ */ public class SecurityGroupRuleRemoteIP extends SecurityGroupRuleRemote { + + protected SecurityGroupRuleRemoteIP() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatch.java index de687555aa..2aa0c5e82d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatch.java @@ -18,7 +18,7 @@ /** * The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be * specified as an IP address, a CIDR block, or a security group. A CIDR block of `0.0.0.0/0` will allow traffic from - * any source (or to any source, for outbound rules). + * any source (or to any destination, for outbound rules). * * Classes which extend this class: * - SecurityGroupRuleRemotePatchIP @@ -34,8 +34,7 @@ public class SecurityGroupRuleRemotePatch extends GenericModel { protected String crn; protected String href; - protected SecurityGroupRuleRemotePatch() { - } + protected SecurityGroupRuleRemotePatch() { } /** * Gets the address. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchCIDR.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchCIDR.java index 06612b4907..00af4ce5cc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchCIDR.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchCIDR.java @@ -24,6 +24,11 @@ public class SecurityGroupRuleRemotePatchCIDR extends SecurityGroupRuleRemotePat public static class Builder { private String cidrBlock; + /** + * Instantiates a new Builder from an existing SecurityGroupRuleRemotePatchCIDR instance. + * + * @param securityGroupRuleRemotePatchCidr the instance to initialize the Builder with + */ public Builder(SecurityGroupRuleRemotePatch securityGroupRuleRemotePatchCidr) { this.cidrBlock = securityGroupRuleRemotePatchCidr.cidrBlock; } @@ -64,6 +69,8 @@ public Builder cidrBlock(String cidrBlock) { } } + protected SecurityGroupRuleRemotePatchCIDR() { } + protected SecurityGroupRuleRemotePatchCIDR(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.cidrBlock, "cidrBlock cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchIP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchIP.java index d2fa640182..33cefdf3ab 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchIP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchIP.java @@ -24,6 +24,11 @@ public class SecurityGroupRuleRemotePatchIP extends SecurityGroupRuleRemotePatch public static class Builder { private String address; + /** + * Instantiates a new Builder from an existing SecurityGroupRuleRemotePatchIP instance. + * + * @param securityGroupRuleRemotePatchIp the instance to initialize the Builder with + */ public Builder(SecurityGroupRuleRemotePatch securityGroupRuleRemotePatchIp) { this.address = securityGroupRuleRemotePatchIp.address; } @@ -64,6 +69,8 @@ public Builder address(String address) { } } + protected SecurityGroupRuleRemotePatchIP() { } + protected SecurityGroupRuleRemotePatchIP(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.address, "address cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentity.java index a33a0cbc36..16fa60275d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentity.java @@ -23,7 +23,6 @@ public class SecurityGroupRuleRemotePatchSecurityGroupIdentity extends SecurityGroupRuleRemotePatch { - protected SecurityGroupRuleRemotePatchSecurityGroupIdentity() { - } + protected SecurityGroupRuleRemotePatchSecurityGroupIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN.java index 7d5f61e95c..ddedd44fa7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN.java @@ -24,6 +24,11 @@ public class SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdent public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN instance. + * + * @param securityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCrn the instance to initialize the Builder with + */ public Builder(SecurityGroupRuleRemotePatchSecurityGroupIdentity securityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCrn) { this.crn = securityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN() { } + protected SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref.java index 67f36b33e7..b7d3547ea8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref.java @@ -24,6 +24,11 @@ public class SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdent public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref instance. + * + * @param securityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref the instance to initialize the Builder with + */ public Builder(SecurityGroupRuleRemotePatchSecurityGroupIdentity securityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref) { this.href = securityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref() { } + protected SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById.java index f088168366..f1e86897f4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById.java @@ -24,6 +24,11 @@ public class SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdent public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById instance. + * + * @param securityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById the instance to initialize the Builder with + */ public Builder(SecurityGroupRuleRemotePatchSecurityGroupIdentity securityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById) { this.id = securityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById() { } + protected SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototype.java index fd19b161dd..208df6e94f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototype.java @@ -17,8 +17,10 @@ /** * The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be - * specified as an IP address, a CIDR block, or a security group. If omitted, a CIDR block of `0.0.0.0/0` will be used - * to allow traffic from any source (or to any source, for outbound rules). + * specified as an IP address, a CIDR block, or a security group within the VPC. + * + * If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source + * (or to any destination, for outbound rules). * * Classes which extend this class: * - SecurityGroupRuleRemotePrototypeIP @@ -34,8 +36,7 @@ public class SecurityGroupRuleRemotePrototype extends GenericModel { protected String crn; protected String href; - protected SecurityGroupRuleRemotePrototype() { - } + protected SecurityGroupRuleRemotePrototype() { } /** * Gets the address. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeCIDR.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeCIDR.java index 1230822d66..85093a40e0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeCIDR.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeCIDR.java @@ -24,6 +24,11 @@ public class SecurityGroupRuleRemotePrototypeCIDR extends SecurityGroupRuleRemot public static class Builder { private String cidrBlock; + /** + * Instantiates a new Builder from an existing SecurityGroupRuleRemotePrototypeCIDR instance. + * + * @param securityGroupRuleRemotePrototypeCidr the instance to initialize the Builder with + */ public Builder(SecurityGroupRuleRemotePrototype securityGroupRuleRemotePrototypeCidr) { this.cidrBlock = securityGroupRuleRemotePrototypeCidr.cidrBlock; } @@ -64,6 +69,8 @@ public Builder cidrBlock(String cidrBlock) { } } + protected SecurityGroupRuleRemotePrototypeCIDR() { } + protected SecurityGroupRuleRemotePrototypeCIDR(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.cidrBlock, "cidrBlock cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeIP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeIP.java index db4b4366c5..f3731c76a1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeIP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeIP.java @@ -24,6 +24,11 @@ public class SecurityGroupRuleRemotePrototypeIP extends SecurityGroupRuleRemoteP public static class Builder { private String address; + /** + * Instantiates a new Builder from an existing SecurityGroupRuleRemotePrototypeIP instance. + * + * @param securityGroupRuleRemotePrototypeIp the instance to initialize the Builder with + */ public Builder(SecurityGroupRuleRemotePrototype securityGroupRuleRemotePrototypeIp) { this.address = securityGroupRuleRemotePrototypeIp.address; } @@ -64,6 +69,8 @@ public Builder address(String address) { } } + protected SecurityGroupRuleRemotePrototypeIP() { } + protected SecurityGroupRuleRemotePrototypeIP(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.address, "address cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentity.java index 4392f39cfa..82c525d4f9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentity.java @@ -23,7 +23,6 @@ public class SecurityGroupRuleRemotePrototypeSecurityGroupIdentity extends SecurityGroupRuleRemotePrototype { - protected SecurityGroupRuleRemotePrototypeSecurityGroupIdentity() { - } + protected SecurityGroupRuleRemotePrototypeSecurityGroupIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN.java index 3dd3719241..43a760447e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN.java @@ -24,6 +24,11 @@ public class SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupI public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN instance. + * + * @param securityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCrn the instance to initialize the Builder with + */ public Builder(SecurityGroupRuleRemotePrototypeSecurityGroupIdentity securityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCrn) { this.crn = securityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN() { } + protected SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref.java index f78fa2c3d6..ef0fa9dd5c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref.java @@ -24,6 +24,11 @@ public class SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupI public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref instance. + * + * @param securityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref the instance to initialize the Builder with + */ public Builder(SecurityGroupRuleRemotePrototypeSecurityGroupIdentity securityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref) { this.href = securityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref() { } + protected SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById.java index 6ed95afbbb..5e48f0b16c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById.java @@ -24,6 +24,11 @@ public class SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupI public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById instance. + * + * @param securityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById the instance to initialize the Builder with + */ public Builder(SecurityGroupRuleRemotePrototypeSecurityGroupIdentity securityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById) { this.id = securityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById() { } + protected SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemoteSecurityGroupReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemoteSecurityGroupReference.java index 00ec082ebc..a7801d0a4e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemoteSecurityGroupReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleRemoteSecurityGroupReference.java @@ -17,5 +17,7 @@ */ public class SecurityGroupRuleRemoteSecurityGroupReference extends SecurityGroupRuleRemote { + + protected SecurityGroupRuleRemoteSecurityGroupReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolAll.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolAll.java index a056b72305..31b955f0c1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolAll.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolAll.java @@ -13,13 +13,12 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * When `protocol` is `all`, then it's invalid to specify `port_min`, `port_max`, `type` or - * `code`. + * A rule allowing traffic for all supported protocols. */ public class SecurityGroupRuleSecurityGroupRuleProtocolAll extends SecurityGroupRule { /** - * The direction of traffic to enforce, either `inbound` or `outbound`. + * The direction of traffic to enforce. */ public interface Direction { /** inbound. */ @@ -46,5 +45,7 @@ public interface Protocol { String ALL = "all"; } + + protected SecurityGroupRuleSecurityGroupRuleProtocolAll() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolICMP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolICMP.java index 3abfcf0a82..2cc0521453 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolICMP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolICMP.java @@ -13,14 +13,12 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * When `protocol` is `icmp`, the `type` property may optionally be specified. If specified, then ICMP traffic is - * allowed only for the specified ICMP type. Further, if `type` is specified, the `code` property may optionally be - * specified to allow traffic only for the specified ICMP code. + * A rule specifying the ICMP traffic to allow. */ public class SecurityGroupRuleSecurityGroupRuleProtocolICMP extends SecurityGroupRule { /** - * The direction of traffic to enforce, either `inbound` or `outbound`. + * The direction of traffic to enforce. */ public interface Direction { /** inbound. */ @@ -47,5 +45,7 @@ public interface Protocol { String ICMP = "icmp"; } + + protected SecurityGroupRuleSecurityGroupRuleProtocolICMP() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.java index 91d3c4f377..734f213887 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.java @@ -13,14 +13,15 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * If `protocol` is either `tcp` or `udp`, then the rule may also contain `port_min` and - * `port_max`. Either both must be set, or neither. When neither is set then traffic is allowed on all ports. For a - * single port, set both to the same value. + * A rule specifying the TCP or UDP traffic to allow. + * + * Either both `port_min` and `port_max` will be present, or neither. When neither is present, all ports are allowed for + * the protocol. When both have the same value, that single port is allowed. */ public class SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP extends SecurityGroupRule { /** - * The direction of traffic to enforce, either `inbound` or `outbound`. + * The direction of traffic to enforce. */ public interface Direction { /** inbound. */ @@ -49,5 +50,7 @@ public interface Protocol { String UDP = "udp"; } + + protected SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetCollection.java index 81e5ecd314..830af8ea06 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetCollection.java @@ -29,6 +29,8 @@ public class SecurityGroupTargetCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected SecurityGroupTargetCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetCollectionFirst.java index 9556e03a27..9575f9936f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetCollectionFirst.java @@ -21,6 +21,8 @@ public class SecurityGroupTargetCollectionFirst extends GenericModel { protected String href; + protected SecurityGroupTargetCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetCollectionNext.java index f4f00b1980..332edbd1cf 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetCollectionNext.java @@ -21,6 +21,8 @@ public class SecurityGroupTargetCollectionNext extends GenericModel { protected String href; + protected SecurityGroupTargetCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReference.java index f18598dcb7..a2cd0b3096 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReference.java @@ -44,13 +44,12 @@ public interface ResourceType { protected String resourceType; protected String crn; - protected SecurityGroupTargetReference() { - } + protected SecurityGroupTargetReference() { } /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceEndpointGatewayReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceEndpointGatewayReference.java index 9a118f0239..55670395d2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceEndpointGatewayReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceEndpointGatewayReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String ENDPOINT_GATEWAY = "endpoint_gateway"; } + + protected SecurityGroupTargetReferenceEndpointGatewayReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceLoadBalancerReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceLoadBalancerReference.java index 3b64fdce70..e0a68fb9b7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceLoadBalancerReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceLoadBalancerReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String LOAD_BALANCER = "load_balancer"; } + + protected SecurityGroupTargetReferenceLoadBalancerReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.java index 7c40608334..5d77c13598 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.java @@ -25,5 +25,7 @@ public interface ResourceType { String NETWORK_INTERFACE = "network_interface"; } + + protected SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceVPNServerReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceVPNServerReference.java index f68a48bd5e..eb33de5761 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceVPNServerReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetReferenceVPNServerReference.java @@ -25,5 +25,7 @@ public interface ResourceType { String VPN_SERVER = "vpn_server"; } + + protected SecurityGroupTargetReferenceVPNServerReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetsPager.java new file mode 100644 index 0000000000..c1d280147b --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupTargetsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * SecurityGroupTargetsPager can be used to simplify the use of the "listSecurityGroupTargets" method. + */ +public class SecurityGroupTargetsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListSecurityGroupTargetsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected SecurityGroupTargetsPager() { } + + /** + * Constructs a new SecurityGroupTargetsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listSecurityGroupTargets" method + * @param options the ListSecurityGroupTargetsOptions instance to be used to invoke the "listSecurityGroupTargets" method + */ + public SecurityGroupTargetsPager(Vpc client, ListSecurityGroupTargetsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<SecurityGroupTargetReference> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListSecurityGroupTargetsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + SecurityGroupTargetCollection result = client.listSecurityGroupTargets(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getTargets(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<SecurityGroupTargetReference> containing all results returned by the "listSecurityGroupTargets" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupsPager.java new file mode 100644 index 0000000000..9ce4ffa1f2 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * SecurityGroupsPager can be used to simplify the use of the "listSecurityGroups" method. + */ +public class SecurityGroupsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListSecurityGroupsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected SecurityGroupsPager() { } + + /** + * Constructs a new SecurityGroupsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listSecurityGroups" method + * @param options the ListSecurityGroupsOptions instance to be used to invoke the "listSecurityGroups" method + */ + public SecurityGroupsPager(Vpc client, ListSecurityGroupsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<SecurityGroup> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListSecurityGroupsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + SecurityGroupCollection result = client.listSecurityGroups(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getSecurityGroups(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<SecurityGroup> containing all results returned by the "listSecurityGroups" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SetSubnetPublicGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SetSubnetPublicGatewayOptions.java index cb73999ae4..b8c3ac0f7b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SetSubnetPublicGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SetSubnetPublicGatewayOptions.java @@ -29,6 +29,11 @@ public static class Builder { private String id; private PublicGatewayIdentity publicGatewayIdentity; + /** + * Instantiates a new Builder from an existing SetSubnetPublicGatewayOptions instance. + * + * @param setSubnetPublicGatewayOptions the instance to initialize the Builder with + */ private Builder(SetSubnetPublicGatewayOptions setSubnetPublicGatewayOptions) { this.id = setSubnetPublicGatewayOptions.id; this.publicGatewayIdentity = setSubnetPublicGatewayOptions.publicGatewayIdentity; @@ -83,6 +88,8 @@ public Builder publicGatewayIdentity(PublicGatewayIdentity publicGatewayIdentity } } + protected SetSubnetPublicGatewayOptions() { } + protected SetSubnetPublicGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Snapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Snapshot.java index 1784f616e1..e0e0808050 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Snapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Snapshot.java @@ -96,6 +96,8 @@ public interface ResourceType { @SerializedName("user_tags") protected List userTags; + protected Snapshot() { } + /** * Gets the backupPolicyPlan. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotClone.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotClone.java index 41b6a666d2..b38f9fc943 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotClone.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotClone.java @@ -27,6 +27,8 @@ public class SnapshotClone extends GenericModel { protected Date createdAt; protected ZoneReference zone; + protected SnapshotClone() { } + /** * Gets the available. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCloneCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCloneCollection.java index 8980030575..0c047e2ad0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCloneCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCloneCollection.java @@ -23,6 +23,8 @@ public class SnapshotCloneCollection extends GenericModel { protected List clones; + protected SnapshotCloneCollection() { } + /** * Gets the clones. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotClonePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotClonePrototype.java index e4e543851c..243fc81181 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotClonePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotClonePrototype.java @@ -27,6 +27,11 @@ public class SnapshotClonePrototype extends GenericModel { public static class Builder { private ZoneIdentity zone; + /** + * Instantiates a new Builder from an existing SnapshotClonePrototype instance. + * + * @param snapshotClonePrototype the instance to initialize the Builder with + */ private Builder(SnapshotClonePrototype snapshotClonePrototype) { this.zone = snapshotClonePrototype.zone; } @@ -67,6 +72,8 @@ public Builder zone(ZoneIdentity zone) { } } + protected SnapshotClonePrototype() { } + protected SnapshotClonePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.zone, "zone cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollection.java index a1d17ed42a..7d94da6b45 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollection.java @@ -29,6 +29,8 @@ public class SnapshotCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected SnapshotCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionFirst.java index 912fadea37..25bf8538dc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionFirst.java @@ -21,6 +21,8 @@ public class SnapshotCollectionFirst extends GenericModel { protected String href; + protected SnapshotCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionNext.java index d1eb7ab305..d475d42b2c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionNext.java @@ -21,6 +21,8 @@ public class SnapshotCollectionNext extends GenericModel { protected String href; + protected SnapshotCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentity.java index 71419c24b6..a118ce5751 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentity.java @@ -28,8 +28,7 @@ public class SnapshotIdentity extends GenericModel { protected String crn; protected String href; - protected SnapshotIdentity() { - } + protected SnapshotIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentityByCRN.java index 2f85e20a2d..a312bab1c2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentityByCRN.java @@ -24,6 +24,11 @@ public class SnapshotIdentityByCRN extends SnapshotIdentity { public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing SnapshotIdentityByCRN instance. + * + * @param snapshotIdentityByCrn the instance to initialize the Builder with + */ public Builder(SnapshotIdentity snapshotIdentityByCrn) { this.crn = snapshotIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected SnapshotIdentityByCRN() { } + protected SnapshotIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentityByHref.java index c2f67ff9b2..d6ff994ec5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentityByHref.java @@ -24,6 +24,11 @@ public class SnapshotIdentityByHref extends SnapshotIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing SnapshotIdentityByHref instance. + * + * @param snapshotIdentityByHref the instance to initialize the Builder with + */ public Builder(SnapshotIdentity snapshotIdentityByHref) { this.href = snapshotIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected SnapshotIdentityByHref() { } + protected SnapshotIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentityById.java index d0d0062f06..977c126d74 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotIdentityById.java @@ -24,6 +24,11 @@ public class SnapshotIdentityById extends SnapshotIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing SnapshotIdentityById instance. + * + * @param snapshotIdentityById the instance to initialize the Builder with + */ public Builder(SnapshotIdentity snapshotIdentityById) { this.id = snapshotIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected SnapshotIdentityById() { } + protected SnapshotIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatch.java index f02064fc57..97af452892 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatch.java @@ -36,6 +36,11 @@ public static class Builder { private String name; private List userTags; + /** + * Instantiates a new Builder from an existing SnapshotPatch instance. + * + * @param snapshotPatch the instance to initialize the Builder with + */ private Builder(SnapshotPatch snapshotPatch) { this.name = snapshotPatch.name; this.userTags = snapshotPatch.userTags; @@ -96,6 +101,8 @@ public Builder userTags(List userTags) { } } + protected SnapshotPatch() { } + protected SnapshotPatch(Builder builder) { name = builder.name; userTags = builder.userTags; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototype.java index 30bbfcef3b..160e3fddf8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototype.java @@ -33,8 +33,7 @@ public class SnapshotPrototype extends GenericModel { @SerializedName("source_volume") protected VolumeIdentity sourceVolume; - protected SnapshotPrototype() { - } + protected SnapshotPrototype() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolume.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolume.java index 079fbe6bdc..74f28bfa07 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolume.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolume.java @@ -30,6 +30,11 @@ public static class Builder { private List userTags; private VolumeIdentity sourceVolume; + /** + * Instantiates a new Builder from an existing SnapshotPrototypeSnapshotBySourceVolume instance. + * + * @param snapshotPrototypeSnapshotBySourceVolume the instance to initialize the Builder with + */ public Builder(SnapshotPrototype snapshotPrototypeSnapshotBySourceVolume) { this.name = snapshotPrototypeSnapshotBySourceVolume.name; this.resourceGroup = snapshotPrototypeSnapshotBySourceVolume.resourceGroup; @@ -123,6 +128,8 @@ public Builder sourceVolume(VolumeIdentity sourceVolume) { } } + protected SnapshotPrototypeSnapshotBySourceVolume() { } + protected SnapshotPrototypeSnapshotBySourceVolume(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.sourceVolume, "sourceVolume cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReference.java index 961dfebded..03e54a094b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReference.java @@ -36,6 +36,8 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected SnapshotReference() { } + /** * Gets the crn. * @@ -50,7 +52,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReferenceDeleted.java index 14f9639d31..0e88bab383 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class SnapshotReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class SnapshotReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected SnapshotReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotsPager.java new file mode 100644 index 0000000000..ef2e5119ee --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * SnapshotsPager can be used to simplify the use of the "listSnapshots" method. + */ +public class SnapshotsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListSnapshotsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected SnapshotsPager() { } + + /** + * Constructs a new SnapshotsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listSnapshots" method + * @param options the ListSnapshotsOptions instance to be used to invoke the "listSnapshots" method + */ + public SnapshotsPager(Vpc client, ListSnapshotsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<Snapshot> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListSnapshotsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + SnapshotCollection result = client.listSnapshots(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getSnapshots(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<Snapshot> containing all results returned by the "listSnapshots" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/StartBareMetalServerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/StartBareMetalServerOptions.java index f060d0af55..3590145cad 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/StartBareMetalServerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/StartBareMetalServerOptions.java @@ -27,6 +27,11 @@ public class StartBareMetalServerOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing StartBareMetalServerOptions instance. + * + * @param startBareMetalServerOptions the instance to initialize the Builder with + */ private Builder(StartBareMetalServerOptions startBareMetalServerOptions) { this.id = startBareMetalServerOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected StartBareMetalServerOptions() { } + protected StartBareMetalServerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/StopBareMetalServerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/StopBareMetalServerOptions.java index 2bd4ca18d0..a2bd920db9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/StopBareMetalServerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/StopBareMetalServerOptions.java @@ -41,6 +41,11 @@ public static class Builder { private String id; private String type; + /** + * Instantiates a new Builder from an existing StopBareMetalServerOptions instance. + * + * @param stopBareMetalServerOptions the instance to initialize the Builder with + */ private Builder(StopBareMetalServerOptions stopBareMetalServerOptions) { this.id = stopBareMetalServerOptions.id; this.type = stopBareMetalServerOptions.type; @@ -95,6 +100,8 @@ public Builder type(String type) { } } + protected StopBareMetalServerOptions() { } + protected StopBareMetalServerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Subnet.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Subnet.java index d7b2450298..6266472bf7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Subnet.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Subnet.java @@ -80,6 +80,8 @@ public interface Status { protected VPCReference vpc; protected ZoneReference zone; + protected Subnet() { } + /** * Gets the availableIpv4AddressCount. * @@ -252,7 +254,7 @@ public Long getTotalIpv4AddressCount() { /** * Gets the vpc. * - * The VPC this subnet is a part of. + * The VPC this subnet resides in. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetCollection.java index d863aee4c1..00fb6c1de5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetCollection.java @@ -29,6 +29,8 @@ public class SubnetCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected SubnetCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetCollectionFirst.java index dbe96010cb..5803b57144 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetCollectionFirst.java @@ -21,6 +21,8 @@ public class SubnetCollectionFirst extends GenericModel { protected String href; + protected SubnetCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetCollectionNext.java index 34c4ff1177..3dcaad3997 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetCollectionNext.java @@ -21,6 +21,8 @@ public class SubnetCollectionNext extends GenericModel { protected String href; + protected SubnetCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentity.java index 6a673ca965..33c8828382 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentity.java @@ -28,8 +28,7 @@ public class SubnetIdentity extends GenericModel { protected String crn; protected String href; - protected SubnetIdentity() { - } + protected SubnetIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentityByCRN.java index f0e1e010f5..5c22e9c1b2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentityByCRN.java @@ -24,6 +24,11 @@ public class SubnetIdentityByCRN extends SubnetIdentity { public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing SubnetIdentityByCRN instance. + * + * @param subnetIdentityByCrn the instance to initialize the Builder with + */ public Builder(SubnetIdentity subnetIdentityByCrn) { this.crn = subnetIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected SubnetIdentityByCRN() { } + protected SubnetIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentityByHref.java index c111bd3d0b..23b64d7097 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentityByHref.java @@ -24,6 +24,11 @@ public class SubnetIdentityByHref extends SubnetIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing SubnetIdentityByHref instance. + * + * @param subnetIdentityByHref the instance to initialize the Builder with + */ public Builder(SubnetIdentity subnetIdentityByHref) { this.href = subnetIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected SubnetIdentityByHref() { } + protected SubnetIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentityById.java index fef7c78316..7c1385782a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetIdentityById.java @@ -24,6 +24,11 @@ public class SubnetIdentityById extends SubnetIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing SubnetIdentityById instance. + * + * @param subnetIdentityById the instance to initialize the Builder with + */ public Builder(SubnetIdentity subnetIdentityById) { this.id = subnetIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected SubnetIdentityById() { } + protected SubnetIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPatch.java index 5e7bbb7586..6525ad272d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPatch.java @@ -40,6 +40,11 @@ public static class Builder { private SubnetPublicGatewayPatch publicGateway; private RoutingTableIdentity routingTable; + /** + * Instantiates a new Builder from an existing SubnetPatch instance. + * + * @param subnetPatch the instance to initialize the Builder with + */ private Builder(SubnetPatch subnetPatch) { this.name = subnetPatch.name; this.networkAcl = subnetPatch.networkAcl; @@ -107,6 +112,8 @@ public Builder routingTable(RoutingTableIdentity routingTable) { } } + protected SubnetPatch() { } + protected SubnetPatch(Builder builder) { name = builder.name; networkAcl = builder.networkAcl; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPrototype.java index 75f4b67bbf..a62beccb2f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPrototype.java @@ -50,8 +50,7 @@ public interface IpVersion { @SerializedName("ipv4_cidr_block") protected String ipv4CidrBlock; - protected SubnetPrototype() { - } + protected SubnetPrototype() { } /** * Gets the ipVersion. @@ -127,7 +126,7 @@ public RoutingTableIdentity routingTable() { /** * Gets the vpc. * - * The VPC the subnet is to be a part of. + * The VPC the subnet will reside in. * * @return the vpc */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPrototypeSubnetByCIDR.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPrototypeSubnetByCIDR.java index 64af3c387e..b28abea471 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPrototypeSubnetByCIDR.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPrototypeSubnetByCIDR.java @@ -40,6 +40,11 @@ public static class Builder { private String ipv4CidrBlock; private ZoneIdentity zone; + /** + * Instantiates a new Builder from an existing SubnetPrototypeSubnetByCIDR instance. + * + * @param subnetPrototypeSubnetByCidr the instance to initialize the Builder with + */ public Builder(SubnetPrototype subnetPrototypeSubnetByCidr) { this.ipVersion = subnetPrototypeSubnetByCidr.ipVersion; this.name = subnetPrototypeSubnetByCidr.name; @@ -178,6 +183,8 @@ public Builder zone(ZoneIdentity zone) { } } + protected SubnetPrototypeSubnetByCIDR() { } + protected SubnetPrototypeSubnetByCIDR(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.vpc, "vpc cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPrototypeSubnetByTotalCount.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPrototypeSubnetByTotalCount.java index 16473f31ab..ebb0e6e405 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPrototypeSubnetByTotalCount.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPrototypeSubnetByTotalCount.java @@ -40,6 +40,11 @@ public static class Builder { private Long totalIpv4AddressCount; private ZoneIdentity zone; + /** + * Instantiates a new Builder from an existing SubnetPrototypeSubnetByTotalCount instance. + * + * @param subnetPrototypeSubnetByTotalCount the instance to initialize the Builder with + */ public Builder(SubnetPrototype subnetPrototypeSubnetByTotalCount) { this.ipVersion = subnetPrototypeSubnetByTotalCount.ipVersion; this.name = subnetPrototypeSubnetByTotalCount.name; @@ -180,6 +185,8 @@ public Builder zone(ZoneIdentity zone) { } } + protected SubnetPrototypeSubnetByTotalCount() { } + protected SubnetPrototypeSubnetByTotalCount(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.vpc, "vpc cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatch.java index e27917c148..b126a99b6a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatch.java @@ -28,8 +28,7 @@ public class SubnetPublicGatewayPatch extends GenericModel { protected String crn; protected String href; - protected SubnetPublicGatewayPatch() { - } + protected SubnetPublicGatewayPatch() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatchPublicGatewayIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatchPublicGatewayIdentityByCRN.java index 5834d8ca72..22f0b1b1b5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatchPublicGatewayIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatchPublicGatewayIdentityByCRN.java @@ -24,6 +24,11 @@ public class SubnetPublicGatewayPatchPublicGatewayIdentityByCRN extends SubnetPu public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing SubnetPublicGatewayPatchPublicGatewayIdentityByCRN instance. + * + * @param subnetPublicGatewayPatchPublicGatewayIdentityByCrn the instance to initialize the Builder with + */ public Builder(SubnetPublicGatewayPatch subnetPublicGatewayPatchPublicGatewayIdentityByCrn) { this.crn = subnetPublicGatewayPatchPublicGatewayIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected SubnetPublicGatewayPatchPublicGatewayIdentityByCRN() { } + protected SubnetPublicGatewayPatchPublicGatewayIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatchPublicGatewayIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatchPublicGatewayIdentityByHref.java index 1dbdfd32c1..363f8c3921 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatchPublicGatewayIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatchPublicGatewayIdentityByHref.java @@ -24,6 +24,11 @@ public class SubnetPublicGatewayPatchPublicGatewayIdentityByHref extends SubnetP public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing SubnetPublicGatewayPatchPublicGatewayIdentityByHref instance. + * + * @param subnetPublicGatewayPatchPublicGatewayIdentityByHref the instance to initialize the Builder with + */ public Builder(SubnetPublicGatewayPatch subnetPublicGatewayPatchPublicGatewayIdentityByHref) { this.href = subnetPublicGatewayPatchPublicGatewayIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected SubnetPublicGatewayPatchPublicGatewayIdentityByHref() { } + protected SubnetPublicGatewayPatchPublicGatewayIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatchPublicGatewayIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatchPublicGatewayIdentityById.java index ae082602f1..9e22e4075d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatchPublicGatewayIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetPublicGatewayPatchPublicGatewayIdentityById.java @@ -24,6 +24,11 @@ public class SubnetPublicGatewayPatchPublicGatewayIdentityById extends SubnetPub public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing SubnetPublicGatewayPatchPublicGatewayIdentityById instance. + * + * @param subnetPublicGatewayPatchPublicGatewayIdentityById the instance to initialize the Builder with + */ public Builder(SubnetPublicGatewayPatch subnetPublicGatewayPatchPublicGatewayIdentityById) { this.id = subnetPublicGatewayPatchPublicGatewayIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected SubnetPublicGatewayPatchPublicGatewayIdentityById() { } + protected SubnetPublicGatewayPatchPublicGatewayIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetReference.java index 2a53d53241..3fca84f7da 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetReference.java @@ -36,6 +36,8 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected SubnetReference() { } + /** * Gets the crn. * @@ -50,7 +52,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetReferenceDeleted.java index 451225b16d..ad6f026e40 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class SubnetReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class SubnetReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected SubnetReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetReservedIpsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetReservedIpsPager.java new file mode 100644 index 0000000000..ab0b9b4b25 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetReservedIpsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * SubnetReservedIpsPager can be used to simplify the use of the "listSubnetReservedIps" method. + */ +public class SubnetReservedIpsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListSubnetReservedIpsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected SubnetReservedIpsPager() { } + + /** + * Constructs a new SubnetReservedIpsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listSubnetReservedIps" method + * @param options the ListSubnetReservedIpsOptions instance to be used to invoke the "listSubnetReservedIps" method + */ + public SubnetReservedIpsPager(Vpc client, ListSubnetReservedIpsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<ReservedIP> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListSubnetReservedIpsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + ReservedIPCollection result = client.listSubnetReservedIps(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getReservedIps(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<ReservedIP> containing all results returned by the "listSubnetReservedIps" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetsPager.java new file mode 100644 index 0000000000..04752fbcad --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SubnetsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * SubnetsPager can be used to simplify the use of the "listSubnets" method. + */ +public class SubnetsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListSubnetsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected SubnetsPager() { } + + /** + * Constructs a new SubnetsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listSubnets" method + * @param options the ListSubnetsOptions instance to be used to invoke the "listSubnets" method + */ + public SubnetsPager(Vpc client, ListSubnetsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<Subnet> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListSubnetsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + SubnetCollection result = client.listSubnets(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getSubnets(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<Subnet> containing all results returned by the "listSubnets" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileIdentity.java index 6431023c8f..d069b868a5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileIdentity.java @@ -26,8 +26,7 @@ public class TrustedProfileIdentity extends GenericModel { protected String id; protected String crn; - protected TrustedProfileIdentity() { - } + protected TrustedProfileIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileIdentityTrustedProfileByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileIdentityTrustedProfileByCRN.java index 2b3daa77af..fb0c1670bb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileIdentityTrustedProfileByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileIdentityTrustedProfileByCRN.java @@ -24,6 +24,11 @@ public class TrustedProfileIdentityTrustedProfileByCRN extends TrustedProfileIde public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing TrustedProfileIdentityTrustedProfileByCRN instance. + * + * @param trustedProfileIdentityTrustedProfileByCrn the instance to initialize the Builder with + */ public Builder(TrustedProfileIdentity trustedProfileIdentityTrustedProfileByCrn) { this.crn = trustedProfileIdentityTrustedProfileByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected TrustedProfileIdentityTrustedProfileByCRN() { } + protected TrustedProfileIdentityTrustedProfileByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileIdentityTrustedProfileById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileIdentityTrustedProfileById.java index 688048682e..eacc0bf184 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileIdentityTrustedProfileById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileIdentityTrustedProfileById.java @@ -24,6 +24,11 @@ public class TrustedProfileIdentityTrustedProfileById extends TrustedProfileIden public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing TrustedProfileIdentityTrustedProfileById instance. + * + * @param trustedProfileIdentityTrustedProfileById the instance to initialize the Builder with + */ public Builder(TrustedProfileIdentity trustedProfileIdentityTrustedProfileById) { this.id = trustedProfileIdentityTrustedProfileById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected TrustedProfileIdentityTrustedProfileById() { } + protected TrustedProfileIdentityTrustedProfileById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileReference.java index ecd35d3a95..1db69a1ce3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/TrustedProfileReference.java @@ -33,6 +33,8 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected TrustedProfileReference() { } + /** * Gets the crn. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UnsetSubnetPublicGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UnsetSubnetPublicGatewayOptions.java index 1ea7529899..fe0f2bc4bb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UnsetSubnetPublicGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UnsetSubnetPublicGatewayOptions.java @@ -27,6 +27,11 @@ public class UnsetSubnetPublicGatewayOptions extends GenericModel { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing UnsetSubnetPublicGatewayOptions instance. + * + * @param unsetSubnetPublicGatewayOptions the instance to initialize the Builder with + */ private Builder(UnsetSubnetPublicGatewayOptions unsetSubnetPublicGatewayOptions) { this.id = unsetSubnetPublicGatewayOptions.id; } @@ -67,6 +72,8 @@ public Builder id(String id) { } } + protected UnsetSubnetPublicGatewayOptions() { } + protected UnsetSubnetPublicGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBackupPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBackupPolicyOptions.java index 7600e9dfc2..fd228321f4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBackupPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBackupPolicyOptions.java @@ -33,6 +33,11 @@ public static class Builder { private Map backupPolicyPatch; private String ifMatch; + /** + * Instantiates a new Builder from an existing UpdateBackupPolicyOptions instance. + * + * @param updateBackupPolicyOptions the instance to initialize the Builder with + */ private Builder(UpdateBackupPolicyOptions updateBackupPolicyOptions) { this.id = updateBackupPolicyOptions.id; this.backupPolicyPatch = updateBackupPolicyOptions.backupPolicyPatch; @@ -99,6 +104,8 @@ public Builder ifMatch(String ifMatch) { } } + protected UpdateBackupPolicyOptions() { } + protected UpdateBackupPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBackupPolicyPlanOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBackupPolicyPlanOptions.java index dda76bac13..953d00ce47 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBackupPolicyPlanOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBackupPolicyPlanOptions.java @@ -35,6 +35,11 @@ public static class Builder { private Map backupPolicyPlanPatch; private String ifMatch; + /** + * Instantiates a new Builder from an existing UpdateBackupPolicyPlanOptions instance. + * + * @param updateBackupPolicyPlanOptions the instance to initialize the Builder with + */ private Builder(UpdateBackupPolicyPlanOptions updateBackupPolicyPlanOptions) { this.backupPolicyId = updateBackupPolicyPlanOptions.backupPolicyId; this.id = updateBackupPolicyPlanOptions.id; @@ -115,6 +120,8 @@ public Builder ifMatch(String ifMatch) { } } + protected UpdateBackupPolicyPlanOptions() { } + protected UpdateBackupPolicyPlanOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.backupPolicyId, "backupPolicyId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBareMetalServerDiskOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBareMetalServerDiskOptions.java index 8d07d8389f..f7a2f322f6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBareMetalServerDiskOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBareMetalServerDiskOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map bareMetalServerDiskPatch; + /** + * Instantiates a new Builder from an existing UpdateBareMetalServerDiskOptions instance. + * + * @param updateBareMetalServerDiskOptions the instance to initialize the Builder with + */ private Builder(UpdateBareMetalServerDiskOptions updateBareMetalServerDiskOptions) { this.bareMetalServerId = updateBareMetalServerDiskOptions.bareMetalServerId; this.id = updateBareMetalServerDiskOptions.id; @@ -101,6 +106,8 @@ public Builder bareMetalServerDiskPatch(Map bareMetalServerDiskP } } + protected UpdateBareMetalServerDiskOptions() { } + protected UpdateBareMetalServerDiskOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBareMetalServerNetworkInterfaceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBareMetalServerNetworkInterfaceOptions.java index 9b8135c9f4..70a0dc6a2e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBareMetalServerNetworkInterfaceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBareMetalServerNetworkInterfaceOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map bareMetalServerNetworkInterfacePatch; + /** + * Instantiates a new Builder from an existing UpdateBareMetalServerNetworkInterfaceOptions instance. + * + * @param updateBareMetalServerNetworkInterfaceOptions the instance to initialize the Builder with + */ private Builder(UpdateBareMetalServerNetworkInterfaceOptions updateBareMetalServerNetworkInterfaceOptions) { this.bareMetalServerId = updateBareMetalServerNetworkInterfaceOptions.bareMetalServerId; this.id = updateBareMetalServerNetworkInterfaceOptions.id; @@ -101,6 +106,8 @@ public Builder bareMetalServerNetworkInterfacePatch(Map bareMeta } } + protected UpdateBareMetalServerNetworkInterfaceOptions() { } + protected UpdateBareMetalServerNetworkInterfaceOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.bareMetalServerId, "bareMetalServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBareMetalServerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBareMetalServerOptions.java index 23e68297d9..a976e1ff9a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBareMetalServerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateBareMetalServerOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map bareMetalServerPatch; + /** + * Instantiates a new Builder from an existing UpdateBareMetalServerOptions instance. + * + * @param updateBareMetalServerOptions the instance to initialize the Builder with + */ private Builder(UpdateBareMetalServerOptions updateBareMetalServerOptions) { this.id = updateBareMetalServerOptions.id; this.bareMetalServerPatch = updateBareMetalServerOptions.bareMetalServerPatch; @@ -85,6 +90,8 @@ public Builder bareMetalServerPatch(Map bareMetalServerPatch) { } } + protected UpdateBareMetalServerOptions() { } + protected UpdateBareMetalServerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateDedicatedHostDiskOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateDedicatedHostDiskOptions.java index 421d5df22a..d5e9759681 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateDedicatedHostDiskOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateDedicatedHostDiskOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map dedicatedHostDiskPatch; + /** + * Instantiates a new Builder from an existing UpdateDedicatedHostDiskOptions instance. + * + * @param updateDedicatedHostDiskOptions the instance to initialize the Builder with + */ private Builder(UpdateDedicatedHostDiskOptions updateDedicatedHostDiskOptions) { this.dedicatedHostId = updateDedicatedHostDiskOptions.dedicatedHostId; this.id = updateDedicatedHostDiskOptions.id; @@ -101,6 +106,8 @@ public Builder dedicatedHostDiskPatch(Map dedicatedHostDiskPatch } } + protected UpdateDedicatedHostDiskOptions() { } + protected UpdateDedicatedHostDiskOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.dedicatedHostId, "dedicatedHostId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateDedicatedHostGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateDedicatedHostGroupOptions.java index cbc2655b8b..23f31a0a03 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateDedicatedHostGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateDedicatedHostGroupOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map dedicatedHostGroupPatch; + /** + * Instantiates a new Builder from an existing UpdateDedicatedHostGroupOptions instance. + * + * @param updateDedicatedHostGroupOptions the instance to initialize the Builder with + */ private Builder(UpdateDedicatedHostGroupOptions updateDedicatedHostGroupOptions) { this.id = updateDedicatedHostGroupOptions.id; this.dedicatedHostGroupPatch = updateDedicatedHostGroupOptions.dedicatedHostGroupPatch; @@ -85,6 +90,8 @@ public Builder dedicatedHostGroupPatch(Map dedicatedHostGroupPat } } + protected UpdateDedicatedHostGroupOptions() { } + protected UpdateDedicatedHostGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateDedicatedHostOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateDedicatedHostOptions.java index 1cc9f63305..b2f269f35d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateDedicatedHostOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateDedicatedHostOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map dedicatedHostPatch; + /** + * Instantiates a new Builder from an existing UpdateDedicatedHostOptions instance. + * + * @param updateDedicatedHostOptions the instance to initialize the Builder with + */ private Builder(UpdateDedicatedHostOptions updateDedicatedHostOptions) { this.id = updateDedicatedHostOptions.id; this.dedicatedHostPatch = updateDedicatedHostOptions.dedicatedHostPatch; @@ -85,6 +90,8 @@ public Builder dedicatedHostPatch(Map dedicatedHostPatch) { } } + protected UpdateDedicatedHostOptions() { } + protected UpdateDedicatedHostOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateEndpointGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateEndpointGatewayOptions.java index a9a4fbc490..6fdf6226e9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateEndpointGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateEndpointGatewayOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map endpointGatewayPatch; + /** + * Instantiates a new Builder from an existing UpdateEndpointGatewayOptions instance. + * + * @param updateEndpointGatewayOptions the instance to initialize the Builder with + */ private Builder(UpdateEndpointGatewayOptions updateEndpointGatewayOptions) { this.id = updateEndpointGatewayOptions.id; this.endpointGatewayPatch = updateEndpointGatewayOptions.endpointGatewayPatch; @@ -85,6 +90,8 @@ public Builder endpointGatewayPatch(Map endpointGatewayPatch) { } } + protected UpdateEndpointGatewayOptions() { } + protected UpdateEndpointGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateFloatingIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateFloatingIpOptions.java index 29a300c4ca..496d0101ab 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateFloatingIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateFloatingIpOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map floatingIpPatch; + /** + * Instantiates a new Builder from an existing UpdateFloatingIpOptions instance. + * + * @param updateFloatingIpOptions the instance to initialize the Builder with + */ private Builder(UpdateFloatingIpOptions updateFloatingIpOptions) { this.id = updateFloatingIpOptions.id; this.floatingIpPatch = updateFloatingIpOptions.floatingIpPatch; @@ -85,6 +90,8 @@ public Builder floatingIpPatch(Map floatingIpPatch) { } } + protected UpdateFloatingIpOptions() { } + protected UpdateFloatingIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateFlowLogCollectorOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateFlowLogCollectorOptions.java index 7f14f64f19..ae3209e5ce 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateFlowLogCollectorOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateFlowLogCollectorOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map flowLogCollectorPatch; + /** + * Instantiates a new Builder from an existing UpdateFlowLogCollectorOptions instance. + * + * @param updateFlowLogCollectorOptions the instance to initialize the Builder with + */ private Builder(UpdateFlowLogCollectorOptions updateFlowLogCollectorOptions) { this.id = updateFlowLogCollectorOptions.id; this.flowLogCollectorPatch = updateFlowLogCollectorOptions.flowLogCollectorPatch; @@ -85,6 +90,8 @@ public Builder flowLogCollectorPatch(Map flowLogCollectorPatch) } } + protected UpdateFlowLogCollectorOptions() { } + protected UpdateFlowLogCollectorOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateIkePolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateIkePolicyOptions.java index 90fbea3917..ebc3e642f4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateIkePolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateIkePolicyOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map ikePolicyPatch; + /** + * Instantiates a new Builder from an existing UpdateIkePolicyOptions instance. + * + * @param updateIkePolicyOptions the instance to initialize the Builder with + */ private Builder(UpdateIkePolicyOptions updateIkePolicyOptions) { this.id = updateIkePolicyOptions.id; this.ikePolicyPatch = updateIkePolicyOptions.ikePolicyPatch; @@ -85,6 +90,8 @@ public Builder ikePolicyPatch(Map ikePolicyPatch) { } } + protected UpdateIkePolicyOptions() { } + protected UpdateIkePolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateImageOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateImageOptions.java index b386e2d919..c2b336958c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateImageOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateImageOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map imagePatch; + /** + * Instantiates a new Builder from an existing UpdateImageOptions instance. + * + * @param updateImageOptions the instance to initialize the Builder with + */ private Builder(UpdateImageOptions updateImageOptions) { this.id = updateImageOptions.id; this.imagePatch = updateImageOptions.imagePatch; @@ -85,6 +90,8 @@ public Builder imagePatch(Map imagePatch) { } } + protected UpdateImageOptions() { } + protected UpdateImageOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceDiskOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceDiskOptions.java index 32402968ce..990c280b5a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceDiskOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceDiskOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map instanceDiskPatch; + /** + * Instantiates a new Builder from an existing UpdateInstanceDiskOptions instance. + * + * @param updateInstanceDiskOptions the instance to initialize the Builder with + */ private Builder(UpdateInstanceDiskOptions updateInstanceDiskOptions) { this.instanceId = updateInstanceDiskOptions.instanceId; this.id = updateInstanceDiskOptions.id; @@ -101,6 +106,8 @@ public Builder instanceDiskPatch(Map instanceDiskPatch) { } } + protected UpdateInstanceDiskOptions() { } + protected UpdateInstanceDiskOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupManagerActionOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupManagerActionOptions.java index 35ac26c333..9a030a2216 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupManagerActionOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupManagerActionOptions.java @@ -35,6 +35,11 @@ public static class Builder { private String id; private Map instanceGroupManagerActionPatch; + /** + * Instantiates a new Builder from an existing UpdateInstanceGroupManagerActionOptions instance. + * + * @param updateInstanceGroupManagerActionOptions the instance to initialize the Builder with + */ private Builder(UpdateInstanceGroupManagerActionOptions updateInstanceGroupManagerActionOptions) { this.instanceGroupId = updateInstanceGroupManagerActionOptions.instanceGroupId; this.instanceGroupManagerId = updateInstanceGroupManagerActionOptions.instanceGroupManagerId; @@ -117,6 +122,8 @@ public Builder instanceGroupManagerActionPatch(Map instanceGroup } } + protected UpdateInstanceGroupManagerActionOptions() { } + protected UpdateInstanceGroupManagerActionOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupManagerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupManagerOptions.java index 0985b01440..a3ea0560f5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupManagerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupManagerOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map instanceGroupManagerPatch; + /** + * Instantiates a new Builder from an existing UpdateInstanceGroupManagerOptions instance. + * + * @param updateInstanceGroupManagerOptions the instance to initialize the Builder with + */ private Builder(UpdateInstanceGroupManagerOptions updateInstanceGroupManagerOptions) { this.instanceGroupId = updateInstanceGroupManagerOptions.instanceGroupId; this.id = updateInstanceGroupManagerOptions.id; @@ -101,6 +106,8 @@ public Builder instanceGroupManagerPatch(Map instanceGroupManage } } + protected UpdateInstanceGroupManagerOptions() { } + protected UpdateInstanceGroupManagerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupManagerPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupManagerPolicyOptions.java index b1c1a590f8..5ced67ddb0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupManagerPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupManagerPolicyOptions.java @@ -35,6 +35,11 @@ public static class Builder { private String id; private Map instanceGroupManagerPolicyPatch; + /** + * Instantiates a new Builder from an existing UpdateInstanceGroupManagerPolicyOptions instance. + * + * @param updateInstanceGroupManagerPolicyOptions the instance to initialize the Builder with + */ private Builder(UpdateInstanceGroupManagerPolicyOptions updateInstanceGroupManagerPolicyOptions) { this.instanceGroupId = updateInstanceGroupManagerPolicyOptions.instanceGroupId; this.instanceGroupManagerId = updateInstanceGroupManagerPolicyOptions.instanceGroupManagerId; @@ -117,6 +122,8 @@ public Builder instanceGroupManagerPolicyPatch(Map instanceGroup } } + protected UpdateInstanceGroupManagerPolicyOptions() { } + protected UpdateInstanceGroupManagerPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupMembershipOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupMembershipOptions.java index 4f694d86eb..363544ad92 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupMembershipOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupMembershipOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map instanceGroupMembershipPatch; + /** + * Instantiates a new Builder from an existing UpdateInstanceGroupMembershipOptions instance. + * + * @param updateInstanceGroupMembershipOptions the instance to initialize the Builder with + */ private Builder(UpdateInstanceGroupMembershipOptions updateInstanceGroupMembershipOptions) { this.instanceGroupId = updateInstanceGroupMembershipOptions.instanceGroupId; this.id = updateInstanceGroupMembershipOptions.id; @@ -101,6 +106,8 @@ public Builder instanceGroupMembershipPatch(Map instanceGroupMem } } + protected UpdateInstanceGroupMembershipOptions() { } + protected UpdateInstanceGroupMembershipOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceGroupId, "instanceGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupOptions.java index 4f2b3bacf8..9c763c2658 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceGroupOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map instanceGroupPatch; + /** + * Instantiates a new Builder from an existing UpdateInstanceGroupOptions instance. + * + * @param updateInstanceGroupOptions the instance to initialize the Builder with + */ private Builder(UpdateInstanceGroupOptions updateInstanceGroupOptions) { this.id = updateInstanceGroupOptions.id; this.instanceGroupPatch = updateInstanceGroupOptions.instanceGroupPatch; @@ -85,6 +90,8 @@ public Builder instanceGroupPatch(Map instanceGroupPatch) { } } + protected UpdateInstanceGroupOptions() { } + protected UpdateInstanceGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceNetworkInterfaceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceNetworkInterfaceOptions.java index 819c958965..a18d008157 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceNetworkInterfaceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceNetworkInterfaceOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map networkInterfacePatch; + /** + * Instantiates a new Builder from an existing UpdateInstanceNetworkInterfaceOptions instance. + * + * @param updateInstanceNetworkInterfaceOptions the instance to initialize the Builder with + */ private Builder(UpdateInstanceNetworkInterfaceOptions updateInstanceNetworkInterfaceOptions) { this.instanceId = updateInstanceNetworkInterfaceOptions.instanceId; this.id = updateInstanceNetworkInterfaceOptions.id; @@ -101,6 +106,8 @@ public Builder networkInterfacePatch(Map networkInterfacePatch) } } + protected UpdateInstanceNetworkInterfaceOptions() { } + protected UpdateInstanceNetworkInterfaceOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceOptions.java index 12891dbfd6..4420364e0c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map instancePatch; + /** + * Instantiates a new Builder from an existing UpdateInstanceOptions instance. + * + * @param updateInstanceOptions the instance to initialize the Builder with + */ private Builder(UpdateInstanceOptions updateInstanceOptions) { this.id = updateInstanceOptions.id; this.instancePatch = updateInstanceOptions.instancePatch; @@ -85,6 +90,8 @@ public Builder instancePatch(Map instancePatch) { } } + protected UpdateInstanceOptions() { } + protected UpdateInstanceOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceTemplateOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceTemplateOptions.java index bc995c33c7..ff80ae33cc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceTemplateOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceTemplateOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map instanceTemplatePatch; + /** + * Instantiates a new Builder from an existing UpdateInstanceTemplateOptions instance. + * + * @param updateInstanceTemplateOptions the instance to initialize the Builder with + */ private Builder(UpdateInstanceTemplateOptions updateInstanceTemplateOptions) { this.id = updateInstanceTemplateOptions.id; this.instanceTemplatePatch = updateInstanceTemplateOptions.instanceTemplatePatch; @@ -85,6 +90,8 @@ public Builder instanceTemplatePatch(Map instanceTemplatePatch) } } + protected UpdateInstanceTemplateOptions() { } + protected UpdateInstanceTemplateOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceVolumeAttachmentOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceVolumeAttachmentOptions.java index 5b016a83a3..ce77a4261f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceVolumeAttachmentOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateInstanceVolumeAttachmentOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map volumeAttachmentPatch; + /** + * Instantiates a new Builder from an existing UpdateInstanceVolumeAttachmentOptions instance. + * + * @param updateInstanceVolumeAttachmentOptions the instance to initialize the Builder with + */ private Builder(UpdateInstanceVolumeAttachmentOptions updateInstanceVolumeAttachmentOptions) { this.instanceId = updateInstanceVolumeAttachmentOptions.instanceId; this.id = updateInstanceVolumeAttachmentOptions.id; @@ -101,6 +106,8 @@ public Builder volumeAttachmentPatch(Map volumeAttachmentPatch) } } + protected UpdateInstanceVolumeAttachmentOptions() { } + protected UpdateInstanceVolumeAttachmentOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.instanceId, "instanceId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateIpsecPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateIpsecPolicyOptions.java index 755e174c63..92d08335f3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateIpsecPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateIpsecPolicyOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map iPsecPolicyPatch; + /** + * Instantiates a new Builder from an existing UpdateIpsecPolicyOptions instance. + * + * @param updateIpsecPolicyOptions the instance to initialize the Builder with + */ private Builder(UpdateIpsecPolicyOptions updateIpsecPolicyOptions) { this.id = updateIpsecPolicyOptions.id; this.iPsecPolicyPatch = updateIpsecPolicyOptions.iPsecPolicyPatch; @@ -85,6 +90,8 @@ public Builder iPsecPolicyPatch(Map iPsecPolicyPatch) { } } + protected UpdateIpsecPolicyOptions() { } + protected UpdateIpsecPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateKeyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateKeyOptions.java index 8089742db0..974eda0ddb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateKeyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateKeyOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map keyPatch; + /** + * Instantiates a new Builder from an existing UpdateKeyOptions instance. + * + * @param updateKeyOptions the instance to initialize the Builder with + */ private Builder(UpdateKeyOptions updateKeyOptions) { this.id = updateKeyOptions.id; this.keyPatch = updateKeyOptions.keyPatch; @@ -85,6 +90,8 @@ public Builder keyPatch(Map keyPatch) { } } + protected UpdateKeyOptions() { } + protected UpdateKeyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerListenerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerListenerOptions.java index 0db43c31a1..297f5eb69a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerListenerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerListenerOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map loadBalancerListenerPatch; + /** + * Instantiates a new Builder from an existing UpdateLoadBalancerListenerOptions instance. + * + * @param updateLoadBalancerListenerOptions the instance to initialize the Builder with + */ private Builder(UpdateLoadBalancerListenerOptions updateLoadBalancerListenerOptions) { this.loadBalancerId = updateLoadBalancerListenerOptions.loadBalancerId; this.id = updateLoadBalancerListenerOptions.id; @@ -101,6 +106,8 @@ public Builder loadBalancerListenerPatch(Map loadBalancerListene } } + protected UpdateLoadBalancerListenerOptions() { } + protected UpdateLoadBalancerListenerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerListenerPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerListenerPolicyOptions.java index 0408749b7b..14e68a842e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerListenerPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerListenerPolicyOptions.java @@ -35,6 +35,11 @@ public static class Builder { private String id; private Map loadBalancerListenerPolicyPatch; + /** + * Instantiates a new Builder from an existing UpdateLoadBalancerListenerPolicyOptions instance. + * + * @param updateLoadBalancerListenerPolicyOptions the instance to initialize the Builder with + */ private Builder(UpdateLoadBalancerListenerPolicyOptions updateLoadBalancerListenerPolicyOptions) { this.loadBalancerId = updateLoadBalancerListenerPolicyOptions.loadBalancerId; this.listenerId = updateLoadBalancerListenerPolicyOptions.listenerId; @@ -117,6 +122,8 @@ public Builder loadBalancerListenerPolicyPatch(Map loadBalancerL } } + protected UpdateLoadBalancerListenerPolicyOptions() { } + protected UpdateLoadBalancerListenerPolicyOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerListenerPolicyRuleOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerListenerPolicyRuleOptions.java index 0023544384..efedc256b0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerListenerPolicyRuleOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerListenerPolicyRuleOptions.java @@ -37,6 +37,11 @@ public static class Builder { private String id; private Map loadBalancerListenerPolicyRulePatch; + /** + * Instantiates a new Builder from an existing UpdateLoadBalancerListenerPolicyRuleOptions instance. + * + * @param updateLoadBalancerListenerPolicyRuleOptions the instance to initialize the Builder with + */ private Builder(UpdateLoadBalancerListenerPolicyRuleOptions updateLoadBalancerListenerPolicyRuleOptions) { this.loadBalancerId = updateLoadBalancerListenerPolicyRuleOptions.loadBalancerId; this.listenerId = updateLoadBalancerListenerPolicyRuleOptions.listenerId; @@ -133,6 +138,8 @@ public Builder loadBalancerListenerPolicyRulePatch(Map loadBalan } } + protected UpdateLoadBalancerListenerPolicyRuleOptions() { } + protected UpdateLoadBalancerListenerPolicyRuleOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerOptions.java index 3215c43051..089caf89de 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerOptions.java @@ -23,6 +23,7 @@ public class UpdateLoadBalancerOptions extends GenericModel { protected String id; protected Map loadBalancerPatch; + protected String ifMatch; /** * Builder. @@ -30,10 +31,17 @@ public class UpdateLoadBalancerOptions extends GenericModel { public static class Builder { private String id; private Map loadBalancerPatch; + private String ifMatch; + /** + * Instantiates a new Builder from an existing UpdateLoadBalancerOptions instance. + * + * @param updateLoadBalancerOptions the instance to initialize the Builder with + */ private Builder(UpdateLoadBalancerOptions updateLoadBalancerOptions) { this.id = updateLoadBalancerOptions.id; this.loadBalancerPatch = updateLoadBalancerOptions.loadBalancerPatch; + this.ifMatch = updateLoadBalancerOptions.ifMatch; } /** @@ -83,8 +91,21 @@ public Builder loadBalancerPatch(Map loadBalancerPatch) { this.loadBalancerPatch = loadBalancerPatch; return this; } + + /** + * Set the ifMatch. + * + * @param ifMatch the ifMatch + * @return the UpdateLoadBalancerOptions builder + */ + public Builder ifMatch(String ifMatch) { + this.ifMatch = ifMatch; + return this; + } } + protected UpdateLoadBalancerOptions() { } + protected UpdateLoadBalancerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); @@ -92,6 +113,7 @@ protected UpdateLoadBalancerOptions(Builder builder) { "loadBalancerPatch cannot be null"); id = builder.id; loadBalancerPatch = builder.loadBalancerPatch; + ifMatch = builder.ifMatch; } /** @@ -124,5 +146,17 @@ public String id() { public Map loadBalancerPatch() { return loadBalancerPatch; } + + /** + * Gets the ifMatch. + * + * If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + * Required if the request body includes an array. + * + * @return the ifMatch + */ + public String ifMatch() { + return ifMatch; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerPoolMemberOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerPoolMemberOptions.java index 83266d05b4..efea28de48 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerPoolMemberOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerPoolMemberOptions.java @@ -35,6 +35,11 @@ public static class Builder { private String id; private Map loadBalancerPoolMemberPatch; + /** + * Instantiates a new Builder from an existing UpdateLoadBalancerPoolMemberOptions instance. + * + * @param updateLoadBalancerPoolMemberOptions the instance to initialize the Builder with + */ private Builder(UpdateLoadBalancerPoolMemberOptions updateLoadBalancerPoolMemberOptions) { this.loadBalancerId = updateLoadBalancerPoolMemberOptions.loadBalancerId; this.poolId = updateLoadBalancerPoolMemberOptions.poolId; @@ -117,6 +122,8 @@ public Builder loadBalancerPoolMemberPatch(Map loadBalancerPoolM } } + protected UpdateLoadBalancerPoolMemberOptions() { } + protected UpdateLoadBalancerPoolMemberOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerPoolOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerPoolOptions.java index 9abb6415b4..b1a0f672e0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerPoolOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerPoolOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map loadBalancerPoolPatch; + /** + * Instantiates a new Builder from an existing UpdateLoadBalancerPoolOptions instance. + * + * @param updateLoadBalancerPoolOptions the instance to initialize the Builder with + */ private Builder(UpdateLoadBalancerPoolOptions updateLoadBalancerPoolOptions) { this.loadBalancerId = updateLoadBalancerPoolOptions.loadBalancerId; this.id = updateLoadBalancerPoolOptions.id; @@ -101,6 +106,8 @@ public Builder loadBalancerPoolPatch(Map loadBalancerPoolPatch) } } + protected UpdateLoadBalancerPoolOptions() { } + protected UpdateLoadBalancerPoolOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.loadBalancerId, "loadBalancerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateNetworkAclOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateNetworkAclOptions.java index 09c850ecd9..8964353c44 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateNetworkAclOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateNetworkAclOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map networkAclPatch; + /** + * Instantiates a new Builder from an existing UpdateNetworkAclOptions instance. + * + * @param updateNetworkAclOptions the instance to initialize the Builder with + */ private Builder(UpdateNetworkAclOptions updateNetworkAclOptions) { this.id = updateNetworkAclOptions.id; this.networkAclPatch = updateNetworkAclOptions.networkAclPatch; @@ -85,6 +90,8 @@ public Builder networkAclPatch(Map networkAclPatch) { } } + protected UpdateNetworkAclOptions() { } + protected UpdateNetworkAclOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateNetworkAclRuleOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateNetworkAclRuleOptions.java index 557fb6fd91..8a5b413293 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateNetworkAclRuleOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateNetworkAclRuleOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map networkAclRulePatch; + /** + * Instantiates a new Builder from an existing UpdateNetworkAclRuleOptions instance. + * + * @param updateNetworkAclRuleOptions the instance to initialize the Builder with + */ private Builder(UpdateNetworkAclRuleOptions updateNetworkAclRuleOptions) { this.networkAclId = updateNetworkAclRuleOptions.networkAclId; this.id = updateNetworkAclRuleOptions.id; @@ -101,6 +106,8 @@ public Builder networkAclRulePatch(Map networkAclRulePatch) { } } + protected UpdateNetworkAclRuleOptions() { } + protected UpdateNetworkAclRuleOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.networkAclId, "networkAclId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdatePlacementGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdatePlacementGroupOptions.java index 80b00e6e53..2f0769ea90 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdatePlacementGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdatePlacementGroupOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map placementGroupPatch; + /** + * Instantiates a new Builder from an existing UpdatePlacementGroupOptions instance. + * + * @param updatePlacementGroupOptions the instance to initialize the Builder with + */ private Builder(UpdatePlacementGroupOptions updatePlacementGroupOptions) { this.id = updatePlacementGroupOptions.id; this.placementGroupPatch = updatePlacementGroupOptions.placementGroupPatch; @@ -85,6 +90,8 @@ public Builder placementGroupPatch(Map placementGroupPatch) { } } + protected UpdatePlacementGroupOptions() { } + protected UpdatePlacementGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdatePublicGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdatePublicGatewayOptions.java index 60a6fa5154..fe96e5b114 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdatePublicGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdatePublicGatewayOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map publicGatewayPatch; + /** + * Instantiates a new Builder from an existing UpdatePublicGatewayOptions instance. + * + * @param updatePublicGatewayOptions the instance to initialize the Builder with + */ private Builder(UpdatePublicGatewayOptions updatePublicGatewayOptions) { this.id = updatePublicGatewayOptions.id; this.publicGatewayPatch = updatePublicGatewayOptions.publicGatewayPatch; @@ -85,6 +90,8 @@ public Builder publicGatewayPatch(Map publicGatewayPatch) { } } + protected UpdatePublicGatewayOptions() { } + protected UpdatePublicGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSecurityGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSecurityGroupOptions.java index 6388ab967f..9d8f9e09bf 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSecurityGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSecurityGroupOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map securityGroupPatch; + /** + * Instantiates a new Builder from an existing UpdateSecurityGroupOptions instance. + * + * @param updateSecurityGroupOptions the instance to initialize the Builder with + */ private Builder(UpdateSecurityGroupOptions updateSecurityGroupOptions) { this.id = updateSecurityGroupOptions.id; this.securityGroupPatch = updateSecurityGroupOptions.securityGroupPatch; @@ -85,6 +90,8 @@ public Builder securityGroupPatch(Map securityGroupPatch) { } } + protected UpdateSecurityGroupOptions() { } + protected UpdateSecurityGroupOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSecurityGroupRuleOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSecurityGroupRuleOptions.java index e3a67fbc91..60e5ff8d4f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSecurityGroupRuleOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSecurityGroupRuleOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map securityGroupRulePatch; + /** + * Instantiates a new Builder from an existing UpdateSecurityGroupRuleOptions instance. + * + * @param updateSecurityGroupRuleOptions the instance to initialize the Builder with + */ private Builder(UpdateSecurityGroupRuleOptions updateSecurityGroupRuleOptions) { this.securityGroupId = updateSecurityGroupRuleOptions.securityGroupId; this.id = updateSecurityGroupRuleOptions.id; @@ -101,6 +106,8 @@ public Builder securityGroupRulePatch(Map securityGroupRulePatch } } + protected UpdateSecurityGroupRuleOptions() { } + protected UpdateSecurityGroupRuleOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.securityGroupId, "securityGroupId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSnapshotOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSnapshotOptions.java index 5dc3f5d1e5..44d32e60fe 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSnapshotOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSnapshotOptions.java @@ -33,6 +33,11 @@ public static class Builder { private Map snapshotPatch; private String ifMatch; + /** + * Instantiates a new Builder from an existing UpdateSnapshotOptions instance. + * + * @param updateSnapshotOptions the instance to initialize the Builder with + */ private Builder(UpdateSnapshotOptions updateSnapshotOptions) { this.id = updateSnapshotOptions.id; this.snapshotPatch = updateSnapshotOptions.snapshotPatch; @@ -99,6 +104,8 @@ public Builder ifMatch(String ifMatch) { } } + protected UpdateSnapshotOptions() { } + protected UpdateSnapshotOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSubnetOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSubnetOptions.java index 201d36d154..52e5a0584e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSubnetOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSubnetOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map subnetPatch; + /** + * Instantiates a new Builder from an existing UpdateSubnetOptions instance. + * + * @param updateSubnetOptions the instance to initialize the Builder with + */ private Builder(UpdateSubnetOptions updateSubnetOptions) { this.id = updateSubnetOptions.id; this.subnetPatch = updateSubnetOptions.subnetPatch; @@ -85,6 +90,8 @@ public Builder subnetPatch(Map subnetPatch) { } } + protected UpdateSubnetOptions() { } + protected UpdateSubnetOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSubnetReservedIpOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSubnetReservedIpOptions.java index bcc40a0c9a..7cf25b69b0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSubnetReservedIpOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateSubnetReservedIpOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map reservedIpPatch; + /** + * Instantiates a new Builder from an existing UpdateSubnetReservedIpOptions instance. + * + * @param updateSubnetReservedIpOptions the instance to initialize the Builder with + */ private Builder(UpdateSubnetReservedIpOptions updateSubnetReservedIpOptions) { this.subnetId = updateSubnetReservedIpOptions.subnetId; this.id = updateSubnetReservedIpOptions.id; @@ -101,6 +106,8 @@ public Builder reservedIpPatch(Map reservedIpPatch) { } } + protected UpdateSubnetReservedIpOptions() { } + protected UpdateSubnetReservedIpOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.subnetId, "subnetId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVolumeOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVolumeOptions.java index d639367b41..9bbe2b83fb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVolumeOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVolumeOptions.java @@ -33,6 +33,11 @@ public static class Builder { private Map volumePatch; private String ifMatch; + /** + * Instantiates a new Builder from an existing UpdateVolumeOptions instance. + * + * @param updateVolumeOptions the instance to initialize the Builder with + */ private Builder(UpdateVolumeOptions updateVolumeOptions) { this.id = updateVolumeOptions.id; this.volumePatch = updateVolumeOptions.volumePatch; @@ -99,6 +104,8 @@ public Builder ifMatch(String ifMatch) { } } + protected UpdateVolumeOptions() { } + protected UpdateVolumeOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcAddressPrefixOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcAddressPrefixOptions.java index ea40fafbcd..248f9b826c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcAddressPrefixOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcAddressPrefixOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map addressPrefixPatch; + /** + * Instantiates a new Builder from an existing UpdateVpcAddressPrefixOptions instance. + * + * @param updateVpcAddressPrefixOptions the instance to initialize the Builder with + */ private Builder(UpdateVpcAddressPrefixOptions updateVpcAddressPrefixOptions) { this.vpcId = updateVpcAddressPrefixOptions.vpcId; this.id = updateVpcAddressPrefixOptions.id; @@ -101,6 +106,8 @@ public Builder addressPrefixPatch(Map addressPrefixPatch) { } } + protected UpdateVpcAddressPrefixOptions() { } + protected UpdateVpcAddressPrefixOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcOptions.java index 27695744a5..553d811f27 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map vpcPatch; + /** + * Instantiates a new Builder from an existing UpdateVpcOptions instance. + * + * @param updateVpcOptions the instance to initialize the Builder with + */ private Builder(UpdateVpcOptions updateVpcOptions) { this.id = updateVpcOptions.id; this.vpcPatch = updateVpcOptions.vpcPatch; @@ -85,6 +90,8 @@ public Builder vpcPatch(Map vpcPatch) { } } + protected UpdateVpcOptions() { } + protected UpdateVpcOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRouteOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRouteOptions.java index ff125d13b3..6a9df38d10 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRouteOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRouteOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map routePatch; + /** + * Instantiates a new Builder from an existing UpdateVpcRouteOptions instance. + * + * @param updateVpcRouteOptions the instance to initialize the Builder with + */ private Builder(UpdateVpcRouteOptions updateVpcRouteOptions) { this.vpcId = updateVpcRouteOptions.vpcId; this.id = updateVpcRouteOptions.id; @@ -101,6 +106,8 @@ public Builder routePatch(Map routePatch) { } } + protected UpdateVpcRouteOptions() { } + protected UpdateVpcRouteOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRoutingTableOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRoutingTableOptions.java index ccc67bafc3..f0b03c1284 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRoutingTableOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRoutingTableOptions.java @@ -35,6 +35,11 @@ public static class Builder { private Map routingTablePatch; private String ifMatch; + /** + * Instantiates a new Builder from an existing UpdateVpcRoutingTableOptions instance. + * + * @param updateVpcRoutingTableOptions the instance to initialize the Builder with + */ private Builder(UpdateVpcRoutingTableOptions updateVpcRoutingTableOptions) { this.vpcId = updateVpcRoutingTableOptions.vpcId; this.id = updateVpcRoutingTableOptions.id; @@ -115,6 +120,8 @@ public Builder ifMatch(String ifMatch) { } } + protected UpdateVpcRoutingTableOptions() { } + protected UpdateVpcRoutingTableOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRoutingTableRouteOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRoutingTableRouteOptions.java index a243593019..691c026088 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRoutingTableRouteOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRoutingTableRouteOptions.java @@ -35,6 +35,11 @@ public static class Builder { private String id; private Map routePatch; + /** + * Instantiates a new Builder from an existing UpdateVpcRoutingTableRouteOptions instance. + * + * @param updateVpcRoutingTableRouteOptions the instance to initialize the Builder with + */ private Builder(UpdateVpcRoutingTableRouteOptions updateVpcRoutingTableRouteOptions) { this.vpcId = updateVpcRoutingTableRouteOptions.vpcId; this.routingTableId = updateVpcRoutingTableRouteOptions.routingTableId; @@ -117,6 +122,8 @@ public Builder routePatch(Map routePatch) { } } + protected UpdateVpcRoutingTableRouteOptions() { } + protected UpdateVpcRoutingTableRouteOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpcId, "vpcId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayConnectionOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayConnectionOptions.java index fb64e66307..8b550a28c1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayConnectionOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayConnectionOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map vpnGatewayConnectionPatch; + /** + * Instantiates a new Builder from an existing UpdateVpnGatewayConnectionOptions instance. + * + * @param updateVpnGatewayConnectionOptions the instance to initialize the Builder with + */ private Builder(UpdateVpnGatewayConnectionOptions updateVpnGatewayConnectionOptions) { this.vpnGatewayId = updateVpnGatewayConnectionOptions.vpnGatewayId; this.id = updateVpnGatewayConnectionOptions.id; @@ -101,6 +106,8 @@ public Builder vpnGatewayConnectionPatch(Map vpnGatewayConnectio } } + protected UpdateVpnGatewayConnectionOptions() { } + protected UpdateVpnGatewayConnectionOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, "vpnGatewayId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayOptions.java index bfceb4cdba..241fe49dad 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayOptions.java @@ -31,6 +31,11 @@ public static class Builder { private String id; private Map vpnGatewayPatch; + /** + * Instantiates a new Builder from an existing UpdateVpnGatewayOptions instance. + * + * @param updateVpnGatewayOptions the instance to initialize the Builder with + */ private Builder(UpdateVpnGatewayOptions updateVpnGatewayOptions) { this.id = updateVpnGatewayOptions.id; this.vpnGatewayPatch = updateVpnGatewayOptions.vpnGatewayPatch; @@ -85,6 +90,8 @@ public Builder vpnGatewayPatch(Map vpnGatewayPatch) { } } + protected UpdateVpnGatewayOptions() { } + protected UpdateVpnGatewayOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnServerOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnServerOptions.java index 2da8ff98c2..621db2aec2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnServerOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnServerOptions.java @@ -33,6 +33,11 @@ public static class Builder { private Map vpnServerPatch; private String ifMatch; + /** + * Instantiates a new Builder from an existing UpdateVpnServerOptions instance. + * + * @param updateVpnServerOptions the instance to initialize the Builder with + */ private Builder(UpdateVpnServerOptions updateVpnServerOptions) { this.id = updateVpnServerOptions.id; this.vpnServerPatch = updateVpnServerOptions.vpnServerPatch; @@ -99,6 +104,8 @@ public Builder ifMatch(String ifMatch) { } } + protected UpdateVpnServerOptions() { } + protected UpdateVpnServerOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnServerRouteOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnServerRouteOptions.java index 6f1c4a5a53..a2998905ec 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnServerRouteOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnServerRouteOptions.java @@ -33,6 +33,11 @@ public static class Builder { private String id; private Map vpnServerRoutePatch; + /** + * Instantiates a new Builder from an existing UpdateVpnServerRouteOptions instance. + * + * @param updateVpnServerRouteOptions the instance to initialize the Builder with + */ private Builder(UpdateVpnServerRouteOptions updateVpnServerRouteOptions) { this.vpnServerId = updateVpnServerRouteOptions.vpnServerId; this.id = updateVpnServerRouteOptions.id; @@ -101,6 +106,8 @@ public Builder vpnServerRoutePatch(Map vpnServerRoutePatch) { } } + protected UpdateVpnServerRouteOptions() { } + protected UpdateVpnServerRouteOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnServerId, "vpnServerId cannot be empty"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VCPU.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VCPU.java index 3480cd848a..f2f4bbd21e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VCPU.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VCPU.java @@ -22,6 +22,8 @@ public class VCPU extends GenericModel { protected String architecture; protected Long count; + protected VCPU() { } + /** * Gets the architecture. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPC.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPC.java index 7b2dbdf1fd..bcb341642f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPC.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPC.java @@ -67,6 +67,8 @@ public interface Status { protected String resourceType; protected String status; + protected VPC() { } + /** * Gets the classicAccess. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCSESourceIP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCSESourceIP.java index 13a0981b3b..f06e2e0120 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCSESourceIP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCSESourceIP.java @@ -22,6 +22,8 @@ public class VPCCSESourceIP extends GenericModel { protected IP ip; protected ZoneReference zone; + protected VPCCSESourceIP() { } + /** * Gets the ip. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCollection.java index f44594ed23..636d4add98 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCollection.java @@ -29,6 +29,8 @@ public class VPCCollection extends GenericModel { protected Long totalCount; protected List vpcs; + protected VPCCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCollectionFirst.java index 4b1d8708b1..f1c9312713 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCollectionFirst.java @@ -21,6 +21,8 @@ public class VPCCollectionFirst extends GenericModel { protected String href; + protected VPCCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCollectionNext.java index f19b24170b..9b7febaaa0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCCollectionNext.java @@ -21,6 +21,8 @@ public class VPCCollectionNext extends GenericModel { protected String href; + protected VPCCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentity.java index 3384bf2b1d..82d049ed9f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentity.java @@ -28,8 +28,7 @@ public class VPCIdentity extends GenericModel { protected String crn; protected String href; - protected VPCIdentity() { - } + protected VPCIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentityByCRN.java index 0a166972d5..342a116a68 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentityByCRN.java @@ -24,6 +24,11 @@ public class VPCIdentityByCRN extends VPCIdentity { public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing VPCIdentityByCRN instance. + * + * @param vpcIdentityByCrn the instance to initialize the Builder with + */ public Builder(VPCIdentity vpcIdentityByCrn) { this.crn = vpcIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected VPCIdentityByCRN() { } + protected VPCIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentityByHref.java index f2ec062d5d..c6cbcb661a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentityByHref.java @@ -24,6 +24,11 @@ public class VPCIdentityByHref extends VPCIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing VPCIdentityByHref instance. + * + * @param vpcIdentityByHref the instance to initialize the Builder with + */ public Builder(VPCIdentity vpcIdentityByHref) { this.href = vpcIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected VPCIdentityByHref() { } + protected VPCIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentityById.java index 7643feb233..91081fcb22 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCIdentityById.java @@ -24,6 +24,11 @@ public class VPCIdentityById extends VPCIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing VPCIdentityById instance. + * + * @param vpcIdentityById the instance to initialize the Builder with + */ public Builder(VPCIdentity vpcIdentityById) { this.id = vpcIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected VPCIdentityById() { } + protected VPCIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCPatch.java index fc9e853347..8050af29ea 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCPatch.java @@ -30,6 +30,11 @@ public class VPCPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing VPCPatch instance. + * + * @param vpcPatch the instance to initialize the Builder with + */ private Builder(VPCPatch vpcPatch) { this.name = vpcPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected VPCPatch() { } + protected VPCPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCReference.java index 447d73e32e..19ac6639c9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCReference.java @@ -36,6 +36,8 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected VPCReference() { } + /** * Gets the crn. * @@ -50,7 +52,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCReferenceDeleted.java index c54ac6bdfc..4d2af82f3c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class VPCReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class VPCReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected VPCReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGateway.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGateway.java index 38db308ecd..ffbd4cb556 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGateway.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGateway.java @@ -71,10 +71,10 @@ public interface Mode { protected String resourceType; protected String status; protected SubnetReference subnet; + protected VPCReference vpc; protected String mode; - protected VPNGateway() { - } + protected VPNGateway() { } /** * Gets the connections. @@ -195,6 +195,17 @@ public SubnetReference getSubnet() { return subnet; } + /** + * Gets the vpc. + * + * The VPC this VPN gateway resides in. + * + * @return the vpc + */ + public VPCReference getVpc() { + return vpc; + } + /** * Gets the mode. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollection.java index c36f391596..8b769a64f8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollection.java @@ -30,6 +30,8 @@ public class VPNGatewayCollection extends GenericModel { @SerializedName("vpn_gateways") protected List vpnGateways; + protected VPNGatewayCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionFirst.java index c11b785e79..af19fd2342 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionFirst.java @@ -21,6 +21,8 @@ public class VPNGatewayCollectionFirst extends GenericModel { protected String href; + protected VPNGatewayCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionNext.java index a7cd7a7801..2c0128fbaf 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionNext.java @@ -21,6 +21,8 @@ public class VPNGatewayCollectionNext extends GenericModel { protected String href; + protected VPNGatewayCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnection.java index 86272f1b23..10fed94216 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnection.java @@ -101,8 +101,7 @@ public interface RoutingProtocol { @SerializedName("peer_cidrs") protected List peerCidrs; - protected VPNGatewayConnection() { - } + protected VPNGatewayConnection() { } /** * Gets the adminStateUp. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionCollection.java index 7dcd43a5b9..b2614c0f86 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionCollection.java @@ -23,6 +23,8 @@ public class VPNGatewayConnectionCollection extends GenericModel { protected List connections; + protected VPNGatewayConnectionCollection() { } + /** * Gets the connections. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDPD.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDPD.java index e1ed0c3b11..1f6cb9d38b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDPD.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDPD.java @@ -37,6 +37,8 @@ public interface Action { protected Long interval; protected Long timeout; + protected VPNGatewayConnectionDPD() { } + /** * Gets the action. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDPDPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDPDPatch.java index 0fc1a84c1a..5700fcf233 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDPDPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDPDPatch.java @@ -45,6 +45,11 @@ public static class Builder { private Long interval; private Long timeout; + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionDPDPatch instance. + * + * @param vpnGatewayConnectionDpdPatch the instance to initialize the Builder with + */ private Builder(VPNGatewayConnectionDPDPatch vpnGatewayConnectionDpdPatch) { this.action = vpnGatewayConnectionDpdPatch.action; this.interval = vpnGatewayConnectionDpdPatch.interval; @@ -100,6 +105,8 @@ public Builder timeout(long timeout) { } } + protected VPNGatewayConnectionDPDPatch() { } + protected VPNGatewayConnectionDPDPatch(Builder builder) { action = builder.action; interval = builder.interval; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDPDPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDPDPrototype.java index 1590bb9623..d322ed1d55 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDPDPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDPDPrototype.java @@ -45,6 +45,11 @@ public static class Builder { private Long interval; private Long timeout; + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionDPDPrototype instance. + * + * @param vpnGatewayConnectionDpdPrototype the instance to initialize the Builder with + */ private Builder(VPNGatewayConnectionDPDPrototype vpnGatewayConnectionDpdPrototype) { this.action = vpnGatewayConnectionDpdPrototype.action; this.interval = vpnGatewayConnectionDpdPrototype.interval; @@ -100,6 +105,8 @@ public Builder timeout(long timeout) { } } + protected VPNGatewayConnectionDPDPrototype() { } + protected VPNGatewayConnectionDPDPrototype(Builder builder) { action = builder.action; interval = builder.interval; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPatch.java index 9552819300..3252f82a73 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPatch.java @@ -27,8 +27,7 @@ public class VPNGatewayConnectionIKEPolicyPatch extends GenericModel { protected String id; protected String href; - protected VPNGatewayConnectionIKEPolicyPatch() { - } + protected VPNGatewayConnectionIKEPolicyPatch() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref.java index 8084f8760b..1f82b46b1d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref.java @@ -24,6 +24,11 @@ public class VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref extends V public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref instance. + * + * @param vpnGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref the instance to initialize the Builder with + */ public Builder(VPNGatewayConnectionIKEPolicyPatch vpnGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref) { this.href = vpnGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref() { } + protected VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.java index deae200309..32a4dbe1a7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.java @@ -24,6 +24,11 @@ public class VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById extends VPN public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById instance. + * + * @param vpnGatewayConnectionIkePolicyPatchIkePolicyIdentityById the instance to initialize the Builder with + */ public Builder(VPNGatewayConnectionIKEPolicyPatch vpnGatewayConnectionIkePolicyPatchIkePolicyIdentityById) { this.id = vpnGatewayConnectionIkePolicyPatchIkePolicyIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById() { } + protected VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPrototype.java index e7cce541b8..c0cf49cc0a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPrototype.java @@ -27,8 +27,7 @@ public class VPNGatewayConnectionIKEPolicyPrototype extends GenericModel { protected String id; protected String href; - protected VPNGatewayConnectionIKEPolicyPrototype() { - } + protected VPNGatewayConnectionIKEPolicyPrototype() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref.java index 20ae5ffd3d..62dc3a52e4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref.java @@ -24,6 +24,11 @@ public class VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref exten public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref instance. + * + * @param vpnGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref the instance to initialize the Builder with + */ public Builder(VPNGatewayConnectionIKEPolicyPrototype vpnGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref) { this.href = vpnGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref() { } + protected VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.java index 8f8a2e1751..9d14f1e8f5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.java @@ -24,6 +24,11 @@ public class VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById extends public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById instance. + * + * @param vpnGatewayConnectionIkePolicyPrototypeIkePolicyIdentityById the instance to initialize the Builder with + */ public Builder(VPNGatewayConnectionIKEPolicyPrototype vpnGatewayConnectionIkePolicyPrototypeIkePolicyIdentityById) { this.id = vpnGatewayConnectionIkePolicyPrototypeIkePolicyIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById() { } + protected VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPatch.java index a212eca156..e89637e3d6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPatch.java @@ -27,8 +27,7 @@ public class VPNGatewayConnectionIPsecPolicyPatch extends GenericModel { protected String id; protected String href; - protected VPNGatewayConnectionIPsecPolicyPatch() { - } + protected VPNGatewayConnectionIPsecPolicyPatch() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref.java index 94fd7a28af..1ed5225df7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref.java @@ -24,6 +24,11 @@ public class VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref exten public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref instance. + * + * @param vpnGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref the instance to initialize the Builder with + */ public Builder(VPNGatewayConnectionIPsecPolicyPatch vpnGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref) { this.href = vpnGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref() { } + protected VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.java index eedc01b6ca..cca392182c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.java @@ -24,6 +24,11 @@ public class VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById extends public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById instance. + * + * @param vpnGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById the instance to initialize the Builder with + */ public Builder(VPNGatewayConnectionIPsecPolicyPatch vpnGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById) { this.id = vpnGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById() { } + protected VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPrototype.java index 72e356e71f..06637a4746 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPrototype.java @@ -27,8 +27,7 @@ public class VPNGatewayConnectionIPsecPolicyPrototype extends GenericModel { protected String id; protected String href; - protected VPNGatewayConnectionIPsecPolicyPrototype() { - } + protected VPNGatewayConnectionIPsecPolicyPrototype() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref.java index afd63b52f9..2a61c4e9cf 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref.java @@ -24,6 +24,11 @@ public class VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref e public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref instance. + * + * @param vpnGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref the instance to initialize the Builder with + */ public Builder(VPNGatewayConnectionIPsecPolicyPrototype vpnGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref) { this.href = vpnGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref() { } + protected VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.java index 73c44603ef..59fb394031 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.java @@ -24,6 +24,11 @@ public class VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById ext public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById instance. + * + * @param vpnGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById the instance to initialize the Builder with + */ public Builder(VPNGatewayConnectionIPsecPolicyPrototype vpnGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById) { this.id = vpnGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById() { } + protected VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionLocalCIDRs.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionLocalCIDRs.java index 05a695d2f5..0923a17ecf 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionLocalCIDRs.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionLocalCIDRs.java @@ -25,6 +25,8 @@ public class VPNGatewayConnectionLocalCIDRs extends GenericModel { @SerializedName("local_cidrs") protected List localCidrs; + protected VPNGatewayConnectionLocalCIDRs() { } + /** * Gets the localCidrs. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatch.java index f434452c9a..a157171105 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatch.java @@ -49,8 +49,7 @@ public interface RoutingProtocol { @SerializedName("routing_protocol") protected String routingProtocol; - protected VPNGatewayConnectionPatch() { - } + protected VPNGatewayConnectionPatch() { } /** * Gets the adminStateUp. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.java index 2a081b6770..2b2194c169 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.java @@ -43,6 +43,11 @@ public static class Builder { private String psk; private String routingProtocol; + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch instance. + * + * @param vpnGatewayConnectionPatchVpnGatewayConnectionStaticRouteModePatch the instance to initialize the Builder with + */ public Builder(VPNGatewayConnectionPatch vpnGatewayConnectionPatchVpnGatewayConnectionStaticRouteModePatch) { this.adminStateUp = vpnGatewayConnectionPatchVpnGatewayConnectionStaticRouteModePatch.adminStateUp; this.deadPeerDetection = vpnGatewayConnectionPatchVpnGatewayConnectionStaticRouteModePatch.deadPeerDetection; @@ -158,6 +163,8 @@ public Builder routingProtocol(String routingProtocol) { } } + protected VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch() { } + protected VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch(Builder builder) { adminStateUp = builder.adminStateUp; deadPeerDetection = builder.deadPeerDetection; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerCIDRs.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerCIDRs.java index 5a1016b7de..07c817644f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerCIDRs.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerCIDRs.java @@ -25,6 +25,8 @@ public class VPNGatewayConnectionPeerCIDRs extends GenericModel { @SerializedName("peer_cidrs") protected List peerCidrs; + protected VPNGatewayConnectionPeerCIDRs() { } + /** * Gets the peerCidrs. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPolicyMode.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPolicyMode.java index f033833328..15ad2fe570 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPolicyMode.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPolicyMode.java @@ -53,5 +53,7 @@ public interface Status { String UP = "up"; } + + protected VPNGatewayConnectionPolicyMode() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototype.java index 93fe817319..73a30d10da 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototype.java @@ -53,8 +53,7 @@ public interface RoutingProtocol { @SerializedName("peer_cidrs") protected List peerCidrs; - protected VPNGatewayConnectionPrototype() { - } + protected VPNGatewayConnectionPrototype() { } /** * Gets the adminStateUp. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.java index 94dd5c49a1..e519b771f8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.java @@ -35,6 +35,11 @@ public static class Builder { private List localCidrs; private List peerCidrs; + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype instance. + * + * @param vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototype the instance to initialize the Builder with + */ public Builder(VPNGatewayConnectionPrototype vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototype) { this.adminStateUp = vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototype.adminStateUp; this.deadPeerDetection = vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototype.deadPeerDetection; @@ -211,6 +216,8 @@ public Builder peerCidrs(List peerCidrs) { } } + protected VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype() { } + protected VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.peerAddress, "peerAddress cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.java index 3fce9408f5..6a91fe3954 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.java @@ -39,6 +39,11 @@ public static class Builder { private String psk; private String routingProtocol; + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype instance. + * + * @param vpnGatewayConnectionPrototypeVpnGatewayConnectionStaticRouteModePrototype the instance to initialize the Builder with + */ public Builder(VPNGatewayConnectionPrototype vpnGatewayConnectionPrototypeVpnGatewayConnectionStaticRouteModePrototype) { this.adminStateUp = vpnGatewayConnectionPrototypeVpnGatewayConnectionStaticRouteModePrototype.adminStateUp; this.deadPeerDetection = vpnGatewayConnectionPrototypeVpnGatewayConnectionStaticRouteModePrototype.deadPeerDetection; @@ -165,6 +170,8 @@ public Builder routingProtocol(String routingProtocol) { } } + protected VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype() { } + protected VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.peerAddress, "peerAddress cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionReference.java index acf7ce2007..f18ae8a7c7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionReference.java @@ -35,10 +35,12 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected VPNGatewayConnectionReference() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionReferenceDeleted.java index 6e98ca10c9..1eb2f69b1c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class VPNGatewayConnectionReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class VPNGatewayConnectionReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected VPNGatewayConnectionReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionStaticRouteMode.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionStaticRouteMode.java index 315e1d10fb..172043a700 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionStaticRouteMode.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionStaticRouteMode.java @@ -61,5 +61,7 @@ public interface RoutingProtocol { String NONE = "none"; } + + protected VPNGatewayConnectionStaticRouteMode() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionStaticRouteModeTunnel.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionStaticRouteModeTunnel.java index 4ca383655b..1d5059427e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionStaticRouteModeTunnel.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionStaticRouteModeTunnel.java @@ -34,6 +34,8 @@ public interface Status { protected IP publicIp; protected String status; + protected VPNGatewayConnectionStaticRouteModeTunnel() { } + /** * Gets the publicIp. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayMember.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayMember.java index f2f8eb14db..8b4c84d913 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayMember.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayMember.java @@ -51,6 +51,8 @@ public interface Status { protected String role; protected String status; + protected VPNGatewayMember() { } + /** * Gets the privateIp. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPatch.java index f4844edcd0..09b67986e7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPatch.java @@ -30,6 +30,11 @@ public class VPNGatewayPatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing VPNGatewayPatch instance. + * + * @param vpnGatewayPatch the instance to initialize the Builder with + */ private Builder(VPNGatewayPatch vpnGatewayPatch) { this.name = vpnGatewayPatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected VPNGatewayPatch() { } + protected VPNGatewayPatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPolicyMode.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPolicyMode.java index 2bababa881..55f2de1bcc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPolicyMode.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPolicyMode.java @@ -47,5 +47,7 @@ public interface Mode { String POLICY = "policy"; } + + protected VPNGatewayPolicyMode() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototype.java index 8d09d2028d..8a13b15d63 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototype.java @@ -38,8 +38,7 @@ public interface Mode { protected SubnetIdentity subnet; protected String mode; - protected VPNGatewayPrototype() { - } + protected VPNGatewayPrototype() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayPolicyModePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayPolicyModePrototype.java index d319e4a464..9b0d8edfa5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayPolicyModePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayPolicyModePrototype.java @@ -35,6 +35,11 @@ public static class Builder { private SubnetIdentity subnet; private String mode; + /** + * Instantiates a new Builder from an existing VPNGatewayPrototypeVPNGatewayPolicyModePrototype instance. + * + * @param vpnGatewayPrototypeVpnGatewayPolicyModePrototype the instance to initialize the Builder with + */ public Builder(VPNGatewayPrototype vpnGatewayPrototypeVpnGatewayPolicyModePrototype) { this.name = vpnGatewayPrototypeVpnGatewayPolicyModePrototype.name; this.resourceGroup = vpnGatewayPrototypeVpnGatewayPolicyModePrototype.resourceGroup; @@ -111,6 +116,8 @@ public Builder mode(String mode) { } } + protected VPNGatewayPrototypeVPNGatewayPolicyModePrototype() { } + protected VPNGatewayPrototypeVPNGatewayPolicyModePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.subnet, "subnet cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayRouteModePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayRouteModePrototype.java index d8ff30617f..1dbd3a0225 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayRouteModePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayRouteModePrototype.java @@ -35,6 +35,11 @@ public static class Builder { private SubnetIdentity subnet; private String mode; + /** + * Instantiates a new Builder from an existing VPNGatewayPrototypeVPNGatewayRouteModePrototype instance. + * + * @param vpnGatewayPrototypeVpnGatewayRouteModePrototype the instance to initialize the Builder with + */ public Builder(VPNGatewayPrototype vpnGatewayPrototypeVpnGatewayRouteModePrototype) { this.name = vpnGatewayPrototypeVpnGatewayRouteModePrototype.name; this.resourceGroup = vpnGatewayPrototypeVpnGatewayRouteModePrototype.resourceGroup; @@ -111,6 +116,8 @@ public Builder mode(String mode) { } } + protected VPNGatewayPrototypeVPNGatewayRouteModePrototype() { } + protected VPNGatewayPrototypeVPNGatewayRouteModePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.subnet, "subnet cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayReferenceDeleted.java index a6bafd87d0..09af94fea7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class VPNGatewayReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class VPNGatewayReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected VPNGatewayReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayRouteMode.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayRouteMode.java index bbd437dda3..9a8c07f73b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayRouteMode.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayRouteMode.java @@ -47,5 +47,7 @@ public interface Mode { String ROUTE = "route"; } + + protected VPNGatewayRouteMode() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServer.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServer.java index c11590f013..7074a6df6e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServer.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServer.java @@ -120,6 +120,8 @@ public interface ResourceType { protected List subnets; protected VPCReference vpc; + protected VPNServer() { } + /** * Gets the certificate. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthentication.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthentication.java index 6cc65e1363..3fe106c6bc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthentication.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthentication.java @@ -41,8 +41,7 @@ public interface Method { protected CertificateInstanceReference clientCa; protected String crl; - protected VPNServerAuthentication() { - } + protected VPNServerAuthentication() { } /** * Gets the method. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByCertificate.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByCertificate.java index 2c489a8d5f..c13157f6d1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByCertificate.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByCertificate.java @@ -27,5 +27,7 @@ public interface Method { String USERNAME = "username"; } + + protected VPNServerAuthenticationByCertificate() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByUsername.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByUsername.java index 4706901b15..810e84d4f6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByUsername.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByUsername.java @@ -27,5 +27,7 @@ public interface Method { String USERNAME = "username"; } + + protected VPNServerAuthenticationByUsername() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByUsernameIdProvider.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByUsernameIdProvider.java index a2e71cfd0d..a3fa008210 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByUsernameIdProvider.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByUsernameIdProvider.java @@ -39,8 +39,7 @@ public interface ProviderType { @SerializedName("provider_type") protected String providerType; - protected VPNServerAuthenticationByUsernameIdProvider() { - } + protected VPNServerAuthenticationByUsernameIdProvider() { } /** * Gets the providerType. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByUsernameIdProviderByIAM.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByUsernameIdProviderByIAM.java index a8b0ea7a8e..c4f2746745 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByUsernameIdProviderByIAM.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationByUsernameIdProviderByIAM.java @@ -37,6 +37,11 @@ public interface ProviderType { public static class Builder { private String providerType; + /** + * Instantiates a new Builder from an existing VPNServerAuthenticationByUsernameIdProviderByIAM instance. + * + * @param vpnServerAuthenticationByUsernameIdProviderByIam the instance to initialize the Builder with + */ public Builder(VPNServerAuthenticationByUsernameIdProvider vpnServerAuthenticationByUsernameIdProviderByIam) { this.providerType = vpnServerAuthenticationByUsernameIdProviderByIam.providerType; } @@ -77,6 +82,8 @@ public Builder providerType(String providerType) { } } + protected VPNServerAuthenticationByUsernameIdProviderByIAM() { } + protected VPNServerAuthenticationByUsernameIdProviderByIAM(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.providerType, "providerType cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationPrototype.java index 3d90bb7b0b..48732e11b4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationPrototype.java @@ -49,8 +49,7 @@ public interface Method { protected CertificateInstanceIdentity clientCa; protected String crl; - protected VPNServerAuthenticationPrototype() { - } + protected VPNServerAuthenticationPrototype() { } /** * Gets the method. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype.java index 59a07e39cd..df5726d614 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype.java @@ -36,6 +36,11 @@ public static class Builder { private CertificateInstanceIdentity clientCa; private String crl; + /** + * Instantiates a new Builder from an existing VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype instance. + * + * @param vpnServerAuthenticationPrototypeVpnServerAuthenticationByCertificatePrototype the instance to initialize the Builder with + */ public Builder(VPNServerAuthenticationPrototype vpnServerAuthenticationPrototypeVpnServerAuthenticationByCertificatePrototype) { this.method = vpnServerAuthenticationPrototypeVpnServerAuthenticationByCertificatePrototype.method; this.clientCa = vpnServerAuthenticationPrototypeVpnServerAuthenticationByCertificatePrototype.clientCa; @@ -102,6 +107,8 @@ public Builder crl(String crl) { } } + protected VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype() { } + protected VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.method, "method cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.java index 4652ccf2d4..6980b17872 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.java @@ -35,6 +35,11 @@ public static class Builder { private String method; private VPNServerAuthenticationByUsernameIdProvider identityProvider; + /** + * Instantiates a new Builder from an existing VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype instance. + * + * @param vpnServerAuthenticationPrototypeVpnServerAuthenticationByUsernamePrototype the instance to initialize the Builder with + */ public Builder(VPNServerAuthenticationPrototype vpnServerAuthenticationPrototypeVpnServerAuthenticationByUsernamePrototype) { this.method = vpnServerAuthenticationPrototypeVpnServerAuthenticationByUsernamePrototype.method; this.identityProvider = vpnServerAuthenticationPrototypeVpnServerAuthenticationByUsernamePrototype.identityProvider; @@ -89,6 +94,8 @@ public Builder identityProvider(VPNServerAuthenticationByUsernameIdProvider iden } } + protected VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype() { } + protected VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.method, "method cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClient.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClient.java index 640d946869..048eabf6ff 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClient.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClient.java @@ -65,6 +65,8 @@ public interface Status { protected String status; protected String username; + protected VPNServerClient() { } + /** * Gets the clientIp. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClientCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClientCollection.java index 65da607d81..a408f1df7d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClientCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClientCollection.java @@ -29,6 +29,8 @@ public class VPNServerClientCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected VPNServerClientCollection() { } + /** * Gets the clients. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClientCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClientCollectionFirst.java index 7624560fad..071174da1c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClientCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClientCollectionFirst.java @@ -21,6 +21,8 @@ public class VPNServerClientCollectionFirst extends GenericModel { protected String href; + protected VPNServerClientCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClientCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClientCollectionNext.java index 898bdd9f7b..9ef91d06a9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClientCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerClientCollectionNext.java @@ -21,6 +21,8 @@ public class VPNServerClientCollectionNext extends GenericModel { protected String href; + protected VPNServerClientCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollection.java index a0939030b0..1a9d978316 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollection.java @@ -30,6 +30,8 @@ public class VPNServerCollection extends GenericModel { @SerializedName("vpn_servers") protected List vpnServers; + protected VPNServerCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollectionFirst.java index 83d9851cc1..570d873f7b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollectionFirst.java @@ -21,6 +21,8 @@ public class VPNServerCollectionFirst extends GenericModel { protected String href; + protected VPNServerCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollectionNext.java index 7be17d40f9..650095c802 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollectionNext.java @@ -21,6 +21,8 @@ public class VPNServerCollectionNext extends GenericModel { protected String href; + protected VPNServerCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerPatch.java index 560b4c81c8..915a0aea23 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerPatch.java @@ -66,6 +66,11 @@ public static class Builder { private String protocol; private List subnets; + /** + * Instantiates a new Builder from an existing VPNServerPatch instance. + * + * @param vpnServerPatch the instance to initialize the Builder with + */ private Builder(VPNServerPatch vpnServerPatch) { this.certificate = vpnServerPatch.certificate; this.clientAuthentication = vpnServerPatch.clientAuthentication; @@ -256,6 +261,8 @@ public Builder subnets(List subnets) { } } + protected VPNServerPatch() { } + protected VPNServerPatch(Builder builder) { certificate = builder.certificate; clientAuthentication = builder.clientAuthentication; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerReferenceDeleted.java index 1890699316..d96eea1d8b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class VPNServerReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class VPNServerReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected VPNServerReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRoute.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRoute.java index 42d50648da..12528597ae 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRoute.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRoute.java @@ -81,6 +81,8 @@ public interface ResourceType { @SerializedName("resource_type") protected String resourceType; + protected VPNServerRoute() { } + /** * Gets the action. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRouteCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRouteCollection.java index 8d83c01cb7..5c243ceafb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRouteCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRouteCollection.java @@ -29,6 +29,8 @@ public class VPNServerRouteCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected VPNServerRouteCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRouteCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRouteCollectionFirst.java index 6865467b23..2cdfa09ba2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRouteCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRouteCollectionFirst.java @@ -21,6 +21,8 @@ public class VPNServerRouteCollectionFirst extends GenericModel { protected String href; + protected VPNServerRouteCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRouteCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRouteCollectionNext.java index 4fd76104d4..84c12c4b0d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRouteCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRouteCollectionNext.java @@ -21,6 +21,8 @@ public class VPNServerRouteCollectionNext extends GenericModel { protected String href; + protected VPNServerRouteCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRoutePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRoutePatch.java index 7dab750984..90dd2ceddb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRoutePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNServerRoutePatch.java @@ -30,6 +30,11 @@ public class VPNServerRoutePatch extends GenericModel { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing VPNServerRoutePatch instance. + * + * @param vpnServerRoutePatch the instance to initialize the Builder with + */ private Builder(VPNServerRoutePatch vpnServerRoutePatch) { this.name = vpnServerRoutePatch.name; } @@ -61,6 +66,8 @@ public Builder name(String name) { } } + protected VPNServerRoutePatch() { } + protected VPNServerRoutePatch(Builder builder) { name = builder.name; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Volume.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Volume.java index 9cf366a13a..981ac757e0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Volume.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Volume.java @@ -87,6 +87,8 @@ public interface Status { protected List volumeAttachments; protected ZoneReference zone; + protected Volume() { } + /** * Gets the active. * @@ -240,7 +242,8 @@ public OperatingSystemReference getOperatingSystem() { /** * Gets the profile. * - * The profile this volume uses. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) for + * this volume. * * @return the profile */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachment.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachment.java index 1cb9508b02..765b2de498 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachment.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachment.java @@ -59,6 +59,8 @@ public interface Type { protected String type; protected VolumeReference volume; + protected VolumeAttachment() { } + /** * Gets the bandwidth. * @@ -166,6 +168,8 @@ public String getType() { * * The attached volume. * + * This property will be absent if the volume has not yet been provisioned. + * * @return the volume */ public VolumeReference getVolume() { diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentCollection.java index 5e7439b5ee..c8377b20ae 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentCollection.java @@ -25,6 +25,8 @@ public class VolumeAttachmentCollection extends GenericModel { @SerializedName("volume_attachments") protected List volumeAttachments; + protected VolumeAttachmentCollection() { } + /** * Gets the volumeAttachments. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentDevice.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentDevice.java index b9c77bb53b..8699f71fe5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentDevice.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentDevice.java @@ -21,6 +21,8 @@ public class VolumeAttachmentDevice extends GenericModel { protected String id; + protected VolumeAttachmentDevice() { } + /** * Gets the id. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPatch.java index 924c93e4f6..e0706cc20b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPatch.java @@ -34,6 +34,11 @@ public static class Builder { private Boolean deleteVolumeOnInstanceDelete; private String name; + /** + * Instantiates a new Builder from an existing VolumeAttachmentPatch instance. + * + * @param volumeAttachmentPatch the instance to initialize the Builder with + */ private Builder(VolumeAttachmentPatch volumeAttachmentPatch) { this.deleteVolumeOnInstanceDelete = volumeAttachmentPatch.deleteVolumeOnInstanceDelete; this.name = volumeAttachmentPatch.name; @@ -77,6 +82,8 @@ public Builder name(String name) { } } + protected VolumeAttachmentPatch() { } + protected VolumeAttachmentPatch(Builder builder) { deleteVolumeOnInstanceDelete = builder.deleteVolumeOnInstanceDelete; name = builder.name; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceByImageContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceByImageContext.java index a8ba212d4a..df95897659 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceByImageContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceByImageContext.java @@ -26,6 +26,11 @@ public static class Builder { private String name; private VolumePrototypeInstanceByImageContext volume; + /** + * Instantiates a new Builder from an existing VolumeAttachmentPrototypeInstanceByImageContext instance. + * + * @param volumeAttachmentPrototypeInstanceByImageContext the instance to initialize the Builder with + */ private Builder(VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContext) { this.deleteVolumeOnInstanceDelete = volumeAttachmentPrototypeInstanceByImageContext.deleteVolumeOnInstanceDelete; this.name = volumeAttachmentPrototypeInstanceByImageContext.name; @@ -90,6 +95,8 @@ public Builder volume(VolumePrototypeInstanceByImageContext volume) { } } + protected VolumeAttachmentPrototypeInstanceByImageContext() { } + protected VolumeAttachmentPrototypeInstanceByImageContext(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.volume, "volume cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.java index 0833ee9f87..bad01cea93 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.java @@ -26,6 +26,11 @@ public static class Builder { private String name; private VolumePrototypeInstanceBySourceSnapshotContext volume; + /** + * Instantiates a new Builder from an existing VolumeAttachmentPrototypeInstanceBySourceSnapshotContext instance. + * + * @param volumeAttachmentPrototypeInstanceBySourceSnapshotContext the instance to initialize the Builder with + */ private Builder(VolumeAttachmentPrototypeInstanceBySourceSnapshotContext volumeAttachmentPrototypeInstanceBySourceSnapshotContext) { this.deleteVolumeOnInstanceDelete = volumeAttachmentPrototypeInstanceBySourceSnapshotContext.deleteVolumeOnInstanceDelete; this.name = volumeAttachmentPrototypeInstanceBySourceSnapshotContext.name; @@ -90,6 +95,8 @@ public Builder volume(VolumePrototypeInstanceBySourceSnapshotContext volume) { } } + protected VolumeAttachmentPrototypeInstanceBySourceSnapshotContext() { } + protected VolumeAttachmentPrototypeInstanceBySourceSnapshotContext(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.volume, "volume cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceContext.java index 19a6e5a948..9cb32108a4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceContext.java @@ -33,6 +33,11 @@ public static class Builder { private String name; private VolumeAttachmentVolumePrototypeInstanceContext volume; + /** + * Instantiates a new Builder from an existing VolumeAttachmentPrototypeInstanceContext instance. + * + * @param volumeAttachmentPrototypeInstanceContext the instance to initialize the Builder with + */ private Builder(VolumeAttachmentPrototypeInstanceContext volumeAttachmentPrototypeInstanceContext) { this.deleteVolumeOnInstanceDelete = volumeAttachmentPrototypeInstanceContext.deleteVolumeOnInstanceDelete; this.name = volumeAttachmentPrototypeInstanceContext.name; @@ -97,6 +102,8 @@ public Builder volume(VolumeAttachmentVolumePrototypeInstanceContext volume) { } } + protected VolumeAttachmentPrototypeInstanceContext() { } + protected VolumeAttachmentPrototypeInstanceContext(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.volume, "volume cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceWrapper.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceWrapper.java index 6632d04f55..dd2473e495 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceWrapper.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceWrapper.java @@ -1,5 +1,7 @@ package com.ibm.cloud.is.vpc.v1.model; +import java.util.List; + import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -12,5 +14,7 @@ public class VolumeAttachmentPrototypeInstanceWrapper extends GenericModel { protected VolumeProfileIdentity profile; @SerializedName("source_snapshot") protected SnapshotIdentity sourceSnapshot; + @SerializedName("user_tags") + protected List userTags; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolume.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolume.java index ce0c0f0447..4cc6e5ed59 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolume.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolume.java @@ -12,6 +12,8 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.List; + import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -30,14 +32,15 @@ public class VolumeAttachmentPrototypeVolume extends GenericModel { protected Long iops; protected String name; protected VolumeProfileIdentity profile; + @SerializedName("user_tags") + protected List userTags; protected Long capacity; @SerializedName("encryption_key") protected EncryptionKeyIdentity encryptionKey; @SerializedName("source_snapshot") protected SnapshotIdentity sourceSnapshot; - protected VolumeAttachmentPrototypeVolume() { - } + protected VolumeAttachmentPrototypeVolume() { } /** * Gets the id. @@ -98,7 +101,8 @@ public String name() { /** * Gets the profile. * - * The profile to use for this volume. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + * use for this volume. * * @return the profile */ @@ -106,6 +110,17 @@ public VolumeProfileIdentity profile() { return profile; } + /** + * Gets the userTags. + * + * The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. + * + * @return the userTags + */ + public List userTags() { + return userTags; + } + /** * Gets the capacity. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentity.java index ff9b625d5f..3a2a5e038b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentity.java @@ -23,7 +23,6 @@ public class VolumeAttachmentPrototypeVolumeVolumeIdentity extends VolumeAttachmentPrototypeVolume { - protected VolumeAttachmentPrototypeVolumeVolumeIdentity() { - } + protected VolumeAttachmentPrototypeVolumeVolumeIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN.java index d5b3426094..64ebb39c78 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN.java @@ -24,6 +24,11 @@ public class VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN ex public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN instance. + * + * @param volumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCrn the instance to initialize the Builder with + */ public Builder(VolumeAttachmentPrototypeVolumeVolumeIdentity volumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCrn) { this.crn = volumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN() { } + protected VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref.java index dd197b9d5c..0cc2245691 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref.java @@ -24,6 +24,11 @@ public class VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref e public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref instance. + * + * @param volumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref the instance to initialize the Builder with + */ public Builder(VolumeAttachmentPrototypeVolumeVolumeIdentity volumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref) { this.href = volumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref() { } + protected VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.java index 189a821680..0f63b89d6f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.java @@ -24,6 +24,11 @@ public class VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById ext public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById instance. + * + * @param volumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById the instance to initialize the Builder with + */ public Builder(VolumeAttachmentPrototypeVolumeVolumeIdentity volumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById) { this.id = volumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById() { } + protected VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext.java index 84cd2832e2..4a0d830fea 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext.java @@ -22,7 +22,6 @@ public class VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext extends VolumeAttachmentPrototypeVolume { - protected VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext() { - } + protected VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.java index babed0c36d..32d0a1c840 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.java @@ -12,6 +12,9 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.ArrayList; +import java.util.List; + /** * VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity. */ @@ -25,13 +28,20 @@ public static class Builder { private Long iops; private String name; private VolumeProfileIdentity profile; + private List userTags; private Long capacity; private EncryptionKeyIdentity encryptionKey; + /** + * Instantiates a new Builder from an existing VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity instance. + * + * @param volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity the instance to initialize the Builder with + */ public Builder(VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity) { this.iops = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.iops; this.name = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.name; this.profile = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.profile; + this.userTags = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.userTags; this.capacity = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.capacity; this.encryptionKey = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.encryptionKey; } @@ -62,6 +72,22 @@ public VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumeProtot return new VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity(this); } + /** + * Adds an userTags to userTags. + * + * @param userTags the new userTags + * @return the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity builder + */ + public Builder addUserTags(String userTags) { + com.ibm.cloud.sdk.core.util.Validator.notNull(userTags, + "userTags cannot be null"); + if (this.userTags == null) { + this.userTags = new ArrayList(); + } + this.userTags.add(userTags); + return this; + } + /** * Set the iops. * @@ -95,6 +121,18 @@ public Builder profile(VolumeProfileIdentity profile) { return this; } + /** + * Set the userTags. + * Existing userTags will be replaced. + * + * @param userTags the userTags + * @return the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity builder + */ + public Builder userTags(List userTags) { + this.userTags = userTags; + return this; + } + /** * Set the capacity. * @@ -118,6 +156,8 @@ public Builder encryptionKey(EncryptionKeyIdentity encryptionKey) { } } + protected VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity() { } + protected VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profile, "profile cannot be null"); @@ -126,6 +166,7 @@ protected VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePro iops = builder.iops; name = builder.name; profile = builder.profile; + userTags = builder.userTags; capacity = builder.capacity; encryptionKey = builder.encryptionKey; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.java index 0304c902a2..2beab3bf21 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.java @@ -12,6 +12,9 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.ArrayList; +import java.util.List; + /** * VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot. */ @@ -25,14 +28,21 @@ public static class Builder { private Long iops; private String name; private VolumeProfileIdentity profile; + private List userTags; private Long capacity; private EncryptionKeyIdentity encryptionKey; private SnapshotIdentity sourceSnapshot; + /** + * Instantiates a new Builder from an existing VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot instance. + * + * @param volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot the instance to initialize the Builder with + */ public Builder(VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot) { this.iops = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.iops; this.name = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.name; this.profile = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.profile; + this.userTags = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.userTags; this.capacity = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.capacity; this.encryptionKey = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.encryptionKey; this.sourceSnapshot = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.sourceSnapshot; @@ -64,6 +74,22 @@ public VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumeProtot return new VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot(this); } + /** + * Adds an userTags to userTags. + * + * @param userTags the new userTags + * @return the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot builder + */ + public Builder addUserTags(String userTags) { + com.ibm.cloud.sdk.core.util.Validator.notNull(userTags, + "userTags cannot be null"); + if (this.userTags == null) { + this.userTags = new ArrayList(); + } + this.userTags.add(userTags); + return this; + } + /** * Set the iops. * @@ -97,6 +123,18 @@ public Builder profile(VolumeProfileIdentity profile) { return this; } + /** + * Set the userTags. + * Existing userTags will be replaced. + * + * @param userTags the userTags + * @return the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot builder + */ + public Builder userTags(List userTags) { + this.userTags = userTags; + return this; + } + /** * Set the capacity. * @@ -131,6 +169,8 @@ public Builder sourceSnapshot(SnapshotIdentity sourceSnapshot) { } } + protected VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot() { } + protected VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profile, "profile cannot be null"); @@ -139,6 +179,7 @@ protected VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePro iops = builder.iops; name = builder.name; profile = builder.profile; + userTags = builder.userTags; capacity = builder.capacity; encryptionKey = builder.encryptionKey; sourceSnapshot = builder.sourceSnapshot; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceInstanceContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceInstanceContext.java index 7f1020e4c2..099229d2b0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceInstanceContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceInstanceContext.java @@ -26,10 +26,12 @@ public class VolumeAttachmentReferenceInstanceContext extends GenericModel { protected String name; protected VolumeReference volume; + protected VolumeAttachmentReferenceInstanceContext() { } + /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted @@ -89,6 +91,8 @@ public String getName() { * * The attached volume. * + * This property will be absent if the volume has not yet been provisioned. + * * @return the volume */ public VolumeReference getVolume() { diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceInstanceContextDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceInstanceContextDeleted.java index cfc4f6975a..3a91a535bd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceInstanceContextDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceInstanceContextDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class VolumeAttachmentReferenceInstanceContextDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class VolumeAttachmentReferenceInstanceContextDeleted extends GenericMode @SerializedName("more_info") protected String moreInfo; + protected VolumeAttachmentReferenceInstanceContextDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceVolumeContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceVolumeContext.java index c68b7accb2..e207f685c8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceVolumeContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceVolumeContext.java @@ -40,6 +40,8 @@ public interface Type { protected String name; protected String type; + protected VolumeAttachmentReferenceVolumeContext() { } + /** * Gets the deleteVolumeOnInstanceDelete. * @@ -54,7 +56,7 @@ public Boolean isDeleteVolumeOnInstanceDelete() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceVolumeContextDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceVolumeContextDeleted.java index eda3d21032..100447fad3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceVolumeContextDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentReferenceVolumeContextDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class VolumeAttachmentReferenceVolumeContextDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class VolumeAttachmentReferenceVolumeContextDeleted extends GenericModel @SerializedName("more_info") protected String moreInfo; + protected VolumeAttachmentReferenceVolumeContextDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContext.java index 51b23a55d0..afbea7f3d1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContext.java @@ -12,6 +12,8 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.List; + import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -30,14 +32,15 @@ public class VolumeAttachmentVolumePrototypeInstanceContext extends GenericModel protected Long iops; protected String name; protected VolumeProfileIdentity profile; + @SerializedName("user_tags") + protected List userTags; protected Long capacity; @SerializedName("encryption_key") protected EncryptionKeyIdentity encryptionKey; @SerializedName("source_snapshot") protected SnapshotIdentity sourceSnapshot; - protected VolumeAttachmentVolumePrototypeInstanceContext() { - } + protected VolumeAttachmentVolumePrototypeInstanceContext() { } /** * Gets the id. @@ -98,7 +101,8 @@ public String name() { /** * Gets the profile. * - * The profile to use for this volume. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + * use for this volume. * * @return the profile */ @@ -106,6 +110,17 @@ public VolumeProfileIdentity profile() { return profile; } + /** + * Gets the userTags. + * + * The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. + * + * @return the userTags + */ + public List userTags() { + return userTags; + } + /** * Gets the capacity. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity.java index aacab57f4b..ad69d22d67 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity.java @@ -23,7 +23,6 @@ public class VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity extends VolumeAttachmentVolumePrototypeInstanceContext { - protected VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity() { - } + protected VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN.java index 104d628401..2900cb5092 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN.java @@ -24,6 +24,11 @@ public class VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeI public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN instance. + * + * @param volumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCrn the instance to initialize the Builder with + */ public Builder(VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity volumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCrn) { this.crn = volumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN() { } + protected VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref.java index 8a97c51b50..01b76001ac 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref.java @@ -24,6 +24,11 @@ public class VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeI public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref instance. + * + * @param volumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref the instance to initialize the Builder with + */ public Builder(VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity volumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref) { this.href = volumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref() { } + protected VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.java index 86d564b0d8..f63dc14ff5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.java @@ -24,6 +24,11 @@ public class VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeI public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById instance. + * + * @param volumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById the instance to initialize the Builder with + */ public Builder(VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity volumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById) { this.id = volumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById() { } + protected VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext.java index 1fdda275b3..eb9f00fb6c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext.java @@ -22,7 +22,6 @@ public class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext extends VolumeAttachmentVolumePrototypeInstanceContext { - protected VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext() { - } + protected VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.java index 1e64f60569..42006e1d85 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.java @@ -12,6 +12,9 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.ArrayList; +import java.util.List; + /** * VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity. */ @@ -25,13 +28,20 @@ public static class Builder { private Long iops; private String name; private VolumeProfileIdentity profile; + private List userTags; private Long capacity; private EncryptionKeyIdentity encryptionKey; + /** + * Instantiates a new Builder from an existing VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity instance. + * + * @param volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity the instance to initialize the Builder with + */ public Builder(VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity) { this.iops = volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.iops; this.name = volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.name; this.profile = volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.profile; + this.userTags = volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.userTags; this.capacity = volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.capacity; this.encryptionKey = volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.encryptionKey; } @@ -62,6 +72,22 @@ public VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceCont return new VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity(this); } + /** + * Adds an userTags to userTags. + * + * @param userTags the new userTags + * @return the VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity builder + */ + public Builder addUserTags(String userTags) { + com.ibm.cloud.sdk.core.util.Validator.notNull(userTags, + "userTags cannot be null"); + if (this.userTags == null) { + this.userTags = new ArrayList(); + } + this.userTags.add(userTags); + return this; + } + /** * Set the iops. * @@ -95,6 +121,18 @@ public Builder profile(VolumeProfileIdentity profile) { return this; } + /** + * Set the userTags. + * Existing userTags will be replaced. + * + * @param userTags the userTags + * @return the VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity builder + */ + public Builder userTags(List userTags) { + this.userTags = userTags; + return this; + } + /** * Set the capacity. * @@ -118,6 +156,8 @@ public Builder encryptionKey(EncryptionKeyIdentity encryptionKey) { } } + protected VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity() { } + protected VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profile, "profile cannot be null"); @@ -126,6 +166,7 @@ protected VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceC iops = builder.iops; name = builder.name; profile = builder.profile; + userTags = builder.userTags; capacity = builder.capacity; encryptionKey = builder.encryptionKey; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.java index cab1918cb6..0e9a848389 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.java @@ -12,6 +12,9 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.ArrayList; +import java.util.List; + /** * VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot. */ @@ -25,14 +28,21 @@ public static class Builder { private Long iops; private String name; private VolumeProfileIdentity profile; + private List userTags; private Long capacity; private EncryptionKeyIdentity encryptionKey; private SnapshotIdentity sourceSnapshot; + /** + * Instantiates a new Builder from an existing VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot instance. + * + * @param volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot the instance to initialize the Builder with + */ public Builder(VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot) { this.iops = volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.iops; this.name = volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.name; this.profile = volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.profile; + this.userTags = volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.userTags; this.capacity = volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.capacity; this.encryptionKey = volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.encryptionKey; this.sourceSnapshot = volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.sourceSnapshot; @@ -64,6 +74,22 @@ public VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceCont return new VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot(this); } + /** + * Adds an userTags to userTags. + * + * @param userTags the new userTags + * @return the VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot builder + */ + public Builder addUserTags(String userTags) { + com.ibm.cloud.sdk.core.util.Validator.notNull(userTags, + "userTags cannot be null"); + if (this.userTags == null) { + this.userTags = new ArrayList(); + } + this.userTags.add(userTags); + return this; + } + /** * Set the iops. * @@ -97,6 +123,18 @@ public Builder profile(VolumeProfileIdentity profile) { return this; } + /** + * Set the userTags. + * Existing userTags will be replaced. + * + * @param userTags the userTags + * @return the VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot builder + */ + public Builder userTags(List userTags) { + this.userTags = userTags; + return this; + } + /** * Set the capacity. * @@ -131,6 +169,8 @@ public Builder sourceSnapshot(SnapshotIdentity sourceSnapshot) { } } + protected VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot() { } + protected VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profile, "profile cannot be null"); @@ -139,6 +179,7 @@ protected VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceC iops = builder.iops; name = builder.name; profile = builder.profile; + userTags = builder.userTags; capacity = builder.capacity; encryptionKey = builder.encryptionKey; sourceSnapshot = builder.sourceSnapshot; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollection.java index 8672481828..ff70cf49d6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollection.java @@ -26,6 +26,8 @@ public class VolumeCollection extends GenericModel { protected VolumeCollectionNext next; protected List volumes; + protected VolumeCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionFirst.java index e8405b3ab4..2fc89aca79 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionFirst.java @@ -21,6 +21,8 @@ public class VolumeCollectionFirst extends GenericModel { protected String href; + protected VolumeCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionNext.java index 52227d1a63..ca7f615588 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionNext.java @@ -21,6 +21,8 @@ public class VolumeCollectionNext extends GenericModel { protected String href; + protected VolumeCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentity.java index 26977f0080..d348d94439 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentity.java @@ -28,8 +28,7 @@ public class VolumeIdentity extends GenericModel { protected String crn; protected String href; - protected VolumeIdentity() { - } + protected VolumeIdentity() { } /** * Gets the id. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentityByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentityByCRN.java index 62453c51ec..5deb0fd089 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentityByCRN.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentityByCRN.java @@ -24,6 +24,11 @@ public class VolumeIdentityByCRN extends VolumeIdentity { public static class Builder { private String crn; + /** + * Instantiates a new Builder from an existing VolumeIdentityByCRN instance. + * + * @param volumeIdentityByCrn the instance to initialize the Builder with + */ public Builder(VolumeIdentity volumeIdentityByCrn) { this.crn = volumeIdentityByCrn.crn; } @@ -64,6 +69,8 @@ public Builder crn(String crn) { } } + protected VolumeIdentityByCRN() { } + protected VolumeIdentityByCRN(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, "crn cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentityByHref.java index 9600b7d694..9ab98f5497 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentityByHref.java @@ -24,6 +24,11 @@ public class VolumeIdentityByHref extends VolumeIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing VolumeIdentityByHref instance. + * + * @param volumeIdentityByHref the instance to initialize the Builder with + */ public Builder(VolumeIdentity volumeIdentityByHref) { this.href = volumeIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected VolumeIdentityByHref() { } + protected VolumeIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentityById.java index d8d66cd28b..6cf9eb6551 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentityById.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeIdentityById.java @@ -24,6 +24,11 @@ public class VolumeIdentityById extends VolumeIdentity { public static class Builder { private String id; + /** + * Instantiates a new Builder from an existing VolumeIdentityById instance. + * + * @param volumeIdentityById the instance to initialize the Builder with + */ public Builder(VolumeIdentity volumeIdentityById) { this.id = volumeIdentityById.id; } @@ -64,6 +69,8 @@ public Builder id(String id) { } } + protected VolumeIdentityById() { } + protected VolumeIdentityById(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, "id cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePatch.java index bb638695e5..a66386e042 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePatch.java @@ -42,6 +42,11 @@ public static class Builder { private VolumeProfileIdentity profile; private List userTags; + /** + * Instantiates a new Builder from an existing VolumePatch instance. + * + * @param volumePatch the instance to initialize the Builder with + */ private Builder(VolumePatch volumePatch) { this.capacity = volumePatch.capacity; this.iops = volumePatch.iops; @@ -138,6 +143,8 @@ public Builder userTags(List userTags) { } } + protected VolumePatch() { } + protected VolumePatch(Builder builder) { capacity = builder.capacity; iops = builder.iops; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfile.java index fa04f35d41..8ecc9c1d06 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfile.java @@ -37,6 +37,8 @@ public interface Family { protected String href; protected String name; + protected VolumeProfile() { } + /** * Gets the family. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileCollection.java index f63b7f2bc5..db7425f5eb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileCollection.java @@ -29,6 +29,8 @@ public class VolumeProfileCollection extends GenericModel { @SerializedName("total_count") protected Long totalCount; + protected VolumeProfileCollection() { } + /** * Gets the first. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileCollectionFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileCollectionFirst.java index 2fb348c21c..21df8b79f6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileCollectionFirst.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileCollectionFirst.java @@ -21,6 +21,8 @@ public class VolumeProfileCollectionFirst extends GenericModel { protected String href; + protected VolumeProfileCollectionFirst() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileCollectionNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileCollectionNext.java index 95858f490c..da896e1edc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileCollectionNext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileCollectionNext.java @@ -21,6 +21,8 @@ public class VolumeProfileCollectionNext extends GenericModel { protected String href; + protected VolumeProfileCollectionNext() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileIdentity.java index 14fac11da6..d81c8ced27 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileIdentity.java @@ -26,8 +26,7 @@ public class VolumeProfileIdentity extends GenericModel { protected String name; protected String href; - protected VolumeProfileIdentity() { - } + protected VolumeProfileIdentity() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileIdentityByHref.java index 7c455a14d2..70f231bbe6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileIdentityByHref.java @@ -24,6 +24,11 @@ public class VolumeProfileIdentityByHref extends VolumeProfileIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing VolumeProfileIdentityByHref instance. + * + * @param volumeProfileIdentityByHref the instance to initialize the Builder with + */ public Builder(VolumeProfileIdentity volumeProfileIdentityByHref) { this.href = volumeProfileIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected VolumeProfileIdentityByHref() { } + protected VolumeProfileIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileIdentityByName.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileIdentityByName.java index 095d46e4c9..02c62b0832 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileIdentityByName.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileIdentityByName.java @@ -24,6 +24,11 @@ public class VolumeProfileIdentityByName extends VolumeProfileIdentity { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing VolumeProfileIdentityByName instance. + * + * @param volumeProfileIdentityByName the instance to initialize the Builder with + */ public Builder(VolumeProfileIdentity volumeProfileIdentityByName) { this.name = volumeProfileIdentityByName.name; } @@ -64,6 +69,8 @@ public Builder name(String name) { } } + protected VolumeProfileIdentityByName() { } + protected VolumeProfileIdentityByName(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileReference.java index 2d91fa0f9d..543d0d1cc4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfileReference.java @@ -22,6 +22,8 @@ public class VolumeProfileReference extends GenericModel { protected String href; protected String name; + protected VolumeProfileReference() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfilesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfilesPager.java new file mode 100644 index 0000000000..d2a347f1e5 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeProfilesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * VolumeProfilesPager can be used to simplify the use of the "listVolumeProfiles" method. + */ +public class VolumeProfilesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListVolumeProfilesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected VolumeProfilesPager() { } + + /** + * Constructs a new VolumeProfilesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listVolumeProfiles" method + * @param options the ListVolumeProfilesOptions instance to be used to invoke the "listVolumeProfiles" method + */ + public VolumeProfilesPager(Vpc client, ListVolumeProfilesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<VolumeProfile> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListVolumeProfilesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + VolumeProfileCollection result = client.listVolumeProfiles(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getProfiles(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<VolumeProfile> containing all results returned by the "listVolumeProfiles" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototype.java index 166004cc80..432190db86 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototype.java @@ -40,8 +40,7 @@ public class VolumePrototype extends GenericModel { @SerializedName("source_snapshot") protected SnapshotIdentity sourceSnapshot; - protected VolumePrototype() { - } + protected VolumePrototype() { } /** * Gets the iops. @@ -69,7 +68,8 @@ public String name() { /** * Gets the profile. * - * The profile to use for this volume. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + * use for this volume. * * @return the profile */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContext.java index 92335a4de4..812fb84a88 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContext.java @@ -12,6 +12,8 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.ArrayList; +import java.util.List; /** * VolumePrototypeInstanceByImageContext. @@ -27,13 +29,20 @@ public static class Builder { private Long iops; private String name; private VolumeProfileIdentity profile; + private List userTags; + /** + * Instantiates a new Builder from an existing VolumePrototypeInstanceByImageContext instance. + * + * @param volumePrototypeInstanceByImageContext the instance to initialize the Builder with + */ private Builder(VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContext) { this.capacity = volumePrototypeInstanceByImageContext.capacity; this.encryptionKey = volumePrototypeInstanceByImageContext.encryptionKey; this.iops = volumePrototypeInstanceByImageContext.iops; this.name = volumePrototypeInstanceByImageContext.name; this.profile = volumePrototypeInstanceByImageContext.profile; + this.userTags = volumePrototypeInstanceByImageContext.userTags; } /** @@ -60,6 +69,22 @@ public VolumePrototypeInstanceByImageContext build() { return new VolumePrototypeInstanceByImageContext(this); } + /** + * Adds an userTags to userTags. + * + * @param userTags the new userTags + * @return the VolumePrototypeInstanceByImageContext builder + */ + public Builder addUserTags(String userTags) { + com.ibm.cloud.sdk.core.util.Validator.notNull(userTags, + "userTags cannot be null"); + if (this.userTags == null) { + this.userTags = new ArrayList(); + } + this.userTags.add(userTags); + return this; + } + /** * Set the capacity. * @@ -114,8 +139,22 @@ public Builder profile(VolumeProfileIdentity profile) { this.profile = profile; return this; } + + /** + * Set the userTags. + * Existing userTags will be replaced. + * + * @param userTags the userTags + * @return the VolumePrototypeInstanceByImageContext builder + */ + public Builder userTags(List userTags) { + this.userTags = userTags; + return this; + } } + protected VolumePrototypeInstanceByImageContext() { } + protected VolumePrototypeInstanceByImageContext(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profile, "profile cannot be null"); @@ -124,6 +163,7 @@ protected VolumePrototypeInstanceByImageContext(Builder builder) { iops = builder.iops; name = builder.name; profile = builder.profile; + userTags = builder.userTags; } /** @@ -188,12 +228,24 @@ public String name() { /** * Gets the profile. * - * The profile to use for this volume. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + * use for this volume. * * @return the profile */ public VolumeProfileIdentity profile() { return profile; } + + /** + * Gets the userTags. + * + * The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. + * + * @return the userTags + */ + public List userTags() { + return userTags; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContext.java index 4e8fe8b818..33337147ea 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContext.java @@ -12,6 +12,9 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.ArrayList; +import java.util.List; + /** * VolumePrototypeInstanceBySourceSnapshotContext. */ @@ -27,7 +30,13 @@ public static class Builder { private String name; private VolumeProfileIdentity profile; private SnapshotIdentity sourceSnapshot; + private List userTags; + /** + * Instantiates a new Builder from an existing VolumePrototypeInstanceBySourceSnapshotContext instance. + * + * @param volumePrototypeInstanceBySourceSnapshotContext the instance to initialize the Builder with + */ private Builder(VolumePrototypeInstanceBySourceSnapshotContext volumePrototypeInstanceBySourceSnapshotContext) { this.capacity = volumePrototypeInstanceBySourceSnapshotContext.capacity; this.encryptionKey = volumePrototypeInstanceBySourceSnapshotContext.encryptionKey; @@ -35,6 +44,7 @@ private Builder(VolumePrototypeInstanceBySourceSnapshotContext volumePrototypeIn this.name = volumePrototypeInstanceBySourceSnapshotContext.name; this.profile = volumePrototypeInstanceBySourceSnapshotContext.profile; this.sourceSnapshot = volumePrototypeInstanceBySourceSnapshotContext.sourceSnapshot; + this.userTags = volumePrototypeInstanceBySourceSnapshotContext.userTags; } /** @@ -63,6 +73,22 @@ public VolumePrototypeInstanceBySourceSnapshotContext build() { return new VolumePrototypeInstanceBySourceSnapshotContext(this); } + /** + * Adds an userTags to userTags. + * + * @param userTags the new userTags + * @return the VolumePrototypeInstanceBySourceSnapshotContext builder + */ + public Builder addUserTags(String userTags) { + com.ibm.cloud.sdk.core.util.Validator.notNull(userTags, + "userTags cannot be null"); + if (this.userTags == null) { + this.userTags = new ArrayList(); + } + this.userTags.add(userTags); + return this; + } + /** * Set the capacity. * @@ -128,8 +154,22 @@ public Builder sourceSnapshot(SnapshotIdentity sourceSnapshot) { this.sourceSnapshot = sourceSnapshot; return this; } + + /** + * Set the userTags. + * Existing userTags will be replaced. + * + * @param userTags the userTags + * @return the VolumePrototypeInstanceBySourceSnapshotContext builder + */ + public Builder userTags(List userTags) { + this.userTags = userTags; + return this; + } } + protected VolumePrototypeInstanceBySourceSnapshotContext() { } + protected VolumePrototypeInstanceBySourceSnapshotContext(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profile, "profile cannot be null"); @@ -141,6 +181,7 @@ protected VolumePrototypeInstanceBySourceSnapshotContext(Builder builder) { name = builder.name; profile = builder.profile; sourceSnapshot = builder.sourceSnapshot; + userTags = builder.userTags; } /** @@ -205,7 +246,8 @@ public String name() { /** * Gets the profile. * - * The profile to use for this volume. + * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + * use for this volume. * * @return the profile */ @@ -223,5 +265,16 @@ public VolumeProfileIdentity profile() { public SnapshotIdentity sourceSnapshot() { return sourceSnapshot; } + + /** + * Gets the userTags. + * + * The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. + * + * @return the userTags + */ + public List userTags() { + return userTags; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeByCapacity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeByCapacity.java index d6169dc6ff..8fb886717f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeByCapacity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeByCapacity.java @@ -34,6 +34,11 @@ public static class Builder { private Long capacity; private EncryptionKeyIdentity encryptionKey; + /** + * Instantiates a new Builder from an existing VolumePrototypeVolumeByCapacity instance. + * + * @param volumePrototypeVolumeByCapacity the instance to initialize the Builder with + */ public Builder(VolumePrototype volumePrototypeVolumeByCapacity) { this.iops = volumePrototypeVolumeByCapacity.iops; this.name = volumePrototypeVolumeByCapacity.name; @@ -179,6 +184,8 @@ public Builder encryptionKey(EncryptionKeyIdentity encryptionKey) { } } + protected VolumePrototypeVolumeByCapacity() { } + protected VolumePrototypeVolumeByCapacity(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profile, "profile cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshot.java index 2c5fab5f37..5cfdcdca56 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshot.java @@ -35,6 +35,11 @@ public static class Builder { private EncryptionKeyIdentity encryptionKey; private SnapshotIdentity sourceSnapshot; + /** + * Instantiates a new Builder from an existing VolumePrototypeVolumeBySourceSnapshot instance. + * + * @param volumePrototypeVolumeBySourceSnapshot the instance to initialize the Builder with + */ public Builder(VolumePrototype volumePrototypeVolumeBySourceSnapshot) { this.iops = volumePrototypeVolumeBySourceSnapshot.iops; this.name = volumePrototypeVolumeBySourceSnapshot.name; @@ -192,6 +197,8 @@ public Builder sourceSnapshot(SnapshotIdentity sourceSnapshot) { } } + protected VolumePrototypeVolumeBySourceSnapshot() { } + protected VolumePrototypeVolumeBySourceSnapshot(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profile, "profile cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReference.java index 6b062ddf01..5c620541ae 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReference.java @@ -25,6 +25,8 @@ public class VolumeReference extends GenericModel { protected String id; protected String name; + protected VolumeReference() { } + /** * Gets the crn. * @@ -39,7 +41,7 @@ public String getCrn() { /** * Gets the deleted. * - * If present, this property indicates the referenced resource has been deleted and provides + * If present, this property indicates the referenced resource has been deleted, and provides * some supplementary information. * * @return the deleted diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceDeleted.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceDeleted.java index b431d9d13e..2aa072b448 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceDeleted.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceDeleted.java @@ -16,7 +16,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * If present, this property indicates the referenced resource has been deleted and provides some supplementary + * If present, this property indicates the referenced resource has been deleted, and provides some supplementary * information. */ public class VolumeReferenceDeleted extends GenericModel { @@ -24,6 +24,8 @@ public class VolumeReferenceDeleted extends GenericModel { @SerializedName("more_info") protected String moreInfo; + protected VolumeReferenceDeleted() { } + /** * Gets the moreInfo. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeStatusReason.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeStatusReason.java index ecc4a77577..92af210686 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeStatusReason.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeStatusReason.java @@ -33,6 +33,8 @@ public interface Code { @SerializedName("more_info") protected String moreInfo; + protected VolumeStatusReason() { } + /** * Gets the code. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumesPager.java new file mode 100644 index 0000000000..7477bd1452 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * VolumesPager can be used to simplify the use of the "listVolumes" method. + */ +public class VolumesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListVolumesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected VolumesPager() { } + + /** + * Constructs a new VolumesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listVolumes" method + * @param options the ListVolumesOptions instance to be used to invoke the "listVolumes" method + */ + public VolumesPager(Vpc client, ListVolumesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<Volume> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListVolumesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + VolumeCollection result = client.listVolumes(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getVolumes(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<Volume> containing all results returned by the "listVolumes" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcAddressPrefixesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcAddressPrefixesPager.java new file mode 100644 index 0000000000..b38ed75563 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcAddressPrefixesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * VpcAddressPrefixesPager can be used to simplify the use of the "listVpcAddressPrefixes" method. + */ +public class VpcAddressPrefixesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListVpcAddressPrefixesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected VpcAddressPrefixesPager() { } + + /** + * Constructs a new VpcAddressPrefixesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listVpcAddressPrefixes" method + * @param options the ListVpcAddressPrefixesOptions instance to be used to invoke the "listVpcAddressPrefixes" method + */ + public VpcAddressPrefixesPager(Vpc client, ListVpcAddressPrefixesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<AddressPrefix> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListVpcAddressPrefixesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + AddressPrefixCollection result = client.listVpcAddressPrefixes(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getAddressPrefixes(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<AddressPrefix> containing all results returned by the "listVpcAddressPrefixes" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcRoutesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcRoutesPager.java new file mode 100644 index 0000000000..f1bfcd4b65 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcRoutesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * VpcRoutesPager can be used to simplify the use of the "listVpcRoutes" method. + */ +public class VpcRoutesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListVpcRoutesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected VpcRoutesPager() { } + + /** + * Constructs a new VpcRoutesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listVpcRoutes" method + * @param options the ListVpcRoutesOptions instance to be used to invoke the "listVpcRoutes" method + */ + public VpcRoutesPager(Vpc client, ListVpcRoutesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<Route> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListVpcRoutesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + RouteCollection result = client.listVpcRoutes(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getRoutes(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<Route> containing all results returned by the "listVpcRoutes" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcRoutingTableRoutesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcRoutingTableRoutesPager.java new file mode 100644 index 0000000000..ba523d5e39 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcRoutingTableRoutesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * VpcRoutingTableRoutesPager can be used to simplify the use of the "listVpcRoutingTableRoutes" method. + */ +public class VpcRoutingTableRoutesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListVpcRoutingTableRoutesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected VpcRoutingTableRoutesPager() { } + + /** + * Constructs a new VpcRoutingTableRoutesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listVpcRoutingTableRoutes" method + * @param options the ListVpcRoutingTableRoutesOptions instance to be used to invoke the "listVpcRoutingTableRoutes" method + */ + public VpcRoutingTableRoutesPager(Vpc client, ListVpcRoutingTableRoutesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<Route> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListVpcRoutingTableRoutesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + RouteCollection result = client.listVpcRoutingTableRoutes(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getRoutes(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<Route> containing all results returned by the "listVpcRoutingTableRoutes" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcRoutingTablesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcRoutingTablesPager.java new file mode 100644 index 0000000000..3a07112374 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcRoutingTablesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * VpcRoutingTablesPager can be used to simplify the use of the "listVpcRoutingTables" method. + */ +public class VpcRoutingTablesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListVpcRoutingTablesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected VpcRoutingTablesPager() { } + + /** + * Constructs a new VpcRoutingTablesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listVpcRoutingTables" method + * @param options the ListVpcRoutingTablesOptions instance to be used to invoke the "listVpcRoutingTables" method + */ + public VpcRoutingTablesPager(Vpc client, ListVpcRoutingTablesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<RoutingTable> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListVpcRoutingTablesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + RoutingTableCollection result = client.listVpcRoutingTables(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getRoutingTables(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<RoutingTable> containing all results returned by the "listVpcRoutingTables" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcsPager.java new file mode 100644 index 0000000000..46715ce5d2 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * VpcsPager can be used to simplify the use of the "listVpcs" method. + */ +public class VpcsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListVpcsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected VpcsPager() { } + + /** + * Constructs a new VpcsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listVpcs" method + * @param options the ListVpcsOptions instance to be used to invoke the "listVpcs" method + */ + public VpcsPager(Vpc client, ListVpcsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<VPC> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListVpcsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + VPCCollection result = client.listVpcs(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getVpcs(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<VPC> containing all results returned by the "listVpcs" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnGatewaysPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnGatewaysPager.java new file mode 100644 index 0000000000..9d95929eb0 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnGatewaysPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * VpnGatewaysPager can be used to simplify the use of the "listVpnGateways" method. + */ +public class VpnGatewaysPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListVpnGatewaysOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected VpnGatewaysPager() { } + + /** + * Constructs a new VpnGatewaysPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listVpnGateways" method + * @param options the ListVpnGatewaysOptions instance to be used to invoke the "listVpnGateways" method + */ + public VpnGatewaysPager(Vpc client, ListVpnGatewaysOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<VPNGateway> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListVpnGatewaysOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + VPNGatewayCollection result = client.listVpnGateways(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getVpnGateways(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<VPNGateway> containing all results returned by the "listVpnGateways" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnServerClientsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnServerClientsPager.java new file mode 100644 index 0000000000..adbbb6a9f5 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnServerClientsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * VpnServerClientsPager can be used to simplify the use of the "listVpnServerClients" method. + */ +public class VpnServerClientsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListVpnServerClientsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected VpnServerClientsPager() { } + + /** + * Constructs a new VpnServerClientsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listVpnServerClients" method + * @param options the ListVpnServerClientsOptions instance to be used to invoke the "listVpnServerClients" method + */ + public VpnServerClientsPager(Vpc client, ListVpnServerClientsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<VPNServerClient> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListVpnServerClientsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + VPNServerClientCollection result = client.listVpnServerClients(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getClients(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<VPNServerClient> containing all results returned by the "listVpnServerClients" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnServerRoutesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnServerRoutesPager.java new file mode 100644 index 0000000000..a356145031 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnServerRoutesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * VpnServerRoutesPager can be used to simplify the use of the "listVpnServerRoutes" method. + */ +public class VpnServerRoutesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListVpnServerRoutesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected VpnServerRoutesPager() { } + + /** + * Constructs a new VpnServerRoutesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listVpnServerRoutes" method + * @param options the ListVpnServerRoutesOptions instance to be used to invoke the "listVpnServerRoutes" method + */ + public VpnServerRoutesPager(Vpc client, ListVpnServerRoutesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<VPNServerRoute> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListVpnServerRoutesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + VPNServerRouteCollection result = client.listVpnServerRoutes(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getRoutes(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<VPNServerRoute> containing all results returned by the "listVpnServerRoutes" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnServersPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnServersPager.java new file mode 100644 index 0000000000..85acc14478 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnServersPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * VpnServersPager can be used to simplify the use of the "listVpnServers" method. + */ +public class VpnServersPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListVpnServersOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected VpnServersPager() { } + + /** + * Constructs a new VpnServersPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listVpnServers" method + * @param options the ListVpnServersOptions instance to be used to invoke the "listVpnServers" method + */ + public VpnServersPager(Vpc client, ListVpnServersOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<VPNServer> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListVpnServersOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + VPNServerCollection result = client.listVpnServers(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getVpnServers(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<VPNServer> containing all results returned by the "listVpnServers" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Zone.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Zone.java index feca12a4bf..900198f1a3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Zone.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Zone.java @@ -36,6 +36,8 @@ public interface Status { protected RegionReference region; protected String status; + protected Zone() { } + /** * Gets the href. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneCollection.java index a7e75340fb..e18a42d3fc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneCollection.java @@ -23,6 +23,8 @@ public class ZoneCollection extends GenericModel { protected List zones; + protected ZoneCollection() { } + /** * Gets the zones. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneIdentity.java index cafd5dda07..0ee0bdaf3a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneIdentity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneIdentity.java @@ -26,8 +26,7 @@ public class ZoneIdentity extends GenericModel { protected String name; protected String href; - protected ZoneIdentity() { - } + protected ZoneIdentity() { } /** * Gets the name. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneIdentityByHref.java index 2a421c4ef2..c34a5f9142 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneIdentityByHref.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneIdentityByHref.java @@ -24,6 +24,11 @@ public class ZoneIdentityByHref extends ZoneIdentity { public static class Builder { private String href; + /** + * Instantiates a new Builder from an existing ZoneIdentityByHref instance. + * + * @param zoneIdentityByHref the instance to initialize the Builder with + */ public Builder(ZoneIdentity zoneIdentityByHref) { this.href = zoneIdentityByHref.href; } @@ -64,6 +69,8 @@ public Builder href(String href) { } } + protected ZoneIdentityByHref() { } + protected ZoneIdentityByHref(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, "href cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneIdentityByName.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneIdentityByName.java index dac8210888..5590bf1e6d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneIdentityByName.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneIdentityByName.java @@ -24,6 +24,11 @@ public class ZoneIdentityByName extends ZoneIdentity { public static class Builder { private String name; + /** + * Instantiates a new Builder from an existing ZoneIdentityByName instance. + * + * @param zoneIdentityByName the instance to initialize the Builder with + */ public Builder(ZoneIdentity zoneIdentityByName) { this.name = zoneIdentityByName.name; } @@ -64,6 +69,8 @@ public Builder name(String name) { } } + protected ZoneIdentityByName() { } + protected ZoneIdentityByName(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneReference.java index 1b1969523c..7666786683 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ZoneReference.java @@ -22,6 +22,8 @@ public class ZoneReference extends GenericModel { protected String href; protected String name; + protected ZoneReference() { } + /** * Gets the href. * diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcIT.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcIT.java index a26323a5b6..8d06b02423 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcIT.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcIT.java @@ -24,6 +24,7 @@ import com.ibm.cloud.is.vpc.v1.model.AddressPrefixCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.AddressPrefixCollectionNext; import com.ibm.cloud.is.vpc.v1.model.AddressPrefixPatch; +import com.ibm.cloud.is.vpc.v1.model.BackupPoliciesPager; import com.ibm.cloud.is.vpc.v1.model.BackupPolicy; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyCollection; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyCollectionFirst; @@ -55,6 +56,7 @@ import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationUserAccount; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterface; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceByHiperSocket; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceByPCI; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceByVLAN; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceCollection; @@ -62,8 +64,10 @@ import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceCollectionNext; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePatch; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototype; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacesPager; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerPatch; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerPrimaryNetworkInterfacePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfile; @@ -109,8 +113,15 @@ import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfileOSArchitecture; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfileReference; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfileSupportedTrustedPlatformModuleModes; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfilesPager; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerStatusReason; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerTrustedPlatformModule; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServersPager; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingIdentity; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingIdentityCatalogOfferingByCRN; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionIdentity; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionReference; import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceIdentity; import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceReference; @@ -185,6 +196,7 @@ import com.ibm.cloud.is.vpc.v1.model.DedicatedHostGroupPrototypeDedicatedHostByZoneContext; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostGroupReference; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostGroupReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.DedicatedHostGroupsPager; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostPatch; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostProfile; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostProfileCollection; @@ -215,11 +227,13 @@ import com.ibm.cloud.is.vpc.v1.model.DedicatedHostProfileVCPUEnum; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostProfileVCPUFixed; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostProfileVCPURange; +import com.ibm.cloud.is.vpc.v1.model.DedicatedHostProfilesPager; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostPrototype; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostPrototypeDedicatedHostByGroup; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostPrototypeDedicatedHostByZone; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostReference; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.DedicatedHostsPager; import com.ibm.cloud.is.vpc.v1.model.DefaultNetworkACL; import com.ibm.cloud.is.vpc.v1.model.DefaultRoutingTable; import com.ibm.cloud.is.vpc.v1.model.DefaultSecurityGroup; @@ -283,6 +297,7 @@ import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayCollection; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayCollectionNext; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayIpsPager; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayPatch; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayReservedIP; @@ -298,6 +313,7 @@ import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayTargetProviderCloudServiceReference; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayTargetProviderInfrastructureServiceReference; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewaysPager; import com.ibm.cloud.is.vpc.v1.model.FloatingIP; import com.ibm.cloud.is.vpc.v1.model.FloatingIPByTargetNetworkInterfaceIdentity; import com.ibm.cloud.is.vpc.v1.model.FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref; @@ -318,6 +334,7 @@ import com.ibm.cloud.is.vpc.v1.model.FloatingIPTargetPatchNetworkInterfaceIdentityById; import com.ibm.cloud.is.vpc.v1.model.FloatingIPTargetPublicGatewayReference; import com.ibm.cloud.is.vpc.v1.model.FloatingIPUnpaginatedCollection; +import com.ibm.cloud.is.vpc.v1.model.FloatingIpsPager; import com.ibm.cloud.is.vpc.v1.model.FlowLogCollector; import com.ibm.cloud.is.vpc.v1.model.FlowLogCollectorCollection; import com.ibm.cloud.is.vpc.v1.model.FlowLogCollectorCollectionFirst; @@ -344,12 +361,14 @@ import com.ibm.cloud.is.vpc.v1.model.FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.FlowLogCollectorTargetSubnetReference; import com.ibm.cloud.is.vpc.v1.model.FlowLogCollectorTargetVPCReference; +import com.ibm.cloud.is.vpc.v1.model.FlowLogCollectorsPager; import com.ibm.cloud.is.vpc.v1.model.GenericResourceReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.GetBackupPolicyOptions; import com.ibm.cloud.is.vpc.v1.model.GetBackupPolicyPlanOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerDiskOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerInitializationOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerNetworkInterfaceFloatingIpOptions; +import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerNetworkInterfaceIpOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerNetworkInterfaceOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerProfileOptions; @@ -434,7 +453,9 @@ import com.ibm.cloud.is.vpc.v1.model.IPsecPolicyPatch; import com.ibm.cloud.is.vpc.v1.model.IPsecPolicyReference; import com.ibm.cloud.is.vpc.v1.model.IPsecPolicyReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.IkePoliciesPager; import com.ibm.cloud.is.vpc.v1.model.Image; +import com.ibm.cloud.is.vpc.v1.model.ImageCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.ImageCollection; import com.ibm.cloud.is.vpc.v1.model.ImageCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.ImageCollectionNext; @@ -452,11 +473,16 @@ import com.ibm.cloud.is.vpc.v1.model.ImageReference; import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ImageStatusReason; +import com.ibm.cloud.is.vpc.v1.model.ImagesPager; import com.ibm.cloud.is.vpc.v1.model.Instance; import com.ibm.cloud.is.vpc.v1.model.InstanceAction; import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPolicy; import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPolicyPatch; import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOffering; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototypeCatalogOfferingByOffering; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototypeCatalogOfferingByVersion; import com.ibm.cloud.is.vpc.v1.model.InstanceCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.InstanceCollectionNext; @@ -493,11 +519,13 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionsCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionsCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionsCollectionNext; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionsPager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerAutoScale; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerCollectionNext; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerPatch; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerPoliciesPager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerPolicy; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerPolicyCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerPolicyCollectionFirst; @@ -522,20 +550,24 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagersPager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembership; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipCollectionNext; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipPatch; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipsPager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupPatch; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupReference; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupsPager; import com.ibm.cloud.is.vpc.v1.model.InstanceInitialization; import com.ibm.cloud.is.vpc.v1.model.InstanceInitializationDefaultTrustedProfile; import com.ibm.cloud.is.vpc.v1.model.InstanceInitializationPassword; import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataService; import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePatch; import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceNetworkInterfaceIpsPager; import com.ibm.cloud.is.vpc.v1.model.InstancePatch; import com.ibm.cloud.is.vpc.v1.model.InstancePatchProfile; import com.ibm.cloud.is.vpc.v1.model.InstancePatchProfileInstanceProfileIdentityByHref; @@ -622,6 +654,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthFixed; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthRange; import com.ibm.cloud.is.vpc.v1.model.InstancePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByImage; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceBySourceTemplate; @@ -636,15 +669,20 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityById; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImage; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePatch; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceByCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceByImage; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceBySourceTemplate; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateReference; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.InstanceVCPU; +import com.ibm.cloud.is.vpc.v1.model.InstancesPager; +import com.ibm.cloud.is.vpc.v1.model.IpsecPoliciesPager; import com.ibm.cloud.is.vpc.v1.model.Key; import com.ibm.cloud.is.vpc.v1.model.KeyCollection; import com.ibm.cloud.is.vpc.v1.model.KeyCollectionFirst; @@ -657,13 +695,16 @@ import com.ibm.cloud.is.vpc.v1.model.KeyPatch; import com.ibm.cloud.is.vpc.v1.model.KeyReference; import com.ibm.cloud.is.vpc.v1.model.KeyReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.KeysPager; import com.ibm.cloud.is.vpc.v1.model.LegacyCloudObjectStorageBucketIdentity; import com.ibm.cloud.is.vpc.v1.model.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName; import com.ibm.cloud.is.vpc.v1.model.LegacyCloudObjectStorageBucketReference; +import com.ibm.cloud.is.vpc.v1.model.LifecycleReason; import com.ibm.cloud.is.vpc.v1.model.ListBackupPoliciesOptions; import com.ibm.cloud.is.vpc.v1.model.ListBackupPolicyPlansOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerDisksOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerNetworkInterfaceFloatingIpsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerNetworkInterfaceIpsOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerNetworkInterfacesOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServersOptions; @@ -829,8 +870,10 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupported; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupportedDependent; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupportedFixed; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfilesPager; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerStatistics; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancersPager; import com.ibm.cloud.is.vpc.v1.model.NetworkACL; import com.ibm.cloud.is.vpc.v1.model.NetworkACLCollection; import com.ibm.cloud.is.vpc.v1.model.NetworkACLCollectionFirst; @@ -865,14 +908,16 @@ import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePatch; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContext; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolAll; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolICMP; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.NetworkAclRulesPager; +import com.ibm.cloud.is.vpc.v1.model.NetworkAclsPager; import com.ibm.cloud.is.vpc.v1.model.NetworkInterface; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceBareMetalServerContextReference; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceBareMetalServerContextReferenceDeleted; @@ -896,12 +941,14 @@ import com.ibm.cloud.is.vpc.v1.model.OperatingSystemIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemIdentityByName; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemReference; +import com.ibm.cloud.is.vpc.v1.model.OperatingSystemsPager; import com.ibm.cloud.is.vpc.v1.model.PlacementGroup; import com.ibm.cloud.is.vpc.v1.model.PlacementGroupCollection; import com.ibm.cloud.is.vpc.v1.model.PlacementGroupCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.PlacementGroupCollectionNext; import com.ibm.cloud.is.vpc.v1.model.PlacementGroupPatch; import com.ibm.cloud.is.vpc.v1.model.PlacementGroupReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.PlacementGroupsPager; import com.ibm.cloud.is.vpc.v1.model.PublicGateway; import com.ibm.cloud.is.vpc.v1.model.PublicGatewayCollection; import com.ibm.cloud.is.vpc.v1.model.PublicGatewayCollectionFirst; @@ -921,6 +968,7 @@ import com.ibm.cloud.is.vpc.v1.model.PublicGatewayPatch; import com.ibm.cloud.is.vpc.v1.model.PublicGatewayReference; import com.ibm.cloud.is.vpc.v1.model.PublicGatewayReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.PublicGatewaysPager; import com.ibm.cloud.is.vpc.v1.model.Region; import com.ibm.cloud.is.vpc.v1.model.RegionCollection; import com.ibm.cloud.is.vpc.v1.model.RegionReference; @@ -1038,6 +1086,8 @@ import com.ibm.cloud.is.vpc.v1.model.SecurityGroupTargetReferenceLoadBalancerReference; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupTargetReferenceVPNServerReference; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupTargetsPager; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupsPager; import com.ibm.cloud.is.vpc.v1.model.SetSubnetPublicGatewayOptions; import com.ibm.cloud.is.vpc.v1.model.Snapshot; import com.ibm.cloud.is.vpc.v1.model.SnapshotCollection; @@ -1052,6 +1102,7 @@ import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototypeSnapshotBySourceVolume; import com.ibm.cloud.is.vpc.v1.model.SnapshotReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SnapshotsPager; import com.ibm.cloud.is.vpc.v1.model.StartBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.StopBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.Subnet; @@ -1072,6 +1123,8 @@ import com.ibm.cloud.is.vpc.v1.model.SubnetPublicGatewayPatchPublicGatewayIdentityById; import com.ibm.cloud.is.vpc.v1.model.SubnetReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SubnetReservedIpsPager; +import com.ibm.cloud.is.vpc.v1.model.SubnetsPager; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentity; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityTrustedProfileByCRN; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityTrustedProfileById; @@ -1248,6 +1301,7 @@ import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileReference; +import com.ibm.cloud.is.vpc.v1.model.VolumeProfilesPager; import com.ibm.cloud.is.vpc.v1.model.VolumePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeInstanceBySourceSnapshotContext; @@ -1256,6 +1310,16 @@ import com.ibm.cloud.is.vpc.v1.model.VolumeReference; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.VolumeStatusReason; +import com.ibm.cloud.is.vpc.v1.model.VolumesPager; +import com.ibm.cloud.is.vpc.v1.model.VpcAddressPrefixesPager; +import com.ibm.cloud.is.vpc.v1.model.VpcRoutesPager; +import com.ibm.cloud.is.vpc.v1.model.VpcRoutingTableRoutesPager; +import com.ibm.cloud.is.vpc.v1.model.VpcRoutingTablesPager; +import com.ibm.cloud.is.vpc.v1.model.VpcsPager; +import com.ibm.cloud.is.vpc.v1.model.VpnGatewaysPager; +import com.ibm.cloud.is.vpc.v1.model.VpnServerClientsPager; +import com.ibm.cloud.is.vpc.v1.model.VpnServerRoutesPager; +import com.ibm.cloud.is.vpc.v1.model.VpnServersPager; import com.ibm.cloud.is.vpc.v1.model.Zone; import com.ibm.cloud.is.vpc.v1.model.ZoneCollection; import com.ibm.cloud.is.vpc.v1.model.ZoneIdentity; @@ -1270,7 +1334,6 @@ import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -1323,11 +1386,11 @@ public void constructService() { public void testListVpcs() throws Exception { try { ListVpcsOptions listVpcsOptions = new ListVpcsOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .classicAccess(true) - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .classicAccess(true) + .build(); // Invoke operation Response response = service.listVpcs(listVpcsOptions).execute(); @@ -1344,19 +1407,52 @@ public void testListVpcs() throws Exception { } } + @Test(dependsOnMethods = { "testListVpcs" }) + public void testListVpcsWithPager() throws Exception { + try { + ListVpcsOptions options = new ListVpcsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .classicAccess(true) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + VpcsPager pager = new VpcsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new VpcsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateVpc() throws Exception { try { ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); CreateVpcOptions createVpcOptions = new CreateVpcOptions.Builder() - .addressPrefixManagement("manual") - .classicAccess(false) - .name("my-vpc") - .resourceGroup(resourceGroupIdentityModel) - .build(); + .addressPrefixManagement("manual") + .classicAccess(false) + .name("my-vpc") + .resourceGroup(resourceGroupIdentityModel) + .build(); // Invoke operation Response response = service.createVpc(createVpcOptions).execute(); @@ -1367,15 +1463,6 @@ public void testCreateVpc() throws Exception { VPC vpcResult = response.getResult(); assertNotNull(vpcResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1386,8 +1473,8 @@ public void testCreateVpc() throws Exception { public void testGetVpc() throws Exception { try { GetVpcOptions getVpcOptions = new GetVpcOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getVpc(getVpcOptions).execute(); @@ -1398,15 +1485,6 @@ public void testGetVpc() throws Exception { VPC vpcResult = response.getResult(); assertNotNull(vpcResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1417,14 +1495,14 @@ public void testGetVpc() throws Exception { public void testUpdateVpc() throws Exception { try { VPCPatch vpcPatchModel = new VPCPatch.Builder() - .name("my-vpc") - .build(); + .name("my-vpc") + .build(); Map vpcPatchModelAsPatch = vpcPatchModel.asPatch(); UpdateVpcOptions updateVpcOptions = new UpdateVpcOptions.Builder() - .id("testString") - .vpcPatch(vpcPatchModelAsPatch) - .build(); + .id("testString") + .vpcPatch(vpcPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateVpc(updateVpcOptions).execute(); @@ -1435,16 +1513,6 @@ public void testUpdateVpc() throws Exception { VPC vpcResult = response.getResult(); assertNotNull(vpcResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1455,8 +1523,8 @@ public void testUpdateVpc() throws Exception { public void testGetVpcDefaultNetworkAcl() throws Exception { try { GetVpcDefaultNetworkAclOptions getVpcDefaultNetworkAclOptions = new GetVpcDefaultNetworkAclOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getVpcDefaultNetworkAcl(getVpcDefaultNetworkAclOptions).execute(); @@ -1467,15 +1535,6 @@ public void testGetVpcDefaultNetworkAcl() throws Exception { DefaultNetworkACL defaultNetworkAclResult = response.getResult(); assertNotNull(defaultNetworkAclResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1486,8 +1545,8 @@ public void testGetVpcDefaultNetworkAcl() throws Exception { public void testGetVpcDefaultRoutingTable() throws Exception { try { GetVpcDefaultRoutingTableOptions getVpcDefaultRoutingTableOptions = new GetVpcDefaultRoutingTableOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getVpcDefaultRoutingTable(getVpcDefaultRoutingTableOptions).execute(); @@ -1498,15 +1557,6 @@ public void testGetVpcDefaultRoutingTable() throws Exception { DefaultRoutingTable defaultRoutingTableResult = response.getResult(); assertNotNull(defaultRoutingTableResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1517,8 +1567,8 @@ public void testGetVpcDefaultRoutingTable() throws Exception { public void testGetVpcDefaultSecurityGroup() throws Exception { try { GetVpcDefaultSecurityGroupOptions getVpcDefaultSecurityGroupOptions = new GetVpcDefaultSecurityGroupOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getVpcDefaultSecurityGroup(getVpcDefaultSecurityGroupOptions).execute(); @@ -1529,15 +1579,6 @@ public void testGetVpcDefaultSecurityGroup() throws Exception { DefaultSecurityGroup defaultSecurityGroupResult = response.getResult(); assertNotNull(defaultSecurityGroupResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1548,10 +1589,10 @@ public void testGetVpcDefaultSecurityGroup() throws Exception { public void testListVpcAddressPrefixes() throws Exception { try { ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptions = new ListVpcAddressPrefixesOptions.Builder() - .vpcId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .vpcId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listVpcAddressPrefixes(listVpcAddressPrefixesOptions).execute(); @@ -1562,15 +1603,38 @@ public void testListVpcAddressPrefixes() throws Exception { AddressPrefixCollection addressPrefixCollectionResult = response.getResult(); assertNotNull(addressPrefixCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListVpcAddressPrefixes" }) + public void testListVpcAddressPrefixesWithPager() throws Exception { + try { + ListVpcAddressPrefixesOptions options = new ListVpcAddressPrefixesOptions.Builder() + .vpcId("testString") + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + VpcAddressPrefixesPager pager = new VpcAddressPrefixesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + // Test getAll(); + pager = new VpcAddressPrefixesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1581,16 +1645,16 @@ public void testListVpcAddressPrefixes() throws Exception { public void testCreateVpcAddressPrefix() throws Exception { try { ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); + .name("us-south-1") + .build(); CreateVpcAddressPrefixOptions createVpcAddressPrefixOptions = new CreateVpcAddressPrefixOptions.Builder() - .vpcId("testString") - .cidr("10.0.0.0/24") - .zone(zoneIdentityModel) - .isDefault(true) - .name("my-address-prefix-2") - .build(); + .vpcId("testString") + .cidr("10.0.0.0/24") + .zone(zoneIdentityModel) + .isDefault(true) + .name("my-address-prefix-2") + .build(); // Invoke operation Response response = service.createVpcAddressPrefix(createVpcAddressPrefixOptions).execute(); @@ -1601,17 +1665,6 @@ public void testCreateVpcAddressPrefix() throws Exception { AddressPrefix addressPrefixResult = response.getResult(); assertNotNull(addressPrefixResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1622,9 +1675,9 @@ public void testCreateVpcAddressPrefix() throws Exception { public void testGetVpcAddressPrefix() throws Exception { try { GetVpcAddressPrefixOptions getVpcAddressPrefixOptions = new GetVpcAddressPrefixOptions.Builder() - .vpcId("testString") - .id("testString") - .build(); + .vpcId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getVpcAddressPrefix(getVpcAddressPrefixOptions).execute(); @@ -1635,15 +1688,6 @@ public void testGetVpcAddressPrefix() throws Exception { AddressPrefix addressPrefixResult = response.getResult(); assertNotNull(addressPrefixResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1654,16 +1698,16 @@ public void testGetVpcAddressPrefix() throws Exception { public void testUpdateVpcAddressPrefix() throws Exception { try { AddressPrefixPatch addressPrefixPatchModel = new AddressPrefixPatch.Builder() - .isDefault(false) - .name("my-address-prefix-2") - .build(); + .isDefault(false) + .name("my-address-prefix-2") + .build(); Map addressPrefixPatchModelAsPatch = addressPrefixPatchModel.asPatch(); UpdateVpcAddressPrefixOptions updateVpcAddressPrefixOptions = new UpdateVpcAddressPrefixOptions.Builder() - .vpcId("testString") - .id("testString") - .addressPrefixPatch(addressPrefixPatchModelAsPatch) - .build(); + .vpcId("testString") + .id("testString") + .addressPrefixPatch(addressPrefixPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateVpcAddressPrefix(updateVpcAddressPrefixOptions).execute(); @@ -1674,17 +1718,6 @@ public void testUpdateVpcAddressPrefix() throws Exception { AddressPrefix addressPrefixResult = response.getResult(); assertNotNull(addressPrefixResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1695,11 +1728,11 @@ public void testUpdateVpcAddressPrefix() throws Exception { public void testListVpcRoutes() throws Exception { try { ListVpcRoutesOptions listVpcRoutesOptions = new ListVpcRoutesOptions.Builder() - .vpcId("testString") - .zoneName("testString") - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .vpcId("testString") + .zoneName("testString") + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listVpcRoutes(listVpcRoutesOptions).execute(); @@ -1710,15 +1743,39 @@ public void testListVpcRoutes() throws Exception { RouteCollection routeCollectionResult = response.getResult(); assertNotNull(routeCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListVpcRoutes" }) + public void testListVpcRoutesWithPager() throws Exception { + try { + ListVpcRoutesOptions options = new ListVpcRoutesOptions.Builder() + .vpcId("testString") + .zoneName("testString") + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + VpcRoutesPager pager = new VpcRoutesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + // Test getAll(); + pager = new VpcRoutesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1729,21 +1786,21 @@ public void testListVpcRoutes() throws Exception { public void testCreateVpcRoute() throws Exception { try { ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); + .name("us-south-1") + .build(); RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP routePrototypeNextHopModel = new RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP.Builder() - .address("192.168.3.4") - .build(); + .address("192.168.3.4") + .build(); CreateVpcRouteOptions createVpcRouteOptions = new CreateVpcRouteOptions.Builder() - .vpcId("testString") - .destination("192.168.3.0/24") - .zone(zoneIdentityModel) - .action("deliver") - .name("my-route-1") - .nextHop(routePrototypeNextHopModel) - .build(); + .vpcId("testString") + .destination("192.168.3.0/24") + .zone(zoneIdentityModel) + .action("deliver") + .name("my-route-1") + .nextHop(routePrototypeNextHopModel) + .build(); // Invoke operation Response response = service.createVpcRoute(createVpcRouteOptions).execute(); @@ -1754,17 +1811,6 @@ public void testCreateVpcRoute() throws Exception { Route routeResult = response.getResult(); assertNotNull(routeResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1775,9 +1821,9 @@ public void testCreateVpcRoute() throws Exception { public void testGetVpcRoute() throws Exception { try { GetVpcRouteOptions getVpcRouteOptions = new GetVpcRouteOptions.Builder() - .vpcId("testString") - .id("testString") - .build(); + .vpcId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getVpcRoute(getVpcRouteOptions).execute(); @@ -1788,15 +1834,6 @@ public void testGetVpcRoute() throws Exception { Route routeResult = response.getResult(); assertNotNull(routeResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1807,15 +1844,15 @@ public void testGetVpcRoute() throws Exception { public void testUpdateVpcRoute() throws Exception { try { RoutePatch routePatchModel = new RoutePatch.Builder() - .name("my-route-2") - .build(); + .name("my-route-2") + .build(); Map routePatchModelAsPatch = routePatchModel.asPatch(); UpdateVpcRouteOptions updateVpcRouteOptions = new UpdateVpcRouteOptions.Builder() - .vpcId("testString") - .id("testString") - .routePatch(routePatchModelAsPatch) - .build(); + .vpcId("testString") + .id("testString") + .routePatch(routePatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateVpcRoute(updateVpcRouteOptions).execute(); @@ -1826,17 +1863,6 @@ public void testUpdateVpcRoute() throws Exception { Route routeResult = response.getResult(); assertNotNull(routeResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1847,11 +1873,11 @@ public void testUpdateVpcRoute() throws Exception { public void testListVpcRoutingTables() throws Exception { try { ListVpcRoutingTablesOptions listVpcRoutingTablesOptions = new ListVpcRoutingTablesOptions.Builder() - .vpcId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .isDefault(true) - .build(); + .vpcId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .isDefault(true) + .build(); // Invoke operation Response response = service.listVpcRoutingTables(listVpcRoutingTablesOptions).execute(); @@ -1862,15 +1888,39 @@ public void testListVpcRoutingTables() throws Exception { RoutingTableCollection routingTableCollectionResult = response.getResult(); assertNotNull(routingTableCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListVpcRoutingTables" }) + public void testListVpcRoutingTablesWithPager() throws Exception { + try { + ListVpcRoutingTablesOptions options = new ListVpcRoutingTablesOptions.Builder() + .vpcId("testString") + .limit(Long.valueOf("10")) + .isDefault(true) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + VpcRoutingTablesPager pager = new VpcRoutingTablesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + // Test getAll(); + pager = new VpcRoutingTablesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1881,34 +1931,34 @@ public void testListVpcRoutingTables() throws Exception { public void testCreateVpcRoutingTable() throws Exception { try { ResourceFilter resourceFilterModel = new ResourceFilter.Builder() - .resourceType("vpn_server") - .build(); + .resourceType("vpn_server") + .build(); RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP routePrototypeNextHopModel = new RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP.Builder() - .address("192.168.3.4") - .build(); + .address("192.168.3.4") + .build(); ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); + .name("us-south-1") + .build(); RoutePrototype routePrototypeModel = new RoutePrototype.Builder() - .action("deliver") - .destination("192.168.3.0/24") - .name("my-route-1") - .nextHop(routePrototypeNextHopModel) - .zone(zoneIdentityModel) - .build(); + .action("deliver") + .destination("192.168.3.0/24") + .name("my-route-1") + .nextHop(routePrototypeNextHopModel) + .zone(zoneIdentityModel) + .build(); CreateVpcRoutingTableOptions createVpcRoutingTableOptions = new CreateVpcRoutingTableOptions.Builder() - .vpcId("testString") - .acceptRoutesFrom(new java.util.ArrayList(java.util.Arrays.asList(resourceFilterModel))) - .name("my-routing-table-2") - .routeDirectLinkIngress(false) - .routeTransitGatewayIngress(false) - .routeVpcZoneIngress(false) - .routes(new java.util.ArrayList(java.util.Arrays.asList(routePrototypeModel))) - .build(); + .vpcId("testString") + .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) + .name("my-routing-table-2") + .routeDirectLinkIngress(false) + .routeTransitGatewayIngress(false) + .routeVpcZoneIngress(false) + .routes(java.util.Arrays.asList(routePrototypeModel)) + .build(); // Invoke operation Response response = service.createVpcRoutingTable(createVpcRoutingTableOptions).execute(); @@ -1919,16 +1969,6 @@ public void testCreateVpcRoutingTable() throws Exception { RoutingTable routingTableResult = response.getResult(); assertNotNull(routingTableResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1939,9 +1979,9 @@ public void testCreateVpcRoutingTable() throws Exception { public void testGetVpcRoutingTable() throws Exception { try { GetVpcRoutingTableOptions getVpcRoutingTableOptions = new GetVpcRoutingTableOptions.Builder() - .vpcId("testString") - .id("testString") - .build(); + .vpcId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getVpcRoutingTable(getVpcRoutingTableOptions).execute(); @@ -1952,15 +1992,6 @@ public void testGetVpcRoutingTable() throws Exception { RoutingTable routingTableResult = response.getResult(); assertNotNull(routingTableResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1971,24 +2002,24 @@ public void testGetVpcRoutingTable() throws Exception { public void testUpdateVpcRoutingTable() throws Exception { try { ResourceFilter resourceFilterModel = new ResourceFilter.Builder() - .resourceType("vpn_server") - .build(); + .resourceType("vpn_server") + .build(); RoutingTablePatch routingTablePatchModel = new RoutingTablePatch.Builder() - .acceptRoutesFrom(new java.util.ArrayList(java.util.Arrays.asList(resourceFilterModel))) - .name("my-routing-table-2") - .routeDirectLinkIngress(true) - .routeTransitGatewayIngress(true) - .routeVpcZoneIngress(true) - .build(); + .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) + .name("my-routing-table-2") + .routeDirectLinkIngress(true) + .routeTransitGatewayIngress(true) + .routeVpcZoneIngress(true) + .build(); Map routingTablePatchModelAsPatch = routingTablePatchModel.asPatch(); UpdateVpcRoutingTableOptions updateVpcRoutingTableOptions = new UpdateVpcRoutingTableOptions.Builder() - .vpcId("testString") - .id("testString") - .routingTablePatch(routingTablePatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") - .build(); + .vpcId("testString") + .id("testString") + .routingTablePatch(routingTablePatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.updateVpcRoutingTable(updateVpcRoutingTableOptions).execute(); @@ -1999,18 +2030,6 @@ public void testUpdateVpcRoutingTable() throws Exception { RoutingTable routingTableResult = response.getResult(); assertNotNull(routingTableResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // 412 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2021,11 +2040,11 @@ public void testUpdateVpcRoutingTable() throws Exception { public void testListVpcRoutingTableRoutes() throws Exception { try { ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptions = new ListVpcRoutingTableRoutesOptions.Builder() - .vpcId("testString") - .routingTableId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .vpcId("testString") + .routingTableId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listVpcRoutingTableRoutes(listVpcRoutingTableRoutesOptions).execute(); @@ -2036,15 +2055,39 @@ public void testListVpcRoutingTableRoutes() throws Exception { RouteCollection routeCollectionResult = response.getResult(); assertNotNull(routeCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListVpcRoutingTableRoutes" }) + public void testListVpcRoutingTableRoutesWithPager() throws Exception { + try { + ListVpcRoutingTableRoutesOptions options = new ListVpcRoutingTableRoutesOptions.Builder() + .vpcId("testString") + .routingTableId("testString") + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + VpcRoutingTableRoutesPager pager = new VpcRoutingTableRoutesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + // Test getAll(); + pager = new VpcRoutingTableRoutesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2055,22 +2098,22 @@ public void testListVpcRoutingTableRoutes() throws Exception { public void testCreateVpcRoutingTableRoute() throws Exception { try { ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); + .name("us-south-1") + .build(); RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP routePrototypeNextHopModel = new RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP.Builder() - .address("192.168.3.4") - .build(); + .address("192.168.3.4") + .build(); CreateVpcRoutingTableRouteOptions createVpcRoutingTableRouteOptions = new CreateVpcRoutingTableRouteOptions.Builder() - .vpcId("testString") - .routingTableId("testString") - .destination("192.168.3.0/24") - .zone(zoneIdentityModel) - .action("deliver") - .name("my-route-1") - .nextHop(routePrototypeNextHopModel) - .build(); + .vpcId("testString") + .routingTableId("testString") + .destination("192.168.3.0/24") + .zone(zoneIdentityModel) + .action("deliver") + .name("my-route-1") + .nextHop(routePrototypeNextHopModel) + .build(); // Invoke operation Response response = service.createVpcRoutingTableRoute(createVpcRoutingTableRouteOptions).execute(); @@ -2081,16 +2124,6 @@ public void testCreateVpcRoutingTableRoute() throws Exception { Route routeResult = response.getResult(); assertNotNull(routeResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2101,10 +2134,10 @@ public void testCreateVpcRoutingTableRoute() throws Exception { public void testGetVpcRoutingTableRoute() throws Exception { try { GetVpcRoutingTableRouteOptions getVpcRoutingTableRouteOptions = new GetVpcRoutingTableRouteOptions.Builder() - .vpcId("testString") - .routingTableId("testString") - .id("testString") - .build(); + .vpcId("testString") + .routingTableId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getVpcRoutingTableRoute(getVpcRoutingTableRouteOptions).execute(); @@ -2115,15 +2148,6 @@ public void testGetVpcRoutingTableRoute() throws Exception { Route routeResult = response.getResult(); assertNotNull(routeResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2134,16 +2158,16 @@ public void testGetVpcRoutingTableRoute() throws Exception { public void testUpdateVpcRoutingTableRoute() throws Exception { try { RoutePatch routePatchModel = new RoutePatch.Builder() - .name("my-route-2") - .build(); + .name("my-route-2") + .build(); Map routePatchModelAsPatch = routePatchModel.asPatch(); UpdateVpcRoutingTableRouteOptions updateVpcRoutingTableRouteOptions = new UpdateVpcRoutingTableRouteOptions.Builder() - .vpcId("testString") - .routingTableId("testString") - .id("testString") - .routePatch(routePatchModelAsPatch) - .build(); + .vpcId("testString") + .routingTableId("testString") + .id("testString") + .routePatch(routePatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateVpcRoutingTableRoute(updateVpcRoutingTableRouteOptions).execute(); @@ -2154,17 +2178,6 @@ public void testUpdateVpcRoutingTableRoute() throws Exception { Route routeResult = response.getResult(); assertNotNull(routeResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2175,12 +2188,12 @@ public void testUpdateVpcRoutingTableRoute() throws Exception { public void testListSubnets() throws Exception { try { ListSubnetsOptions listSubnetsOptions = new ListSubnetsOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .routingTableId("testString") - .routingTableName("testString") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .routingTableId("testString") + .routingTableName("testString") + .build(); // Invoke operation Response response = service.listSubnets(listSubnetsOptions).execute(); @@ -2197,48 +2210,82 @@ public void testListSubnets() throws Exception { } } + @Test(dependsOnMethods = { "testListSubnets" }) + public void testListSubnetsWithPager() throws Exception { + try { + ListSubnetsOptions options = new ListSubnetsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .routingTableId("testString") + .routingTableName("testString") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + SubnetsPager pager = new SubnetsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new SubnetsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateSubnet() throws Exception { try { NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() - .id("a4e28308-8ee7-46ab-8108-9f881f22bdbf") - .build(); + .id("a4e28308-8ee7-46ab-8108-9f881f22bdbf") + .build(); PublicGatewayIdentityPublicGatewayIdentityById publicGatewayIdentityModel = new PublicGatewayIdentityPublicGatewayIdentityById.Builder() - .id("dc5431ef-1fc6-4861-adc9-a59d077d1241") - .build(); + .id("dc5431ef-1fc6-4861-adc9-a59d077d1241") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); RoutingTableIdentityById routingTableIdentityModel = new RoutingTableIdentityById.Builder() - .id("6885e83f-03b2-4603-8a86-db2a0f55c840") - .build(); + .id("6885e83f-03b2-4603-8a86-db2a0f55c840") + .build(); VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); + .id("4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); + .name("us-south-1") + .build(); SubnetPrototypeSubnetByTotalCount subnetPrototypeModel = new SubnetPrototypeSubnetByTotalCount.Builder() - .ipVersion("ipv4") - .name("my-subnet") - .networkAcl(networkAclIdentityModel) - .publicGateway(publicGatewayIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .routingTable(routingTableIdentityModel) - .vpc(vpcIdentityModel) - .totalIpv4AddressCount(Long.valueOf("256")) - .zone(zoneIdentityModel) - .build(); + .ipVersion("ipv4") + .name("my-subnet") + .networkAcl(networkAclIdentityModel) + .publicGateway(publicGatewayIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .routingTable(routingTableIdentityModel) + .vpc(vpcIdentityModel) + .totalIpv4AddressCount(Long.valueOf("256")) + .zone(zoneIdentityModel) + .build(); CreateSubnetOptions createSubnetOptions = new CreateSubnetOptions.Builder() - .subnetPrototype(subnetPrototypeModel) - .build(); + .subnetPrototype(subnetPrototypeModel) + .build(); // Invoke operation Response response = service.createSubnet(createSubnetOptions).execute(); @@ -2249,16 +2296,6 @@ public void testCreateSubnet() throws Exception { Subnet subnetResult = response.getResult(); assertNotNull(subnetResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2269,8 +2306,8 @@ public void testCreateSubnet() throws Exception { public void testGetSubnet() throws Exception { try { GetSubnetOptions getSubnetOptions = new GetSubnetOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getSubnet(getSubnetOptions).execute(); @@ -2281,15 +2318,6 @@ public void testGetSubnet() throws Exception { Subnet subnetResult = response.getResult(); assertNotNull(subnetResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2300,29 +2328,29 @@ public void testGetSubnet() throws Exception { public void testUpdateSubnet() throws Exception { try { NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() - .id("a4e28308-8ee7-46ab-8108-9f881f22bdbf") - .build(); + .id("a4e28308-8ee7-46ab-8108-9f881f22bdbf") + .build(); SubnetPublicGatewayPatchPublicGatewayIdentityById subnetPublicGatewayPatchModel = new SubnetPublicGatewayPatchPublicGatewayIdentityById.Builder() - .id("dc5431ef-1fc6-4861-adc9-a59d077d1241") - .build(); + .id("dc5431ef-1fc6-4861-adc9-a59d077d1241") + .build(); RoutingTableIdentityById routingTableIdentityModel = new RoutingTableIdentityById.Builder() - .id("6885e83f-03b2-4603-8a86-db2a0f55c840") - .build(); + .id("6885e83f-03b2-4603-8a86-db2a0f55c840") + .build(); SubnetPatch subnetPatchModel = new SubnetPatch.Builder() - .name("my-subnet") - .networkAcl(networkAclIdentityModel) - .publicGateway(subnetPublicGatewayPatchModel) - .routingTable(routingTableIdentityModel) - .build(); + .name("my-subnet") + .networkAcl(networkAclIdentityModel) + .publicGateway(subnetPublicGatewayPatchModel) + .routingTable(routingTableIdentityModel) + .build(); Map subnetPatchModelAsPatch = subnetPatchModel.asPatch(); UpdateSubnetOptions updateSubnetOptions = new UpdateSubnetOptions.Builder() - .id("testString") - .subnetPatch(subnetPatchModelAsPatch) - .build(); + .id("testString") + .subnetPatch(subnetPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateSubnet(updateSubnetOptions).execute(); @@ -2333,16 +2361,6 @@ public void testUpdateSubnet() throws Exception { Subnet subnetResult = response.getResult(); assertNotNull(subnetResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2353,8 +2371,8 @@ public void testUpdateSubnet() throws Exception { public void testGetSubnetNetworkAcl() throws Exception { try { GetSubnetNetworkAclOptions getSubnetNetworkAclOptions = new GetSubnetNetworkAclOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getSubnetNetworkAcl(getSubnetNetworkAclOptions).execute(); @@ -2365,15 +2383,6 @@ public void testGetSubnetNetworkAcl() throws Exception { NetworkACL networkAclResult = response.getResult(); assertNotNull(networkAclResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2384,13 +2393,13 @@ public void testGetSubnetNetworkAcl() throws Exception { public void testReplaceSubnetNetworkAcl() throws Exception { try { NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() - .id("a4e28308-8ee7-46ab-8108-9f881f22bdbf") - .build(); + .id("a4e28308-8ee7-46ab-8108-9f881f22bdbf") + .build(); ReplaceSubnetNetworkAclOptions replaceSubnetNetworkAclOptions = new ReplaceSubnetNetworkAclOptions.Builder() - .id("testString") - .networkAclIdentity(networkAclIdentityModel) - .build(); + .id("testString") + .networkAclIdentity(networkAclIdentityModel) + .build(); // Invoke operation Response response = service.replaceSubnetNetworkAcl(replaceSubnetNetworkAclOptions).execute(); @@ -2401,16 +2410,6 @@ public void testReplaceSubnetNetworkAcl() throws Exception { NetworkACL networkAclResult = response.getResult(); assertNotNull(networkAclResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2421,8 +2420,8 @@ public void testReplaceSubnetNetworkAcl() throws Exception { public void testGetSubnetPublicGateway() throws Exception { try { GetSubnetPublicGatewayOptions getSubnetPublicGatewayOptions = new GetSubnetPublicGatewayOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getSubnetPublicGateway(getSubnetPublicGatewayOptions).execute(); @@ -2433,15 +2432,6 @@ public void testGetSubnetPublicGateway() throws Exception { PublicGateway publicGatewayResult = response.getResult(); assertNotNull(publicGatewayResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2452,13 +2442,13 @@ public void testGetSubnetPublicGateway() throws Exception { public void testSetSubnetPublicGateway() throws Exception { try { PublicGatewayIdentityPublicGatewayIdentityById publicGatewayIdentityModel = new PublicGatewayIdentityPublicGatewayIdentityById.Builder() - .id("dc5431ef-1fc6-4861-adc9-a59d077d1241") - .build(); + .id("dc5431ef-1fc6-4861-adc9-a59d077d1241") + .build(); SetSubnetPublicGatewayOptions setSubnetPublicGatewayOptions = new SetSubnetPublicGatewayOptions.Builder() - .id("testString") - .publicGatewayIdentity(publicGatewayIdentityModel) - .build(); + .id("testString") + .publicGatewayIdentity(publicGatewayIdentityModel) + .build(); // Invoke operation Response response = service.setSubnetPublicGateway(setSubnetPublicGatewayOptions).execute(); @@ -2469,16 +2459,6 @@ public void testSetSubnetPublicGateway() throws Exception { PublicGateway publicGatewayResult = response.getResult(); assertNotNull(publicGatewayResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2489,8 +2469,8 @@ public void testSetSubnetPublicGateway() throws Exception { public void testGetSubnetRoutingTable() throws Exception { try { GetSubnetRoutingTableOptions getSubnetRoutingTableOptions = new GetSubnetRoutingTableOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getSubnetRoutingTable(getSubnetRoutingTableOptions).execute(); @@ -2501,15 +2481,6 @@ public void testGetSubnetRoutingTable() throws Exception { RoutingTable routingTableResult = response.getResult(); assertNotNull(routingTableResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2520,13 +2491,13 @@ public void testGetSubnetRoutingTable() throws Exception { public void testReplaceSubnetRoutingTable() throws Exception { try { RoutingTableIdentityById routingTableIdentityModel = new RoutingTableIdentityById.Builder() - .id("1a15dca5-7e33-45e1-b7c5-bc690e569531") - .build(); + .id("1a15dca5-7e33-45e1-b7c5-bc690e569531") + .build(); ReplaceSubnetRoutingTableOptions replaceSubnetRoutingTableOptions = new ReplaceSubnetRoutingTableOptions.Builder() - .id("testString") - .routingTableIdentity(routingTableIdentityModel) - .build(); + .id("testString") + .routingTableIdentity(routingTableIdentityModel) + .build(); // Invoke operation Response response = service.replaceSubnetRoutingTable(replaceSubnetRoutingTableOptions).execute(); @@ -2537,16 +2508,6 @@ public void testReplaceSubnetRoutingTable() throws Exception { RoutingTable routingTableResult = response.getResult(); assertNotNull(routingTableResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2557,11 +2518,11 @@ public void testReplaceSubnetRoutingTable() throws Exception { public void testListSubnetReservedIps() throws Exception { try { ListSubnetReservedIpsOptions listSubnetReservedIpsOptions = new ListSubnetReservedIpsOptions.Builder() - .subnetId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .sort("name") - .build(); + .subnetId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); // Invoke operation Response response = service.listSubnetReservedIps(listSubnetReservedIpsOptions).execute(); @@ -2578,20 +2539,53 @@ public void testListSubnetReservedIps() throws Exception { } } + @Test(dependsOnMethods = { "testListSubnetReservedIps" }) + public void testListSubnetReservedIpsWithPager() throws Exception { + try { + ListSubnetReservedIpsOptions options = new ListSubnetReservedIpsOptions.Builder() + .subnetId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + SubnetReservedIpsPager pager = new SubnetReservedIpsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new SubnetReservedIpsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateSubnetReservedIp() throws Exception { try { ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById reservedIpTargetPrototypeModel = new ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.Builder() - .id("d7cc5196-9864-48c4-82d8-3f30da41fcc5") - .build(); + .id("d7cc5196-9864-48c4-82d8-3f30da41fcc5") + .build(); CreateSubnetReservedIpOptions createSubnetReservedIpOptions = new CreateSubnetReservedIpOptions.Builder() - .subnetId("testString") - .address("192.168.3.4") - .autoDelete(false) - .name("my-reserved-ip") - .target(reservedIpTargetPrototypeModel) - .build(); + .subnetId("testString") + .address("192.168.3.4") + .autoDelete(false) + .name("my-reserved-ip") + .target(reservedIpTargetPrototypeModel) + .build(); // Invoke operation Response response = service.createSubnetReservedIp(createSubnetReservedIpOptions).execute(); @@ -2602,16 +2596,6 @@ public void testCreateSubnetReservedIp() throws Exception { ReservedIP reservedIpResult = response.getResult(); assertNotNull(reservedIpResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2622,9 +2606,9 @@ public void testCreateSubnetReservedIp() throws Exception { public void testGetSubnetReservedIp() throws Exception { try { GetSubnetReservedIpOptions getSubnetReservedIpOptions = new GetSubnetReservedIpOptions.Builder() - .subnetId("testString") - .id("testString") - .build(); + .subnetId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getSubnetReservedIp(getSubnetReservedIpOptions).execute(); @@ -2635,15 +2619,6 @@ public void testGetSubnetReservedIp() throws Exception { ReservedIP reservedIpResult = response.getResult(); assertNotNull(reservedIpResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2654,16 +2629,16 @@ public void testGetSubnetReservedIp() throws Exception { public void testUpdateSubnetReservedIp() throws Exception { try { ReservedIPPatch reservedIpPatchModel = new ReservedIPPatch.Builder() - .autoDelete(false) - .name("my-reserved-ip") - .build(); + .autoDelete(false) + .name("my-reserved-ip") + .build(); Map reservedIpPatchModelAsPatch = reservedIpPatchModel.asPatch(); UpdateSubnetReservedIpOptions updateSubnetReservedIpOptions = new UpdateSubnetReservedIpOptions.Builder() - .subnetId("testString") - .id("testString") - .reservedIpPatch(reservedIpPatchModelAsPatch) - .build(); + .subnetId("testString") + .id("testString") + .reservedIpPatch(reservedIpPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateSubnetReservedIp(updateSubnetReservedIpOptions).execute(); @@ -2674,18 +2649,6 @@ public void testUpdateSubnetReservedIp() throws Exception { ReservedIP reservedIpResult = response.getResult(); assertNotNull(reservedIpResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 403 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2696,12 +2659,12 @@ public void testUpdateSubnetReservedIp() throws Exception { public void testListImages() throws Exception { try { ListImagesOptions listImagesOptions = new ListImagesOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .name("testString") - .visibility("private") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .visibility("private") + .build(); // Invoke operation Response response = service.listImages(listImagesOptions).execute(); @@ -2718,37 +2681,71 @@ public void testListImages() throws Exception { } } + @Test(dependsOnMethods = { "testListImages" }) + public void testListImagesWithPager() throws Exception { + try { + ListImagesOptions options = new ListImagesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .visibility("private") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + ImagesPager pager = new ImagesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new ImagesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateImage() throws Exception { try { ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); ImageFilePrototype imageFilePrototypeModel = new ImageFilePrototype.Builder() - .href("cos://us-south/my-bucket/my-image.qcow2") - .build(); + .href("cos://us-south/my-bucket/my-image.qcow2") + .build(); OperatingSystemIdentityByName operatingSystemIdentityModel = new OperatingSystemIdentityByName.Builder() - .name("debian-9-amd64") - .build(); + .name("debian-9-amd64") + .build(); ImagePrototypeImageByFile imagePrototypeModel = new ImagePrototypeImageByFile.Builder() - .name("my-image") - .resourceGroup(resourceGroupIdentityModel) - .encryptedDataKey("testString") - .encryptionKey(encryptionKeyIdentityModel) - .file(imageFilePrototypeModel) - .operatingSystem(operatingSystemIdentityModel) - .build(); + .name("my-image") + .resourceGroup(resourceGroupIdentityModel) + .encryptedDataKey("testString") + .encryptionKey(encryptionKeyIdentityModel) + .file(imageFilePrototypeModel) + .operatingSystem(operatingSystemIdentityModel) + .build(); CreateImageOptions createImageOptions = new CreateImageOptions.Builder() - .imagePrototype(imagePrototypeModel) - .build(); + .imagePrototype(imagePrototypeModel) + .build(); // Invoke operation Response response = service.createImage(createImageOptions).execute(); @@ -2759,16 +2756,6 @@ public void testCreateImage() throws Exception { Image imageResult = response.getResult(); assertNotNull(imageResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2779,8 +2766,8 @@ public void testCreateImage() throws Exception { public void testGetImage() throws Exception { try { GetImageOptions getImageOptions = new GetImageOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getImage(getImageOptions).execute(); @@ -2791,15 +2778,6 @@ public void testGetImage() throws Exception { Image imageResult = response.getResult(); assertNotNull(imageResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2810,14 +2788,14 @@ public void testGetImage() throws Exception { public void testUpdateImage() throws Exception { try { ImagePatch imagePatchModel = new ImagePatch.Builder() - .name("my-image") - .build(); + .name("my-image") + .build(); Map imagePatchModelAsPatch = imagePatchModel.asPatch(); UpdateImageOptions updateImageOptions = new UpdateImageOptions.Builder() - .id("testString") - .imagePatch(imagePatchModelAsPatch) - .build(); + .id("testString") + .imagePatch(imagePatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateImage(updateImageOptions).execute(); @@ -2828,18 +2806,6 @@ public void testUpdateImage() throws Exception { Image imageResult = response.getResult(); assertNotNull(imageResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 403 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2850,9 +2816,9 @@ public void testUpdateImage() throws Exception { public void testListOperatingSystems() throws Exception { try { ListOperatingSystemsOptions listOperatingSystemsOptions = new ListOperatingSystemsOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listOperatingSystems(listOperatingSystemsOptions).execute(); @@ -2869,12 +2835,43 @@ public void testListOperatingSystems() throws Exception { } } + @Test(dependsOnMethods = { "testListOperatingSystems" }) + public void testListOperatingSystemsWithPager() throws Exception { + try { + ListOperatingSystemsOptions options = new ListOperatingSystemsOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + OperatingSystemsPager pager = new OperatingSystemsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new OperatingSystemsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testGetOperatingSystem() throws Exception { try { GetOperatingSystemOptions getOperatingSystemOptions = new GetOperatingSystemOptions.Builder() - .name("testString") - .build(); + .name("testString") + .build(); // Invoke operation Response response = service.getOperatingSystem(getOperatingSystemOptions).execute(); @@ -2885,15 +2882,6 @@ public void testGetOperatingSystem() throws Exception { OperatingSystem operatingSystemResult = response.getResult(); assertNotNull(operatingSystemResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2904,9 +2892,9 @@ public void testGetOperatingSystem() throws Exception { public void testListKeys() throws Exception { try { ListKeysOptions listKeysOptions = new ListKeysOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listKeys(listKeysOptions).execute(); @@ -2923,19 +2911,50 @@ public void testListKeys() throws Exception { } } + @Test(dependsOnMethods = { "testListKeys" }) + public void testListKeysWithPager() throws Exception { + try { + ListKeysOptions options = new ListKeysOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + KeysPager pager = new KeysPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new KeysPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateKey() throws Exception { try { ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); CreateKeyOptions createKeyOptions = new CreateKeyOptions.Builder() - .publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En") - .name("my-key") - .resourceGroup(resourceGroupIdentityModel) - .type("rsa") - .build(); + .publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En") + .name("my-key") + .resourceGroup(resourceGroupIdentityModel) + .type("rsa") + .build(); // Invoke operation Response response = service.createKey(createKeyOptions).execute(); @@ -2946,15 +2965,6 @@ public void testCreateKey() throws Exception { Key keyResult = response.getResult(); assertNotNull(keyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2965,8 +2975,8 @@ public void testCreateKey() throws Exception { public void testGetKey() throws Exception { try { GetKeyOptions getKeyOptions = new GetKeyOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getKey(getKeyOptions).execute(); @@ -2977,15 +2987,6 @@ public void testGetKey() throws Exception { Key keyResult = response.getResult(); assertNotNull(keyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -2996,14 +2997,14 @@ public void testGetKey() throws Exception { public void testUpdateKey() throws Exception { try { KeyPatch keyPatchModel = new KeyPatch.Builder() - .name("my-key") - .build(); + .name("my-key") + .build(); Map keyPatchModelAsPatch = keyPatchModel.asPatch(); UpdateKeyOptions updateKeyOptions = new UpdateKeyOptions.Builder() - .id("testString") - .keyPatch(keyPatchModelAsPatch) - .build(); + .id("testString") + .keyPatch(keyPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateKey(updateKeyOptions).execute(); @@ -3014,16 +3015,6 @@ public void testUpdateKey() throws Exception { Key keyResult = response.getResult(); assertNotNull(keyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3054,8 +3045,8 @@ public void testListInstanceProfiles() throws Exception { public void testGetInstanceProfile() throws Exception { try { GetInstanceProfileOptions getInstanceProfileOptions = new GetInstanceProfileOptions.Builder() - .name("testString") - .build(); + .name("testString") + .build(); // Invoke operation Response response = service.getInstanceProfile(getInstanceProfileOptions).execute(); @@ -3066,15 +3057,6 @@ public void testGetInstanceProfile() throws Exception { InstanceProfile instanceProfileResult = response.getResult(); assertNotNull(instanceProfileResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3105,127 +3087,128 @@ public void testListInstanceTemplates() throws Exception { public void testCreateInstanceTemplate() throws Exception { try { InstanceAvailabilityPrototype instanceAvailabilityPrototypeModel = new InstanceAvailabilityPrototype.Builder() - .hostFailure("restart") - .build(); + .hostFailure("restart") + .build(); TrustedProfileIdentityTrustedProfileById trustedProfileIdentityModel = new TrustedProfileIdentityTrustedProfileById.Builder() - .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") - .build(); + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototypeModel = new InstanceDefaultTrustedProfilePrototype.Builder() - .autoLink(false) - .target(trustedProfileIdentityModel) - .build(); + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() - .id("363f6d70-0000-0001-0000-00000013b96c") - .build(); + .id("363f6d70-0000-0001-0000-00000013b96c") + .build(); InstanceMetadataServicePrototype instanceMetadataServicePrototypeModel = new InstanceMetadataServicePrototype.Builder() - .enabled(false) - .build(); + .enabled(false) + .build(); NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); + .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); NetworkInterfacePrototype networkInterfacePrototypeModel = new NetworkInterfacePrototype.Builder() - .allowIpSpoofing(true) - .name("my-network-interface") - .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) - .subnet(subnetIdentityModel) - .build(); + .allowIpSpoofing(true) + .name("my-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() - .id("1e09281b-f177-46fb-baf1-bc152b2e391a") - .build(); + .id("1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); InstanceProfileIdentityByName instanceProfileIdentityModel = new InstanceProfileIdentityByName.Builder() - .name("bx2-2x8") - .build(); + .name("bx2-2x8") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById volumeAttachmentVolumePrototypeInstanceContextModel = new VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.Builder() - .id("1a6b7274-678d-4dfb-8981-c71dd9d4daa5") - .build(); + .id("1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .build(); VolumeAttachmentPrototypeInstanceContext volumeAttachmentPrototypeInstanceContextModel = new VolumeAttachmentPrototypeInstanceContext.Builder() - .deleteVolumeOnInstanceDelete(true) - .name("my-volume-attachment") - .volume(volumeAttachmentVolumePrototypeInstanceContextModel) - .build(); + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumeAttachmentVolumePrototypeInstanceContextModel) + .build(); VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("dc201ab2-8536-4904-86a8-084d84582133") - .build(); + .id("dc201ab2-8536-4904-86a8-084d84582133") + .build(); EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() - .name("general-purpose") - .build(); + .name("general-purpose") + .build(); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() - .capacity(Long.valueOf("250")) - .encryptionKey(encryptionKeyIdentityModel) - .iops(Long.valueOf("10000")) - .name("my-volume") - .profile(volumeProfileIdentityModel) - .build(); + .capacity(Long.valueOf("250")) + .encryptionKey(encryptionKeyIdentityModel) + .iops(Long.valueOf("10000")) + .name("my-volume") + .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) + .build(); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() - .deleteVolumeOnInstanceDelete(true) - .name("my-volume-attachment") - .volume(volumePrototypeInstanceByImageContextModel) - .build(); + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumePrototypeInstanceByImageContextModel) + .build(); ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() - .id("3f9a2d96-830e-4100-9b4c-663225a3f872") - .build(); + .id("3f9a2d96-830e-4100-9b4c-663225a3f872") + .build(); ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); + .name("us-south-1") + .build(); InstanceTemplatePrototypeInstanceByImage instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceByImage.Builder() - .availabilityPolicy(instanceAvailabilityPrototypeModel) - .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) - .metadataService(instanceMetadataServicePrototypeModel) - .name("my-instance-template") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))) - .placementTarget(instancePlacementTargetPrototypeModel) - .profile(instanceProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .totalVolumeBandwidth(Long.valueOf("500")) - .userData("testString") - .volumeAttachments(new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))) - .vpc(vpcIdentityModel) - .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) - .image(imageIdentityModel) - .primaryNetworkInterface(networkInterfacePrototypeModel) - .zone(zoneIdentityModel) - .build(); + .availabilityPolicy(instanceAvailabilityPrototypeModel) + .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .metadataService(instanceMetadataServicePrototypeModel) + .name("my-instance-template") + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) + .placementTarget(instancePlacementTargetPrototypeModel) + .profile(instanceProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .totalVolumeBandwidth(Long.valueOf("500")) + .userData("testString") + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) + .vpc(vpcIdentityModel) + .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) + .image(imageIdentityModel) + .primaryNetworkInterface(networkInterfacePrototypeModel) + .zone(zoneIdentityModel) + .build(); CreateInstanceTemplateOptions createInstanceTemplateOptions = new CreateInstanceTemplateOptions.Builder() - .instanceTemplatePrototype(instanceTemplatePrototypeModel) - .build(); + .instanceTemplatePrototype(instanceTemplatePrototypeModel) + .build(); // Invoke operation Response response = service.createInstanceTemplate(createInstanceTemplateOptions).execute(); @@ -3236,15 +3219,6 @@ public void testCreateInstanceTemplate() throws Exception { InstanceTemplate instanceTemplateResult = response.getResult(); assertNotNull(instanceTemplateResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3255,8 +3229,8 @@ public void testCreateInstanceTemplate() throws Exception { public void testGetInstanceTemplate() throws Exception { try { GetInstanceTemplateOptions getInstanceTemplateOptions = new GetInstanceTemplateOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getInstanceTemplate(getInstanceTemplateOptions).execute(); @@ -3267,15 +3241,6 @@ public void testGetInstanceTemplate() throws Exception { InstanceTemplate instanceTemplateResult = response.getResult(); assertNotNull(instanceTemplateResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3286,14 +3251,14 @@ public void testGetInstanceTemplate() throws Exception { public void testUpdateInstanceTemplate() throws Exception { try { InstanceTemplatePatch instanceTemplatePatchModel = new InstanceTemplatePatch.Builder() - .name("my-instance-template") - .build(); + .name("my-instance-template") + .build(); Map instanceTemplatePatchModelAsPatch = instanceTemplatePatchModel.asPatch(); UpdateInstanceTemplateOptions updateInstanceTemplateOptions = new UpdateInstanceTemplateOptions.Builder() - .id("testString") - .instanceTemplatePatch(instanceTemplatePatchModelAsPatch) - .build(); + .id("testString") + .instanceTemplatePatch(instanceTemplatePatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateInstanceTemplate(updateInstanceTemplateOptions).execute(); @@ -3304,16 +3269,6 @@ public void testUpdateInstanceTemplate() throws Exception { InstanceTemplate instanceTemplateResult = response.getResult(); assertNotNull(instanceTemplateResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3324,20 +3279,20 @@ public void testUpdateInstanceTemplate() throws Exception { public void testListInstances() throws Exception { try { ListInstancesOptions listInstancesOptions = new ListInstancesOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .name("testString") - .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") - .dedicatedHostId("testString") - .dedicatedHostCrn("testString") - .dedicatedHostName("testString") - .placementGroupId("testString") - .placementGroupCrn("testString") - .placementGroupName("testString") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .dedicatedHostId("testString") + .dedicatedHostCrn("testString") + .dedicatedHostName("testString") + .placementGroupId("testString") + .placementGroupCrn("testString") + .placementGroupName("testString") + .build(); // Invoke operation Response response = service.listInstances(listInstancesOptions).execute(); @@ -3354,135 +3309,179 @@ public void testListInstances() throws Exception { } } + @Test(dependsOnMethods = { "testListInstances" }) + public void testListInstancesWithPager() throws Exception { + try { + ListInstancesOptions options = new ListInstancesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .dedicatedHostId("testString") + .dedicatedHostCrn("testString") + .dedicatedHostName("testString") + .placementGroupId("testString") + .placementGroupCrn("testString") + .placementGroupName("testString") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + InstancesPager pager = new InstancesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new InstancesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateInstance() throws Exception { try { InstanceAvailabilityPrototype instanceAvailabilityPrototypeModel = new InstanceAvailabilityPrototype.Builder() - .hostFailure("restart") - .build(); + .hostFailure("restart") + .build(); TrustedProfileIdentityTrustedProfileById trustedProfileIdentityModel = new TrustedProfileIdentityTrustedProfileById.Builder() - .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") - .build(); + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototypeModel = new InstanceDefaultTrustedProfilePrototype.Builder() - .autoLink(false) - .target(trustedProfileIdentityModel) - .build(); + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() - .id("363f6d70-0000-0001-0000-00000013b96c") - .build(); + .id("363f6d70-0000-0001-0000-00000013b96c") + .build(); InstanceMetadataServicePrototype instanceMetadataServicePrototypeModel = new InstanceMetadataServicePrototype.Builder() - .enabled(false) - .build(); + .enabled(false) + .build(); NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); + .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); NetworkInterfacePrototype networkInterfacePrototypeModel = new NetworkInterfacePrototype.Builder() - .allowIpSpoofing(true) - .name("my-network-interface") - .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) - .subnet(subnetIdentityModel) - .build(); + .allowIpSpoofing(true) + .name("my-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() - .id("0787-8c2a09be-ee18-4af2-8ef4-6a6060732221") - .build(); + .id("0787-8c2a09be-ee18-4af2-8ef4-6a6060732221") + .build(); InstanceProfileIdentityByName instanceProfileIdentityModel = new InstanceProfileIdentityByName.Builder() - .name("bx2-2x8") - .build(); + .name("bx2-2x8") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() - .name("5iops-tier") - .build(); + .name("5iops-tier") + .build(); EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:[...]") - .build(); + .crn("crn:[...]") + .build(); VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity volumeAttachmentVolumePrototypeInstanceContextModel = new VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.Builder() - .iops(Long.valueOf("10000")) - .name("my-data-volume") - .profile(volumeProfileIdentityModel) - .capacity(Long.valueOf("1000")) - .encryptionKey(encryptionKeyIdentityModel) - .build(); + .iops(Long.valueOf("10000")) + .name("my-data-volume") + .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) + .capacity(Long.valueOf("1000")) + .encryptionKey(encryptionKeyIdentityModel) + .build(); VolumeAttachmentPrototypeInstanceContext volumeAttachmentPrototypeInstanceContextModel = new VolumeAttachmentPrototypeInstanceContext.Builder() - .deleteVolumeOnInstanceDelete(true) - .name("my-volume-attachment") - .volume(volumeAttachmentVolumePrototypeInstanceContextModel) - .build(); + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumeAttachmentVolumePrototypeInstanceContextModel) + .build(); VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("f0aae929-7047-46d1-92e1-9102b07a7f6f") - .build(); + .id("f0aae929-7047-46d1-92e1-9102b07a7f6f") + .build(); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() - .capacity(Long.valueOf("250")) - .encryptionKey(encryptionKeyIdentityModel) - .iops(Long.valueOf("10000")) - .name("my-boot-volume") - .profile(volumeProfileIdentityModel) - .build(); + .capacity(Long.valueOf("250")) + .encryptionKey(encryptionKeyIdentityModel) + .iops(Long.valueOf("10000")) + .name("my-boot-volume") + .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) + .build(); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() - .deleteVolumeOnInstanceDelete(true) - .name("my-volume-attachment") - .volume(volumePrototypeInstanceByImageContextModel) - .build(); + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumePrototypeInstanceByImageContextModel) + .build(); ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() - .id("9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366") - .build(); + .id("9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366") + .build(); ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); + .name("us-south-1") + .build(); InstancePrototypeInstanceByImage instancePrototypeModel = new InstancePrototypeInstanceByImage.Builder() - .availabilityPolicy(instanceAvailabilityPrototypeModel) - .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) - .metadataService(instanceMetadataServicePrototypeModel) - .name("my-instance") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))) - .placementTarget(instancePlacementTargetPrototypeModel) - .profile(instanceProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .totalVolumeBandwidth(Long.valueOf("500")) - .userData("testString") - .volumeAttachments(new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))) - .vpc(vpcIdentityModel) - .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) - .image(imageIdentityModel) - .primaryNetworkInterface(networkInterfacePrototypeModel) - .zone(zoneIdentityModel) - .build(); + .availabilityPolicy(instanceAvailabilityPrototypeModel) + .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .metadataService(instanceMetadataServicePrototypeModel) + .name("my-instance") + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) + .placementTarget(instancePlacementTargetPrototypeModel) + .profile(instanceProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .totalVolumeBandwidth(Long.valueOf("500")) + .userData("testString") + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) + .vpc(vpcIdentityModel) + .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) + .image(imageIdentityModel) + .primaryNetworkInterface(networkInterfacePrototypeModel) + .zone(zoneIdentityModel) + .build(); CreateInstanceOptions createInstanceOptions = new CreateInstanceOptions.Builder() - .instancePrototype(instancePrototypeModel) - .build(); + .instancePrototype(instancePrototypeModel) + .build(); // Invoke operation Response response = service.createInstance(createInstanceOptions).execute(); @@ -3493,16 +3492,6 @@ public void testCreateInstance() throws Exception { Instance instanceResult = response.getResult(); assertNotNull(instanceResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3513,8 +3502,8 @@ public void testCreateInstance() throws Exception { public void testGetInstance() throws Exception { try { GetInstanceOptions getInstanceOptions = new GetInstanceOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getInstance(getInstanceOptions).execute(); @@ -3525,15 +3514,6 @@ public void testGetInstance() throws Exception { Instance instanceResult = response.getResult(); assertNotNull(instanceResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3544,35 +3524,35 @@ public void testGetInstance() throws Exception { public void testUpdateInstance() throws Exception { try { InstanceAvailabilityPolicyPatch instanceAvailabilityPolicyPatchModel = new InstanceAvailabilityPolicyPatch.Builder() - .hostFailure("restart") - .build(); + .hostFailure("restart") + .build(); InstanceMetadataServicePatch instanceMetadataServicePatchModel = new InstanceMetadataServicePatch.Builder() - .enabled(true) - .build(); + .enabled(true) + .build(); InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPatchModel = new InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.Builder() - .id("1e09281b-f177-46fb-baf1-bc152b2e391a") - .build(); + .id("1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); InstancePatchProfileInstanceProfileIdentityByName instancePatchProfileModel = new InstancePatchProfileInstanceProfileIdentityByName.Builder() - .name("bx2-4x16") - .build(); + .name("bx2-4x16") + .build(); InstancePatch instancePatchModel = new InstancePatch.Builder() - .availabilityPolicy(instanceAvailabilityPolicyPatchModel) - .metadataService(instanceMetadataServicePatchModel) - .name("my-instance") - .placementTarget(instancePlacementTargetPatchModel) - .profile(instancePatchProfileModel) - .totalVolumeBandwidth(Long.valueOf("500")) - .build(); + .availabilityPolicy(instanceAvailabilityPolicyPatchModel) + .metadataService(instanceMetadataServicePatchModel) + .name("my-instance") + .placementTarget(instancePlacementTargetPatchModel) + .profile(instancePatchProfileModel) + .totalVolumeBandwidth(Long.valueOf("500")) + .build(); Map instancePatchModelAsPatch = instancePatchModel.asPatch(); UpdateInstanceOptions updateInstanceOptions = new UpdateInstanceOptions.Builder() - .id("testString") - .instancePatch(instancePatchModelAsPatch) - .build(); + .id("testString") + .instancePatch(instancePatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateInstance(updateInstanceOptions).execute(); @@ -3583,17 +3563,6 @@ public void testUpdateInstance() throws Exception { Instance instanceResult = response.getResult(); assertNotNull(instanceResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3604,8 +3573,8 @@ public void testUpdateInstance() throws Exception { public void testGetInstanceInitialization() throws Exception { try { GetInstanceInitializationOptions getInstanceInitializationOptions = new GetInstanceInitializationOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getInstanceInitialization(getInstanceInitializationOptions).execute(); @@ -3616,15 +3585,6 @@ public void testGetInstanceInitialization() throws Exception { InstanceInitialization instanceInitializationResult = response.getResult(); assertNotNull(instanceInitializationResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3635,10 +3595,10 @@ public void testGetInstanceInitialization() throws Exception { public void testCreateInstanceAction() throws Exception { try { CreateInstanceActionOptions createInstanceActionOptions = new CreateInstanceActionOptions.Builder() - .instanceId("testString") - .type("reboot") - .force(true) - .build(); + .instanceId("testString") + .type("reboot") + .force(true) + .build(); // Invoke operation Response response = service.createInstanceAction(createInstanceActionOptions).execute(); @@ -3649,16 +3609,6 @@ public void testCreateInstanceAction() throws Exception { InstanceAction instanceActionResult = response.getResult(); assertNotNull(instanceActionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3669,10 +3619,10 @@ public void testCreateInstanceAction() throws Exception { public void testCreateInstanceConsoleAccessToken() throws Exception { try { CreateInstanceConsoleAccessTokenOptions createInstanceConsoleAccessTokenOptions = new CreateInstanceConsoleAccessTokenOptions.Builder() - .instanceId("testString") - .consoleType("serial") - .force(false) - .build(); + .instanceId("testString") + .consoleType("serial") + .force(false) + .build(); // Invoke operation Response response = service.createInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptions).execute(); @@ -3683,16 +3633,6 @@ public void testCreateInstanceConsoleAccessToken() throws Exception { InstanceConsoleAccessToken instanceConsoleAccessTokenResult = response.getResult(); assertNotNull(instanceConsoleAccessTokenResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3703,8 +3643,8 @@ public void testCreateInstanceConsoleAccessToken() throws Exception { public void testListInstanceDisks() throws Exception { try { ListInstanceDisksOptions listInstanceDisksOptions = new ListInstanceDisksOptions.Builder() - .instanceId("testString") - .build(); + .instanceId("testString") + .build(); // Invoke operation Response response = service.listInstanceDisks(listInstanceDisksOptions).execute(); @@ -3715,15 +3655,6 @@ public void testListInstanceDisks() throws Exception { InstanceDiskCollection instanceDiskCollectionResult = response.getResult(); assertNotNull(instanceDiskCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3734,9 +3665,9 @@ public void testListInstanceDisks() throws Exception { public void testGetInstanceDisk() throws Exception { try { GetInstanceDiskOptions getInstanceDiskOptions = new GetInstanceDiskOptions.Builder() - .instanceId("testString") - .id("testString") - .build(); + .instanceId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getInstanceDisk(getInstanceDiskOptions).execute(); @@ -3747,15 +3678,6 @@ public void testGetInstanceDisk() throws Exception { InstanceDisk instanceDiskResult = response.getResult(); assertNotNull(instanceDiskResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3766,15 +3688,15 @@ public void testGetInstanceDisk() throws Exception { public void testUpdateInstanceDisk() throws Exception { try { InstanceDiskPatch instanceDiskPatchModel = new InstanceDiskPatch.Builder() - .name("my-instance-disk-updated") - .build(); + .name("my-instance-disk-updated") + .build(); Map instanceDiskPatchModelAsPatch = instanceDiskPatchModel.asPatch(); UpdateInstanceDiskOptions updateInstanceDiskOptions = new UpdateInstanceDiskOptions.Builder() - .instanceId("testString") - .id("testString") - .instanceDiskPatch(instanceDiskPatchModelAsPatch) - .build(); + .instanceId("testString") + .id("testString") + .instanceDiskPatch(instanceDiskPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateInstanceDisk(updateInstanceDiskOptions).execute(); @@ -3785,16 +3707,6 @@ public void testUpdateInstanceDisk() throws Exception { InstanceDisk instanceDiskResult = response.getResult(); assertNotNull(instanceDiskResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3805,8 +3717,8 @@ public void testUpdateInstanceDisk() throws Exception { public void testListInstanceNetworkInterfaces() throws Exception { try { ListInstanceNetworkInterfacesOptions listInstanceNetworkInterfacesOptions = new ListInstanceNetworkInterfacesOptions.Builder() - .instanceId("testString") - .build(); + .instanceId("testString") + .build(); // Invoke operation Response response = service.listInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptions).execute(); @@ -3817,15 +3729,6 @@ public void testListInstanceNetworkInterfaces() throws Exception { NetworkInterfaceUnpaginatedCollection networkInterfaceUnpaginatedCollectionResult = response.getResult(); assertNotNull(networkInterfaceUnpaginatedCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3836,27 +3739,27 @@ public void testListInstanceNetworkInterfaces() throws Exception { public void testCreateInstanceNetworkInterface() throws Exception { try { SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); + .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); CreateInstanceNetworkInterfaceOptions createInstanceNetworkInterfaceOptions = new CreateInstanceNetworkInterfaceOptions.Builder() - .instanceId("testString") - .subnet(subnetIdentityModel) - .allowIpSpoofing(true) - .name("my-network-interface") - .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) - .build(); + .instanceId("testString") + .subnet(subnetIdentityModel) + .allowIpSpoofing(true) + .name("my-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .build(); // Invoke operation Response response = service.createInstanceNetworkInterface(createInstanceNetworkInterfaceOptions).execute(); @@ -3867,16 +3770,6 @@ public void testCreateInstanceNetworkInterface() throws Exception { NetworkInterface networkInterfaceResult = response.getResult(); assertNotNull(networkInterfaceResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3887,9 +3780,9 @@ public void testCreateInstanceNetworkInterface() throws Exception { public void testGetInstanceNetworkInterface() throws Exception { try { GetInstanceNetworkInterfaceOptions getInstanceNetworkInterfaceOptions = new GetInstanceNetworkInterfaceOptions.Builder() - .instanceId("testString") - .id("testString") - .build(); + .instanceId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getInstanceNetworkInterface(getInstanceNetworkInterfaceOptions).execute(); @@ -3900,15 +3793,6 @@ public void testGetInstanceNetworkInterface() throws Exception { NetworkInterface networkInterfaceResult = response.getResult(); assertNotNull(networkInterfaceResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3919,16 +3803,16 @@ public void testGetInstanceNetworkInterface() throws Exception { public void testUpdateInstanceNetworkInterface() throws Exception { try { NetworkInterfacePatch networkInterfacePatchModel = new NetworkInterfacePatch.Builder() - .allowIpSpoofing(true) - .name("my-network-interface-1") - .build(); + .allowIpSpoofing(true) + .name("my-network-interface-1") + .build(); Map networkInterfacePatchModelAsPatch = networkInterfacePatchModel.asPatch(); UpdateInstanceNetworkInterfaceOptions updateInstanceNetworkInterfaceOptions = new UpdateInstanceNetworkInterfaceOptions.Builder() - .instanceId("testString") - .id("testString") - .networkInterfacePatch(networkInterfacePatchModelAsPatch) - .build(); + .instanceId("testString") + .id("testString") + .networkInterfacePatch(networkInterfacePatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptions).execute(); @@ -3939,16 +3823,6 @@ public void testUpdateInstanceNetworkInterface() throws Exception { NetworkInterface networkInterfaceResult = response.getResult(); assertNotNull(networkInterfaceResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3959,9 +3833,9 @@ public void testUpdateInstanceNetworkInterface() throws Exception { public void testListInstanceNetworkInterfaceFloatingIps() throws Exception { try { ListInstanceNetworkInterfaceFloatingIpsOptions listInstanceNetworkInterfaceFloatingIpsOptions = new ListInstanceNetworkInterfaceFloatingIpsOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") - .build(); + .instanceId("testString") + .networkInterfaceId("testString") + .build(); // Invoke operation Response response = service.listInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptions).execute(); @@ -3972,15 +3846,6 @@ public void testListInstanceNetworkInterfaceFloatingIps() throws Exception { FloatingIPUnpaginatedCollection floatingIpUnpaginatedCollectionResult = response.getResult(); assertNotNull(floatingIpUnpaginatedCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -3991,10 +3856,10 @@ public void testListInstanceNetworkInterfaceFloatingIps() throws Exception { public void testGetInstanceNetworkInterfaceFloatingIp() throws Exception { try { GetInstanceNetworkInterfaceFloatingIpOptions getInstanceNetworkInterfaceFloatingIpOptions = new GetInstanceNetworkInterfaceFloatingIpOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") - .id("testString") - .build(); + .instanceId("testString") + .networkInterfaceId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getInstanceNetworkInterfaceFloatingIp(getInstanceNetworkInterfaceFloatingIpOptions).execute(); @@ -4005,15 +3870,6 @@ public void testGetInstanceNetworkInterfaceFloatingIp() throws Exception { FloatingIP floatingIpResult = response.getResult(); assertNotNull(floatingIpResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4024,10 +3880,10 @@ public void testGetInstanceNetworkInterfaceFloatingIp() throws Exception { public void testAddInstanceNetworkInterfaceFloatingIp() throws Exception { try { AddInstanceNetworkInterfaceFloatingIpOptions addInstanceNetworkInterfaceFloatingIpOptions = new AddInstanceNetworkInterfaceFloatingIpOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") - .id("testString") - .build(); + .instanceId("testString") + .networkInterfaceId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.addInstanceNetworkInterfaceFloatingIp(addInstanceNetworkInterfaceFloatingIpOptions).execute(); @@ -4038,16 +3894,6 @@ public void testAddInstanceNetworkInterfaceFloatingIp() throws Exception { FloatingIP floatingIpResult = response.getResult(); assertNotNull(floatingIpResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4058,11 +3904,11 @@ public void testAddInstanceNetworkInterfaceFloatingIp() throws Exception { public void testListInstanceNetworkInterfaceIps() throws Exception { try { ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptions = new ListInstanceNetworkInterfaceIpsOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .instanceId("testString") + .networkInterfaceId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptions).execute(); @@ -4073,15 +3919,39 @@ public void testListInstanceNetworkInterfaceIps() throws Exception { ReservedIPCollectionNetworkInterfaceContext reservedIpCollectionNetworkInterfaceContextResult = response.getResult(); assertNotNull(reservedIpCollectionNetworkInterfaceContextResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListInstanceNetworkInterfaceIps" }) + public void testListInstanceNetworkInterfaceIpsWithPager() throws Exception { + try { + ListInstanceNetworkInterfaceIpsOptions options = new ListInstanceNetworkInterfaceIpsOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + InstanceNetworkInterfaceIpsPager pager = new InstanceNetworkInterfaceIpsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + // Test getAll(); + pager = new InstanceNetworkInterfaceIpsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4092,10 +3962,10 @@ public void testListInstanceNetworkInterfaceIps() throws Exception { public void testGetInstanceNetworkInterfaceIp() throws Exception { try { GetInstanceNetworkInterfaceIpOptions getInstanceNetworkInterfaceIpOptions = new GetInstanceNetworkInterfaceIpOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") - .id("testString") - .build(); + .instanceId("testString") + .networkInterfaceId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getInstanceNetworkInterfaceIp(getInstanceNetworkInterfaceIpOptions).execute(); @@ -4106,15 +3976,6 @@ public void testGetInstanceNetworkInterfaceIp() throws Exception { ReservedIP reservedIpResult = response.getResult(); assertNotNull(reservedIpResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4125,8 +3986,8 @@ public void testGetInstanceNetworkInterfaceIp() throws Exception { public void testListInstanceVolumeAttachments() throws Exception { try { ListInstanceVolumeAttachmentsOptions listInstanceVolumeAttachmentsOptions = new ListInstanceVolumeAttachmentsOptions.Builder() - .instanceId("testString") - .build(); + .instanceId("testString") + .build(); // Invoke operation Response response = service.listInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptions).execute(); @@ -4137,15 +3998,6 @@ public void testListInstanceVolumeAttachments() throws Exception { VolumeAttachmentCollection volumeAttachmentCollectionResult = response.getResult(); assertNotNull(volumeAttachmentCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4156,15 +4008,15 @@ public void testListInstanceVolumeAttachments() throws Exception { public void testCreateInstanceVolumeAttachment() throws Exception { try { VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() - .id("1a6b7274-678d-4dfb-8981-c71dd9d4daa5") - .build(); + .id("1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .build(); CreateInstanceVolumeAttachmentOptions createInstanceVolumeAttachmentOptions = new CreateInstanceVolumeAttachmentOptions.Builder() - .instanceId("testString") - .volume(volumeAttachmentPrototypeVolumeModel) - .deleteVolumeOnInstanceDelete(false) - .name("my-volume-attachment") - .build(); + .instanceId("testString") + .volume(volumeAttachmentPrototypeVolumeModel) + .deleteVolumeOnInstanceDelete(false) + .name("my-volume-attachment") + .build(); // Invoke operation Response response = service.createInstanceVolumeAttachment(createInstanceVolumeAttachmentOptions).execute(); @@ -4175,16 +4027,6 @@ public void testCreateInstanceVolumeAttachment() throws Exception { VolumeAttachment volumeAttachmentResult = response.getResult(); assertNotNull(volumeAttachmentResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4195,9 +4037,9 @@ public void testCreateInstanceVolumeAttachment() throws Exception { public void testGetInstanceVolumeAttachment() throws Exception { try { GetInstanceVolumeAttachmentOptions getInstanceVolumeAttachmentOptions = new GetInstanceVolumeAttachmentOptions.Builder() - .instanceId("testString") - .id("testString") - .build(); + .instanceId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getInstanceVolumeAttachment(getInstanceVolumeAttachmentOptions).execute(); @@ -4208,15 +4050,6 @@ public void testGetInstanceVolumeAttachment() throws Exception { VolumeAttachment volumeAttachmentResult = response.getResult(); assertNotNull(volumeAttachmentResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4227,16 +4060,16 @@ public void testGetInstanceVolumeAttachment() throws Exception { public void testUpdateInstanceVolumeAttachment() throws Exception { try { VolumeAttachmentPatch volumeAttachmentPatchModel = new VolumeAttachmentPatch.Builder() - .deleteVolumeOnInstanceDelete(true) - .name("my-volume-attachment") - .build(); + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .build(); Map volumeAttachmentPatchModelAsPatch = volumeAttachmentPatchModel.asPatch(); UpdateInstanceVolumeAttachmentOptions updateInstanceVolumeAttachmentOptions = new UpdateInstanceVolumeAttachmentOptions.Builder() - .instanceId("testString") - .id("testString") - .volumeAttachmentPatch(volumeAttachmentPatchModelAsPatch) - .build(); + .instanceId("testString") + .id("testString") + .volumeAttachmentPatch(volumeAttachmentPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptions).execute(); @@ -4247,16 +4080,6 @@ public void testUpdateInstanceVolumeAttachment() throws Exception { VolumeAttachment volumeAttachmentResult = response.getResult(); assertNotNull(volumeAttachmentResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4267,9 +4090,9 @@ public void testUpdateInstanceVolumeAttachment() throws Exception { public void testListInstanceGroups() throws Exception { try { ListInstanceGroupsOptions listInstanceGroupsOptions = new ListInstanceGroupsOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listInstanceGroups(listInstanceGroupsOptions).execute(); @@ -4286,39 +4109,70 @@ public void testListInstanceGroups() throws Exception { } } + @Test(dependsOnMethods = { "testListInstanceGroups" }) + public void testListInstanceGroupsWithPager() throws Exception { + try { + ListInstanceGroupsOptions options = new ListInstanceGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + InstanceGroupsPager pager = new InstanceGroupsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new InstanceGroupsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateInstanceGroup() throws Exception { try { InstanceTemplateIdentityById instanceTemplateIdentityModel = new InstanceTemplateIdentityById.Builder() - .id("a6b1a881-2ce8-41a3-80fc-36316a73f803") - .build(); + .id("a6b1a881-2ce8-41a3-80fc-36316a73f803") + .build(); SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() - .id("dd754295-e9e0-4c9d-bf6c-58fbc59e5727") - .build(); + .id("dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .build(); LoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityById.Builder() - .id("70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); + .id("70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); CreateInstanceGroupOptions createInstanceGroupOptions = new CreateInstanceGroupOptions.Builder() - .instanceTemplate(instanceTemplateIdentityModel) - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) - .applicationPort(Long.valueOf("22")) - .loadBalancer(loadBalancerIdentityModel) - .loadBalancerPool(loadBalancerPoolIdentityModel) - .membershipCount(Long.valueOf("10")) - .name("my-instance-group") - .resourceGroup(resourceGroupIdentityModel) - .build(); + .instanceTemplate(instanceTemplateIdentityModel) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .applicationPort(Long.valueOf("22")) + .loadBalancer(loadBalancerIdentityModel) + .loadBalancerPool(loadBalancerPoolIdentityModel) + .membershipCount(Long.valueOf("10")) + .name("my-instance-group") + .resourceGroup(resourceGroupIdentityModel) + .build(); // Invoke operation Response response = service.createInstanceGroup(createInstanceGroupOptions).execute(); @@ -4329,15 +4183,6 @@ public void testCreateInstanceGroup() throws Exception { InstanceGroup instanceGroupResult = response.getResult(); assertNotNull(instanceGroupResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4348,8 +4193,8 @@ public void testCreateInstanceGroup() throws Exception { public void testGetInstanceGroup() throws Exception { try { GetInstanceGroupOptions getInstanceGroupOptions = new GetInstanceGroupOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getInstanceGroup(getInstanceGroupOptions).execute(); @@ -4360,15 +4205,6 @@ public void testGetInstanceGroup() throws Exception { InstanceGroup instanceGroupResult = response.getResult(); assertNotNull(instanceGroupResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4379,36 +4215,36 @@ public void testGetInstanceGroup() throws Exception { public void testUpdateInstanceGroup() throws Exception { try { InstanceTemplateIdentityById instanceTemplateIdentityModel = new InstanceTemplateIdentityById.Builder() - .id("a6b1a881-2ce8-41a3-80fc-36316a73f803") - .build(); + .id("a6b1a881-2ce8-41a3-80fc-36316a73f803") + .build(); LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() - .id("dd754295-e9e0-4c9d-bf6c-58fbc59e5727") - .build(); + .id("dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .build(); LoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityById.Builder() - .id("70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); + .id("70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); InstanceGroupPatch instanceGroupPatchModel = new InstanceGroupPatch.Builder() - .applicationPort(Long.valueOf("22")) - .instanceTemplate(instanceTemplateIdentityModel) - .loadBalancer(loadBalancerIdentityModel) - .loadBalancerPool(loadBalancerPoolIdentityModel) - .membershipCount(Long.valueOf("10")) - .name("my-instance-group") - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) - .build(); + .applicationPort(Long.valueOf("22")) + .instanceTemplate(instanceTemplateIdentityModel) + .loadBalancer(loadBalancerIdentityModel) + .loadBalancerPool(loadBalancerPoolIdentityModel) + .membershipCount(Long.valueOf("10")) + .name("my-instance-group") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .build(); Map instanceGroupPatchModelAsPatch = instanceGroupPatchModel.asPatch(); UpdateInstanceGroupOptions updateInstanceGroupOptions = new UpdateInstanceGroupOptions.Builder() - .id("testString") - .instanceGroupPatch(instanceGroupPatchModelAsPatch) - .build(); + .id("testString") + .instanceGroupPatch(instanceGroupPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateInstanceGroup(updateInstanceGroupOptions).execute(); @@ -4419,17 +4255,6 @@ public void testUpdateInstanceGroup() throws Exception { InstanceGroup instanceGroupResult = response.getResult(); assertNotNull(instanceGroupResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4440,10 +4265,10 @@ public void testUpdateInstanceGroup() throws Exception { public void testListInstanceGroupManagers() throws Exception { try { ListInstanceGroupManagersOptions listInstanceGroupManagersOptions = new ListInstanceGroupManagersOptions.Builder() - .instanceGroupId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .instanceGroupId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listInstanceGroupManagers(listInstanceGroupManagersOptions).execute(); @@ -4454,38 +4279,61 @@ public void testListInstanceGroupManagers() throws Exception { InstanceGroupManagerCollection instanceGroupManagerCollectionResult = response.getResult(); assertNotNull(instanceGroupManagerCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test - public void testCreateInstanceGroupManager() throws Exception { + @Test(dependsOnMethods = { "testListInstanceGroupManagers" }) + public void testListInstanceGroupManagersWithPager() throws Exception { try { - InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype instanceGroupManagerPrototypeModel = new InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.Builder() - .managementEnabled(true) - .name("my-instance-group-manager") - .aggregationWindow(Long.valueOf("120")) - .cooldown(Long.valueOf("210")) - .managerType("autoscale") - .maxMembershipCount(Long.valueOf("10")) - .minMembershipCount(Long.valueOf("10")) - .build(); + ListInstanceGroupManagersOptions options = new ListInstanceGroupManagersOptions.Builder() + .instanceGroupId("testString") + .limit(Long.valueOf("10")) + .build(); - CreateInstanceGroupManagerOptions createInstanceGroupManagerOptions = new CreateInstanceGroupManagerOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerPrototype(instanceGroupManagerPrototypeModel) - .build(); + // Test getNext(). + List allResults = new ArrayList<>(); + InstanceGroupManagersPager pager = new InstanceGroupManagersPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new InstanceGroupManagersPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test + public void testCreateInstanceGroupManager() throws Exception { + try { + InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype instanceGroupManagerPrototypeModel = new InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.Builder() + .managementEnabled(true) + .name("my-instance-group-manager") + .aggregationWindow(Long.valueOf("120")) + .cooldown(Long.valueOf("210")) + .managerType("autoscale") + .maxMembershipCount(Long.valueOf("10")) + .minMembershipCount(Long.valueOf("10")) + .build(); + + CreateInstanceGroupManagerOptions createInstanceGroupManagerOptions = new CreateInstanceGroupManagerOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerPrototype(instanceGroupManagerPrototypeModel) + .build(); // Invoke operation Response response = service.createInstanceGroupManager(createInstanceGroupManagerOptions).execute(); @@ -4496,15 +4344,6 @@ public void testCreateInstanceGroupManager() throws Exception { InstanceGroupManager instanceGroupManagerResult = response.getResult(); assertNotNull(instanceGroupManagerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4515,9 +4354,9 @@ public void testCreateInstanceGroupManager() throws Exception { public void testGetInstanceGroupManager() throws Exception { try { GetInstanceGroupManagerOptions getInstanceGroupManagerOptions = new GetInstanceGroupManagerOptions.Builder() - .instanceGroupId("testString") - .id("testString") - .build(); + .instanceGroupId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getInstanceGroupManager(getInstanceGroupManagerOptions).execute(); @@ -4528,15 +4367,6 @@ public void testGetInstanceGroupManager() throws Exception { InstanceGroupManager instanceGroupManagerResult = response.getResult(); assertNotNull(instanceGroupManagerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4547,20 +4377,20 @@ public void testGetInstanceGroupManager() throws Exception { public void testUpdateInstanceGroupManager() throws Exception { try { InstanceGroupManagerPatch instanceGroupManagerPatchModel = new InstanceGroupManagerPatch.Builder() - .aggregationWindow(Long.valueOf("120")) - .cooldown(Long.valueOf("210")) - .managementEnabled(true) - .maxMembershipCount(Long.valueOf("10")) - .minMembershipCount(Long.valueOf("10")) - .name("my-instance-group-manager") - .build(); + .aggregationWindow(Long.valueOf("120")) + .cooldown(Long.valueOf("210")) + .managementEnabled(true) + .maxMembershipCount(Long.valueOf("10")) + .minMembershipCount(Long.valueOf("10")) + .name("my-instance-group-manager") + .build(); Map instanceGroupManagerPatchModelAsPatch = instanceGroupManagerPatchModel.asPatch(); UpdateInstanceGroupManagerOptions updateInstanceGroupManagerOptions = new UpdateInstanceGroupManagerOptions.Builder() - .instanceGroupId("testString") - .id("testString") - .instanceGroupManagerPatch(instanceGroupManagerPatchModelAsPatch) - .build(); + .instanceGroupId("testString") + .id("testString") + .instanceGroupManagerPatch(instanceGroupManagerPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateInstanceGroupManager(updateInstanceGroupManagerOptions).execute(); @@ -4571,16 +4401,6 @@ public void testUpdateInstanceGroupManager() throws Exception { InstanceGroupManager instanceGroupManagerResult = response.getResult(); assertNotNull(instanceGroupManagerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4591,11 +4411,11 @@ public void testUpdateInstanceGroupManager() throws Exception { public void testListInstanceGroupManagerActions() throws Exception { try { ListInstanceGroupManagerActionsOptions listInstanceGroupManagerActionsOptions = new ListInstanceGroupManagerActionsOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listInstanceGroupManagerActions(listInstanceGroupManagerActionsOptions).execute(); @@ -4606,15 +4426,39 @@ public void testListInstanceGroupManagerActions() throws Exception { InstanceGroupManagerActionsCollection instanceGroupManagerActionsCollectionResult = response.getResult(); assertNotNull(instanceGroupManagerActionsCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListInstanceGroupManagerActions" }) + public void testListInstanceGroupManagerActionsWithPager() throws Exception { + try { + ListInstanceGroupManagerActionsOptions options = new ListInstanceGroupManagerActionsOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + InstanceGroupManagerActionsPager pager = new InstanceGroupManagerActionsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + // Test getAll(); + pager = new InstanceGroupManagerActionsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4625,20 +4469,20 @@ public void testListInstanceGroupManagerActions() throws Exception { public void testCreateInstanceGroupManagerAction() throws Exception { try { InstanceGroupManagerScheduledActionGroupPrototype instanceGroupManagerScheduledActionGroupPrototypeModel = new InstanceGroupManagerScheduledActionGroupPrototype.Builder() - .membershipCount(Long.valueOf("10")) - .build(); + .membershipCount(Long.valueOf("10")) + .build(); InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup instanceGroupManagerActionPrototypeModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.Builder() - .name("my-instance-group-manager-action") - .runAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .group(instanceGroupManagerScheduledActionGroupPrototypeModel) - .build(); + .name("my-instance-group-manager-action") + .runAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .group(instanceGroupManagerScheduledActionGroupPrototypeModel) + .build(); CreateInstanceGroupManagerActionOptions createInstanceGroupManagerActionOptions = new CreateInstanceGroupManagerActionOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .instanceGroupManagerActionPrototype(instanceGroupManagerActionPrototypeModel) - .build(); + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .instanceGroupManagerActionPrototype(instanceGroupManagerActionPrototypeModel) + .build(); // Invoke operation Response response = service.createInstanceGroupManagerAction(createInstanceGroupManagerActionOptions).execute(); @@ -4649,15 +4493,6 @@ public void testCreateInstanceGroupManagerAction() throws Exception { InstanceGroupManagerAction instanceGroupManagerActionResult = response.getResult(); assertNotNull(instanceGroupManagerActionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4668,10 +4503,10 @@ public void testCreateInstanceGroupManagerAction() throws Exception { public void testGetInstanceGroupManagerAction() throws Exception { try { GetInstanceGroupManagerActionOptions getInstanceGroupManagerActionOptions = new GetInstanceGroupManagerActionOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .id("testString") - .build(); + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getInstanceGroupManagerAction(getInstanceGroupManagerActionOptions).execute(); @@ -4682,15 +4517,6 @@ public void testGetInstanceGroupManagerAction() throws Exception { InstanceGroupManagerAction instanceGroupManagerActionResult = response.getResult(); assertNotNull(instanceGroupManagerActionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4701,29 +4527,29 @@ public void testGetInstanceGroupManagerAction() throws Exception { public void testUpdateInstanceGroupManagerAction() throws Exception { try { InstanceGroupManagerActionGroupPatch instanceGroupManagerActionGroupPatchModel = new InstanceGroupManagerActionGroupPatch.Builder() - .membershipCount(Long.valueOf("10")) - .build(); + .membershipCount(Long.valueOf("10")) + .build(); InstanceGroupManagerActionManagerPatch instanceGroupManagerActionManagerPatchModel = new InstanceGroupManagerActionManagerPatch.Builder() - .maxMembershipCount(Long.valueOf("10")) - .minMembershipCount(Long.valueOf("10")) - .build(); + .maxMembershipCount(Long.valueOf("10")) + .minMembershipCount(Long.valueOf("10")) + .build(); InstanceGroupManagerActionPatch instanceGroupManagerActionPatchModel = new InstanceGroupManagerActionPatch.Builder() - .cronSpec("*/5 1,2,3 * * *") - .group(instanceGroupManagerActionGroupPatchModel) - .manager(instanceGroupManagerActionManagerPatchModel) - .name("my-instance-group-manager-action") - .runAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .build(); + .cronSpec("*/5 1,2,3 * * *") + .group(instanceGroupManagerActionGroupPatchModel) + .manager(instanceGroupManagerActionManagerPatchModel) + .name("my-instance-group-manager-action") + .runAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .build(); Map instanceGroupManagerActionPatchModelAsPatch = instanceGroupManagerActionPatchModel.asPatch(); UpdateInstanceGroupManagerActionOptions updateInstanceGroupManagerActionOptions = new UpdateInstanceGroupManagerActionOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .id("testString") - .instanceGroupManagerActionPatch(instanceGroupManagerActionPatchModelAsPatch) - .build(); + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .id("testString") + .instanceGroupManagerActionPatch(instanceGroupManagerActionPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptions).execute(); @@ -4734,16 +4560,6 @@ public void testUpdateInstanceGroupManagerAction() throws Exception { InstanceGroupManagerAction instanceGroupManagerActionResult = response.getResult(); assertNotNull(instanceGroupManagerActionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4754,11 +4570,11 @@ public void testUpdateInstanceGroupManagerAction() throws Exception { public void testListInstanceGroupManagerPolicies() throws Exception { try { ListInstanceGroupManagerPoliciesOptions listInstanceGroupManagerPoliciesOptions = new ListInstanceGroupManagerPoliciesOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptions).execute(); @@ -4769,15 +4585,39 @@ public void testListInstanceGroupManagerPolicies() throws Exception { InstanceGroupManagerPolicyCollection instanceGroupManagerPolicyCollectionResult = response.getResult(); assertNotNull(instanceGroupManagerPolicyCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + @Test(dependsOnMethods = { "testListInstanceGroupManagerPolicies" }) + public void testListInstanceGroupManagerPoliciesWithPager() throws Exception { + try { + ListInstanceGroupManagerPoliciesOptions options = new ListInstanceGroupManagerPoliciesOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + InstanceGroupManagerPoliciesPager pager = new InstanceGroupManagerPoliciesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + // Test getAll(); + pager = new InstanceGroupManagerPoliciesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4788,17 +4628,17 @@ public void testListInstanceGroupManagerPolicies() throws Exception { public void testCreateInstanceGroupManagerPolicy() throws Exception { try { InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype instanceGroupManagerPolicyPrototypeModel = new InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.Builder() - .name("my-instance-group-manager-policy") - .metricType("cpu") - .metricValue(Long.valueOf("26")) - .policyType("target") - .build(); + .name("my-instance-group-manager-policy") + .metricType("cpu") + .metricValue(Long.valueOf("26")) + .policyType("target") + .build(); CreateInstanceGroupManagerPolicyOptions createInstanceGroupManagerPolicyOptions = new CreateInstanceGroupManagerPolicyOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .instanceGroupManagerPolicyPrototype(instanceGroupManagerPolicyPrototypeModel) - .build(); + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .instanceGroupManagerPolicyPrototype(instanceGroupManagerPolicyPrototypeModel) + .build(); // Invoke operation Response response = service.createInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptions).execute(); @@ -4809,15 +4649,6 @@ public void testCreateInstanceGroupManagerPolicy() throws Exception { InstanceGroupManagerPolicy instanceGroupManagerPolicyResult = response.getResult(); assertNotNull(instanceGroupManagerPolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4828,10 +4659,10 @@ public void testCreateInstanceGroupManagerPolicy() throws Exception { public void testGetInstanceGroupManagerPolicy() throws Exception { try { GetInstanceGroupManagerPolicyOptions getInstanceGroupManagerPolicyOptions = new GetInstanceGroupManagerPolicyOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .id("testString") - .build(); + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getInstanceGroupManagerPolicy(getInstanceGroupManagerPolicyOptions).execute(); @@ -4842,15 +4673,6 @@ public void testGetInstanceGroupManagerPolicy() throws Exception { InstanceGroupManagerPolicy instanceGroupManagerPolicyResult = response.getResult(); assertNotNull(instanceGroupManagerPolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4861,18 +4683,18 @@ public void testGetInstanceGroupManagerPolicy() throws Exception { public void testUpdateInstanceGroupManagerPolicy() throws Exception { try { InstanceGroupManagerPolicyPatch instanceGroupManagerPolicyPatchModel = new InstanceGroupManagerPolicyPatch.Builder() - .metricType("cpu") - .metricValue(Long.valueOf("26")) - .name("my-instance-group-manager-policy") - .build(); + .metricType("cpu") + .metricValue(Long.valueOf("26")) + .name("my-instance-group-manager-policy") + .build(); Map instanceGroupManagerPolicyPatchModelAsPatch = instanceGroupManagerPolicyPatchModel.asPatch(); UpdateInstanceGroupManagerPolicyOptions updateInstanceGroupManagerPolicyOptions = new UpdateInstanceGroupManagerPolicyOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .id("testString") - .instanceGroupManagerPolicyPatch(instanceGroupManagerPolicyPatchModelAsPatch) - .build(); + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .id("testString") + .instanceGroupManagerPolicyPatch(instanceGroupManagerPolicyPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptions).execute(); @@ -4883,16 +4705,6 @@ public void testUpdateInstanceGroupManagerPolicy() throws Exception { InstanceGroupManagerPolicy instanceGroupManagerPolicyResult = response.getResult(); assertNotNull(instanceGroupManagerPolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4903,10 +4715,10 @@ public void testUpdateInstanceGroupManagerPolicy() throws Exception { public void testListInstanceGroupMemberships() throws Exception { try { ListInstanceGroupMembershipsOptions listInstanceGroupMembershipsOptions = new ListInstanceGroupMembershipsOptions.Builder() - .instanceGroupId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .instanceGroupId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listInstanceGroupMemberships(listInstanceGroupMembershipsOptions).execute(); @@ -4917,15 +4729,38 @@ public void testListInstanceGroupMemberships() throws Exception { InstanceGroupMembershipCollection instanceGroupMembershipCollectionResult = response.getResult(); assertNotNull(instanceGroupMembershipCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListInstanceGroupMemberships" }) + public void testListInstanceGroupMembershipsWithPager() throws Exception { + try { + ListInstanceGroupMembershipsOptions options = new ListInstanceGroupMembershipsOptions.Builder() + .instanceGroupId("testString") + .limit(Long.valueOf("10")) + .build(); - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + // Test getNext(). + List allResults = new ArrayList<>(); + InstanceGroupMembershipsPager pager = new InstanceGroupMembershipsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + // Test getAll(); + pager = new InstanceGroupMembershipsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4936,9 +4771,9 @@ public void testListInstanceGroupMemberships() throws Exception { public void testGetInstanceGroupMembership() throws Exception { try { GetInstanceGroupMembershipOptions getInstanceGroupMembershipOptions = new GetInstanceGroupMembershipOptions.Builder() - .instanceGroupId("testString") - .id("testString") - .build(); + .instanceGroupId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getInstanceGroupMembership(getInstanceGroupMembershipOptions).execute(); @@ -4949,15 +4784,6 @@ public void testGetInstanceGroupMembership() throws Exception { InstanceGroupMembership instanceGroupMembershipResult = response.getResult(); assertNotNull(instanceGroupMembershipResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -4968,15 +4794,15 @@ public void testGetInstanceGroupMembership() throws Exception { public void testUpdateInstanceGroupMembership() throws Exception { try { InstanceGroupMembershipPatch instanceGroupMembershipPatchModel = new InstanceGroupMembershipPatch.Builder() - .name("my-instance-group-membership") - .build(); + .name("my-instance-group-membership") + .build(); Map instanceGroupMembershipPatchModelAsPatch = instanceGroupMembershipPatchModel.asPatch(); UpdateInstanceGroupMembershipOptions updateInstanceGroupMembershipOptions = new UpdateInstanceGroupMembershipOptions.Builder() - .instanceGroupId("testString") - .id("testString") - .instanceGroupMembershipPatch(instanceGroupMembershipPatchModelAsPatch) - .build(); + .instanceGroupId("testString") + .id("testString") + .instanceGroupMembershipPatch(instanceGroupMembershipPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateInstanceGroupMembership(updateInstanceGroupMembershipOptions).execute(); @@ -4987,16 +4813,6 @@ public void testUpdateInstanceGroupMembership() throws Exception { InstanceGroupMembership instanceGroupMembershipResult = response.getResult(); assertNotNull(instanceGroupMembershipResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5007,12 +4823,12 @@ public void testUpdateInstanceGroupMembership() throws Exception { public void testListDedicatedHostGroups() throws Exception { try { ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions = new ListDedicatedHostGroupsOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .zoneName("testString") - .name("testString") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .zoneName("testString") + .name("testString") + .build(); // Invoke operation Response response = service.listDedicatedHostGroups(listDedicatedHostGroupsOptions).execute(); @@ -5029,24 +4845,58 @@ public void testListDedicatedHostGroups() throws Exception { } } + @Test(dependsOnMethods = { "testListDedicatedHostGroups" }) + public void testListDedicatedHostGroupsWithPager() throws Exception { + try { + ListDedicatedHostGroupsOptions options = new ListDedicatedHostGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .zoneName("testString") + .name("testString") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + DedicatedHostGroupsPager pager = new DedicatedHostGroupsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new DedicatedHostGroupsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateDedicatedHostGroup() throws Exception { try { ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); + .name("us-south-1") + .build(); CreateDedicatedHostGroupOptions createDedicatedHostGroupOptions = new CreateDedicatedHostGroupOptions.Builder() - .xClass("mx2") - .family("balanced") - .name("testString") - .resourceGroup(resourceGroupIdentityModel) - .zone(zoneIdentityModel) - .build(); + .xClass("mx2") + .family("balanced") + .name("testString") + .resourceGroup(resourceGroupIdentityModel) + .zone(zoneIdentityModel) + .build(); // Invoke operation Response response = service.createDedicatedHostGroup(createDedicatedHostGroupOptions).execute(); @@ -5057,15 +4907,6 @@ public void testCreateDedicatedHostGroup() throws Exception { DedicatedHostGroup dedicatedHostGroupResult = response.getResult(); assertNotNull(dedicatedHostGroupResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5076,8 +4917,8 @@ public void testCreateDedicatedHostGroup() throws Exception { public void testGetDedicatedHostGroup() throws Exception { try { GetDedicatedHostGroupOptions getDedicatedHostGroupOptions = new GetDedicatedHostGroupOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getDedicatedHostGroup(getDedicatedHostGroupOptions).execute(); @@ -5088,15 +4929,6 @@ public void testGetDedicatedHostGroup() throws Exception { DedicatedHostGroup dedicatedHostGroupResult = response.getResult(); assertNotNull(dedicatedHostGroupResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5107,14 +4939,14 @@ public void testGetDedicatedHostGroup() throws Exception { public void testUpdateDedicatedHostGroup() throws Exception { try { DedicatedHostGroupPatch dedicatedHostGroupPatchModel = new DedicatedHostGroupPatch.Builder() - .name("my-host-group-modified") - .build(); + .name("my-host-group-updated") + .build(); Map dedicatedHostGroupPatchModelAsPatch = dedicatedHostGroupPatchModel.asPatch(); UpdateDedicatedHostGroupOptions updateDedicatedHostGroupOptions = new UpdateDedicatedHostGroupOptions.Builder() - .id("testString") - .dedicatedHostGroupPatch(dedicatedHostGroupPatchModelAsPatch) - .build(); + .id("testString") + .dedicatedHostGroupPatch(dedicatedHostGroupPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateDedicatedHostGroup(updateDedicatedHostGroupOptions).execute(); @@ -5125,17 +4957,6 @@ public void testUpdateDedicatedHostGroup() throws Exception { DedicatedHostGroup dedicatedHostGroupResult = response.getResult(); assertNotNull(dedicatedHostGroupResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5146,9 +4967,9 @@ public void testUpdateDedicatedHostGroup() throws Exception { public void testListDedicatedHostProfiles() throws Exception { try { ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptions = new ListDedicatedHostProfilesOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listDedicatedHostProfiles(listDedicatedHostProfilesOptions).execute(); @@ -5165,12 +4986,43 @@ public void testListDedicatedHostProfiles() throws Exception { } } + @Test(dependsOnMethods = { "testListDedicatedHostProfiles" }) + public void testListDedicatedHostProfilesWithPager() throws Exception { + try { + ListDedicatedHostProfilesOptions options = new ListDedicatedHostProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + DedicatedHostProfilesPager pager = new DedicatedHostProfilesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new DedicatedHostProfilesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testGetDedicatedHostProfile() throws Exception { try { GetDedicatedHostProfileOptions getDedicatedHostProfileOptions = new GetDedicatedHostProfileOptions.Builder() - .name("testString") - .build(); + .name("testString") + .build(); // Invoke operation Response response = service.getDedicatedHostProfile(getDedicatedHostProfileOptions).execute(); @@ -5181,15 +5033,6 @@ public void testGetDedicatedHostProfile() throws Exception { DedicatedHostProfile dedicatedHostProfileResult = response.getResult(); assertNotNull(dedicatedHostProfileResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5200,13 +5043,13 @@ public void testGetDedicatedHostProfile() throws Exception { public void testListDedicatedHosts() throws Exception { try { ListDedicatedHostsOptions listDedicatedHostsOptions = new ListDedicatedHostsOptions.Builder() - .dedicatedHostGroupId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .zoneName("testString") - .name("testString") - .build(); + .dedicatedHostGroupId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .zoneName("testString") + .name("testString") + .build(); // Invoke operation Response response = service.listDedicatedHosts(listDedicatedHostsOptions).execute(); @@ -5223,32 +5066,67 @@ public void testListDedicatedHosts() throws Exception { } } + @Test(dependsOnMethods = { "testListDedicatedHosts" }) + public void testListDedicatedHostsWithPager() throws Exception { + try { + ListDedicatedHostsOptions options = new ListDedicatedHostsOptions.Builder() + .dedicatedHostGroupId("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .zoneName("testString") + .name("testString") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + DedicatedHostsPager pager = new DedicatedHostsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new DedicatedHostsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateDedicatedHost() throws Exception { try { DedicatedHostProfileIdentityByName dedicatedHostProfileIdentityModel = new DedicatedHostProfileIdentityByName.Builder() - .name("m-62x496") - .build(); + .name("m-62x496") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); DedicatedHostGroupIdentityById dedicatedHostGroupIdentityModel = new DedicatedHostGroupIdentityById.Builder() - .id("0c8eccb4-271c-4518-956c-32bfce5cf83b") - .build(); + .id("0c8eccb4-271c-4518-956c-32bfce5cf83b") + .build(); DedicatedHostPrototypeDedicatedHostByGroup dedicatedHostPrototypeModel = new DedicatedHostPrototypeDedicatedHostByGroup.Builder() - .instancePlacementEnabled(true) - .name("my-host") - .profile(dedicatedHostProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .group(dedicatedHostGroupIdentityModel) - .build(); + .instancePlacementEnabled(true) + .name("my-host") + .profile(dedicatedHostProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .group(dedicatedHostGroupIdentityModel) + .build(); CreateDedicatedHostOptions createDedicatedHostOptions = new CreateDedicatedHostOptions.Builder() - .dedicatedHostPrototype(dedicatedHostPrototypeModel) - .build(); + .dedicatedHostPrototype(dedicatedHostPrototypeModel) + .build(); // Invoke operation Response response = service.createDedicatedHost(createDedicatedHostOptions).execute(); @@ -5259,16 +5137,6 @@ public void testCreateDedicatedHost() throws Exception { DedicatedHost dedicatedHostResult = response.getResult(); assertNotNull(dedicatedHostResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5279,8 +5147,8 @@ public void testCreateDedicatedHost() throws Exception { public void testListDedicatedHostDisks() throws Exception { try { ListDedicatedHostDisksOptions listDedicatedHostDisksOptions = new ListDedicatedHostDisksOptions.Builder() - .dedicatedHostId("testString") - .build(); + .dedicatedHostId("testString") + .build(); // Invoke operation Response response = service.listDedicatedHostDisks(listDedicatedHostDisksOptions).execute(); @@ -5291,15 +5159,6 @@ public void testListDedicatedHostDisks() throws Exception { DedicatedHostDiskCollection dedicatedHostDiskCollectionResult = response.getResult(); assertNotNull(dedicatedHostDiskCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5310,9 +5169,9 @@ public void testListDedicatedHostDisks() throws Exception { public void testGetDedicatedHostDisk() throws Exception { try { GetDedicatedHostDiskOptions getDedicatedHostDiskOptions = new GetDedicatedHostDiskOptions.Builder() - .dedicatedHostId("testString") - .id("testString") - .build(); + .dedicatedHostId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getDedicatedHostDisk(getDedicatedHostDiskOptions).execute(); @@ -5323,15 +5182,6 @@ public void testGetDedicatedHostDisk() throws Exception { DedicatedHostDisk dedicatedHostDiskResult = response.getResult(); assertNotNull(dedicatedHostDiskResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5342,15 +5192,15 @@ public void testGetDedicatedHostDisk() throws Exception { public void testUpdateDedicatedHostDisk() throws Exception { try { DedicatedHostDiskPatch dedicatedHostDiskPatchModel = new DedicatedHostDiskPatch.Builder() - .name("my-disk-updated") - .build(); + .name("my-disk-updated") + .build(); Map dedicatedHostDiskPatchModelAsPatch = dedicatedHostDiskPatchModel.asPatch(); UpdateDedicatedHostDiskOptions updateDedicatedHostDiskOptions = new UpdateDedicatedHostDiskOptions.Builder() - .dedicatedHostId("testString") - .id("testString") - .dedicatedHostDiskPatch(dedicatedHostDiskPatchModelAsPatch) - .build(); + .dedicatedHostId("testString") + .id("testString") + .dedicatedHostDiskPatch(dedicatedHostDiskPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateDedicatedHostDisk(updateDedicatedHostDiskOptions).execute(); @@ -5361,16 +5211,6 @@ public void testUpdateDedicatedHostDisk() throws Exception { DedicatedHostDisk dedicatedHostDiskResult = response.getResult(); assertNotNull(dedicatedHostDiskResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5381,8 +5221,8 @@ public void testUpdateDedicatedHostDisk() throws Exception { public void testGetDedicatedHost() throws Exception { try { GetDedicatedHostOptions getDedicatedHostOptions = new GetDedicatedHostOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getDedicatedHost(getDedicatedHostOptions).execute(); @@ -5393,15 +5233,6 @@ public void testGetDedicatedHost() throws Exception { DedicatedHost dedicatedHostResult = response.getResult(); assertNotNull(dedicatedHostResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5412,15 +5243,15 @@ public void testGetDedicatedHost() throws Exception { public void testUpdateDedicatedHost() throws Exception { try { DedicatedHostPatch dedicatedHostPatchModel = new DedicatedHostPatch.Builder() - .instancePlacementEnabled(true) - .name("my-host") - .build(); + .instancePlacementEnabled(true) + .name("my-host") + .build(); Map dedicatedHostPatchModelAsPatch = dedicatedHostPatchModel.asPatch(); UpdateDedicatedHostOptions updateDedicatedHostOptions = new UpdateDedicatedHostOptions.Builder() - .id("testString") - .dedicatedHostPatch(dedicatedHostPatchModelAsPatch) - .build(); + .id("testString") + .dedicatedHostPatch(dedicatedHostPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateDedicatedHost(updateDedicatedHostOptions).execute(); @@ -5431,16 +5262,6 @@ public void testUpdateDedicatedHost() throws Exception { DedicatedHost dedicatedHostResult = response.getResult(); assertNotNull(dedicatedHostResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5451,12 +5272,12 @@ public void testUpdateDedicatedHost() throws Exception { public void testListBackupPolicies() throws Exception { try { ListBackupPoliciesOptions listBackupPoliciesOptions = new ListBackupPoliciesOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .name("testString") - .tag("testString") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .tag("testString") + .build(); // Invoke operation Response response = service.listBackupPolicies(listBackupPoliciesOptions).execute(); @@ -5473,34 +5294,68 @@ public void testListBackupPolicies() throws Exception { } } + @Test(dependsOnMethods = { "testListBackupPolicies" }) + public void testListBackupPoliciesWithPager() throws Exception { + try { + ListBackupPoliciesOptions options = new ListBackupPoliciesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .tag("testString") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + BackupPoliciesPager pager = new BackupPoliciesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new BackupPoliciesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateBackupPolicy() throws Exception { try { BackupPolicyPlanDeletionTriggerPrototype backupPolicyPlanDeletionTriggerPrototypeModel = new BackupPolicyPlanDeletionTriggerPrototype.Builder() - .deleteAfter(Long.valueOf("20")) - .deleteOverCount(Long.valueOf("20")) - .build(); + .deleteAfter(Long.valueOf("20")) + .deleteOverCount(Long.valueOf("20")) + .build(); BackupPolicyPlanPrototype backupPolicyPlanPrototypeModel = new BackupPolicyPlanPrototype.Builder() - .active(true) - .attachUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))) - .copyUserTags(true) - .cronSpec("*/5 1,2,3 * * *") - .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) - .name("my-policy-plan") - .build(); + .active(true) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) + .copyUserTags(true) + .cronSpec("*/5 1,2,3 * * *") + .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) + .name("my-policy-plan") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); CreateBackupPolicyOptions createBackupPolicyOptions = new CreateBackupPolicyOptions.Builder() - .matchResourceTypes(new java.util.ArrayList(java.util.Arrays.asList("volume"))) - .matchUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-policy"))) - .name("my-backup-policy") - .plans(new java.util.ArrayList(java.util.Arrays.asList(backupPolicyPlanPrototypeModel))) - .resourceGroup(resourceGroupIdentityModel) - .build(); + .matchResourceTypes(java.util.Arrays.asList("volume")) + .matchUserTags(java.util.Arrays.asList("my-daily-backup-policy")) + .name("my-backup-policy") + .plans(java.util.Arrays.asList(backupPolicyPlanPrototypeModel)) + .resourceGroup(resourceGroupIdentityModel) + .build(); // Invoke operation Response response = service.createBackupPolicy(createBackupPolicyOptions).execute(); @@ -5511,15 +5366,6 @@ public void testCreateBackupPolicy() throws Exception { BackupPolicy backupPolicyResult = response.getResult(); assertNotNull(backupPolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5530,9 +5376,9 @@ public void testCreateBackupPolicy() throws Exception { public void testListBackupPolicyPlans() throws Exception { try { ListBackupPolicyPlansOptions listBackupPolicyPlansOptions = new ListBackupPolicyPlansOptions.Builder() - .backupPolicyId("testString") - .name("testString") - .build(); + .backupPolicyId("testString") + .name("testString") + .build(); // Invoke operation Response response = service.listBackupPolicyPlans(listBackupPolicyPlansOptions).execute(); @@ -5543,15 +5389,6 @@ public void testListBackupPolicyPlans() throws Exception { BackupPolicyPlanCollection backupPolicyPlanCollectionResult = response.getResult(); assertNotNull(backupPolicyPlanCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5562,19 +5399,19 @@ public void testListBackupPolicyPlans() throws Exception { public void testCreateBackupPolicyPlan() throws Exception { try { BackupPolicyPlanDeletionTriggerPrototype backupPolicyPlanDeletionTriggerPrototypeModel = new BackupPolicyPlanDeletionTriggerPrototype.Builder() - .deleteAfter(Long.valueOf("20")) - .deleteOverCount(Long.valueOf("20")) - .build(); + .deleteAfter(Long.valueOf("20")) + .deleteOverCount(Long.valueOf("20")) + .build(); CreateBackupPolicyPlanOptions createBackupPolicyPlanOptions = new CreateBackupPolicyPlanOptions.Builder() - .backupPolicyId("testString") - .cronSpec("*/5 1,2,3 * * *") - .active(true) - .attachUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))) - .copyUserTags(true) - .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) - .name("my-policy-plan") - .build(); + .backupPolicyId("testString") + .cronSpec("*/5 1,2,3 * * *") + .active(true) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) + .copyUserTags(true) + .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) + .name("my-policy-plan") + .build(); // Invoke operation Response response = service.createBackupPolicyPlan(createBackupPolicyPlanOptions).execute(); @@ -5585,16 +5422,6 @@ public void testCreateBackupPolicyPlan() throws Exception { BackupPolicyPlan backupPolicyPlanResult = response.getResult(); assertNotNull(backupPolicyPlanResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5605,9 +5432,9 @@ public void testCreateBackupPolicyPlan() throws Exception { public void testGetBackupPolicyPlan() throws Exception { try { GetBackupPolicyPlanOptions getBackupPolicyPlanOptions = new GetBackupPolicyPlanOptions.Builder() - .backupPolicyId("testString") - .id("testString") - .build(); + .backupPolicyId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getBackupPolicyPlan(getBackupPolicyPlanOptions).execute(); @@ -5618,15 +5445,6 @@ public void testGetBackupPolicyPlan() throws Exception { BackupPolicyPlan backupPolicyPlanResult = response.getResult(); assertNotNull(backupPolicyPlanResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5637,26 +5455,26 @@ public void testGetBackupPolicyPlan() throws Exception { public void testUpdateBackupPolicyPlan() throws Exception { try { BackupPolicyPlanDeletionTriggerPatch backupPolicyPlanDeletionTriggerPatchModel = new BackupPolicyPlanDeletionTriggerPatch.Builder() - .deleteAfter(Long.valueOf("20")) - .deleteOverCount(Long.valueOf("26")) - .build(); + .deleteAfter(Long.valueOf("20")) + .deleteOverCount(Long.valueOf("26")) + .build(); BackupPolicyPlanPatch backupPolicyPlanPatchModel = new BackupPolicyPlanPatch.Builder() - .active(true) - .attachUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))) - .copyUserTags(true) - .cronSpec("*/5 1,2,3 * * *") - .deletionTrigger(backupPolicyPlanDeletionTriggerPatchModel) - .name("my-policy-plan") - .build(); + .active(true) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) + .copyUserTags(true) + .cronSpec("*/5 1,2,3 * * *") + .deletionTrigger(backupPolicyPlanDeletionTriggerPatchModel) + .name("my-policy-plan") + .build(); Map backupPolicyPlanPatchModelAsPatch = backupPolicyPlanPatchModel.asPatch(); UpdateBackupPolicyPlanOptions updateBackupPolicyPlanOptions = new UpdateBackupPolicyPlanOptions.Builder() - .backupPolicyId("testString") - .id("testString") - .backupPolicyPlanPatch(backupPolicyPlanPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") - .build(); + .backupPolicyId("testString") + .id("testString") + .backupPolicyPlanPatch(backupPolicyPlanPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.updateBackupPolicyPlan(updateBackupPolicyPlanOptions).execute(); @@ -5667,17 +5485,6 @@ public void testUpdateBackupPolicyPlan() throws Exception { BackupPolicyPlan backupPolicyPlanResult = response.getResult(); assertNotNull(backupPolicyPlanResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 412 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5688,8 +5495,8 @@ public void testUpdateBackupPolicyPlan() throws Exception { public void testGetBackupPolicy() throws Exception { try { GetBackupPolicyOptions getBackupPolicyOptions = new GetBackupPolicyOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getBackupPolicy(getBackupPolicyOptions).execute(); @@ -5700,15 +5507,6 @@ public void testGetBackupPolicy() throws Exception { BackupPolicy backupPolicyResult = response.getResult(); assertNotNull(backupPolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5719,16 +5517,16 @@ public void testGetBackupPolicy() throws Exception { public void testUpdateBackupPolicy() throws Exception { try { BackupPolicyPatch backupPolicyPatchModel = new BackupPolicyPatch.Builder() - .matchUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-policy"))) - .name("my-backup-policy") - .build(); + .matchUserTags(java.util.Arrays.asList("my-daily-backup-policy")) + .name("my-backup-policy") + .build(); Map backupPolicyPatchModelAsPatch = backupPolicyPatchModel.asPatch(); UpdateBackupPolicyOptions updateBackupPolicyOptions = new UpdateBackupPolicyOptions.Builder() - .id("testString") - .backupPolicyPatch(backupPolicyPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") - .build(); + .id("testString") + .backupPolicyPatch(backupPolicyPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.updateBackupPolicy(updateBackupPolicyOptions).execute(); @@ -5739,17 +5537,6 @@ public void testUpdateBackupPolicy() throws Exception { BackupPolicy backupPolicyResult = response.getResult(); assertNotNull(backupPolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 412 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5760,9 +5547,9 @@ public void testUpdateBackupPolicy() throws Exception { public void testListPlacementGroups() throws Exception { try { ListPlacementGroupsOptions listPlacementGroupsOptions = new ListPlacementGroupsOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listPlacementGroups(listPlacementGroupsOptions).execute(); @@ -5779,18 +5566,49 @@ public void testListPlacementGroups() throws Exception { } } + @Test(dependsOnMethods = { "testListPlacementGroups" }) + public void testListPlacementGroupsWithPager() throws Exception { + try { + ListPlacementGroupsOptions options = new ListPlacementGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + PlacementGroupsPager pager = new PlacementGroupsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new PlacementGroupsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreatePlacementGroup() throws Exception { try { ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); CreatePlacementGroupOptions createPlacementGroupOptions = new CreatePlacementGroupOptions.Builder() - .strategy("host_spread") - .name("my-placement-group") - .resourceGroup(resourceGroupIdentityModel) - .build(); + .strategy("host_spread") + .name("my-placement-group") + .resourceGroup(resourceGroupIdentityModel) + .build(); // Invoke operation Response response = service.createPlacementGroup(createPlacementGroupOptions).execute(); @@ -5801,15 +5619,6 @@ public void testCreatePlacementGroup() throws Exception { PlacementGroup placementGroupResult = response.getResult(); assertNotNull(placementGroupResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5820,8 +5629,8 @@ public void testCreatePlacementGroup() throws Exception { public void testGetPlacementGroup() throws Exception { try { GetPlacementGroupOptions getPlacementGroupOptions = new GetPlacementGroupOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getPlacementGroup(getPlacementGroupOptions).execute(); @@ -5832,15 +5641,6 @@ public void testGetPlacementGroup() throws Exception { PlacementGroup placementGroupResult = response.getResult(); assertNotNull(placementGroupResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5851,14 +5651,14 @@ public void testGetPlacementGroup() throws Exception { public void testUpdatePlacementGroup() throws Exception { try { PlacementGroupPatch placementGroupPatchModel = new PlacementGroupPatch.Builder() - .name("my-placement-group") - .build(); + .name("my-placement-group") + .build(); Map placementGroupPatchModelAsPatch = placementGroupPatchModel.asPatch(); UpdatePlacementGroupOptions updatePlacementGroupOptions = new UpdatePlacementGroupOptions.Builder() - .id("testString") - .placementGroupPatch(placementGroupPatchModelAsPatch) - .build(); + .id("testString") + .placementGroupPatch(placementGroupPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updatePlacementGroup(updatePlacementGroupOptions).execute(); @@ -5869,16 +5669,6 @@ public void testUpdatePlacementGroup() throws Exception { PlacementGroup placementGroupResult = response.getResult(); assertNotNull(placementGroupResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5889,9 +5679,9 @@ public void testUpdatePlacementGroup() throws Exception { public void testListBareMetalServerProfiles() throws Exception { try { ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptions = new ListBareMetalServerProfilesOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listBareMetalServerProfiles(listBareMetalServerProfilesOptions).execute(); @@ -5908,12 +5698,43 @@ public void testListBareMetalServerProfiles() throws Exception { } } + @Test(dependsOnMethods = { "testListBareMetalServerProfiles" }) + public void testListBareMetalServerProfilesWithPager() throws Exception { + try { + ListBareMetalServerProfilesOptions options = new ListBareMetalServerProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + BareMetalServerProfilesPager pager = new BareMetalServerProfilesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new BareMetalServerProfilesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testGetBareMetalServerProfile() throws Exception { try { GetBareMetalServerProfileOptions getBareMetalServerProfileOptions = new GetBareMetalServerProfileOptions.Builder() - .name("testString") - .build(); + .name("testString") + .build(); // Invoke operation Response response = service.getBareMetalServerProfile(getBareMetalServerProfileOptions).execute(); @@ -5924,15 +5745,6 @@ public void testGetBareMetalServerProfile() throws Exception { BareMetalServerProfile bareMetalServerProfileResult = response.getResult(); assertNotNull(bareMetalServerProfileResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -5943,17 +5755,17 @@ public void testGetBareMetalServerProfile() throws Exception { public void testListBareMetalServers() throws Exception { try { ListBareMetalServersOptions listBareMetalServersOptions = new ListBareMetalServersOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .name("testString") - .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") - .networkInterfacesSubnetId("testString") - .networkInterfacesSubnetCrn("testString") - .networkInterfacesSubnetName("testString") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .networkInterfacesSubnetId("testString") + .networkInterfacesSubnetCrn("testString") + .networkInterfacesSubnetName("testString") + .build(); // Invoke operation Response response = service.listBareMetalServers(listBareMetalServersOptions).execute(); @@ -5970,86 +5782,123 @@ public void testListBareMetalServers() throws Exception { } } + @Test(dependsOnMethods = { "testListBareMetalServers" }) + public void testListBareMetalServersWithPager() throws Exception { + try { + ListBareMetalServersOptions options = new ListBareMetalServersOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .networkInterfacesSubnetId("testString") + .networkInterfacesSubnetCrn("testString") + .networkInterfacesSubnetName("testString") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + BareMetalServersPager pager = new BareMetalServersPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new BareMetalServersPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateBareMetalServer() throws Exception { try { ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() - .id("72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") - .build(); + .id("72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + .build(); KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() - .id("a6b1a881-2ce8-41a3-80fc-36316a73f803") - .build(); + .id("a6b1a881-2ce8-41a3-80fc-36316a73f803") + .build(); BareMetalServerInitializationPrototype bareMetalServerInitializationPrototypeModel = new BareMetalServerInitializationPrototype.Builder() - .image(imageIdentityModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) - .userData("testString") - .build(); + .image(imageIdentityModel) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .userData("testString") + .build(); NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); + .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); BareMetalServerPrimaryNetworkInterfacePrototype bareMetalServerPrimaryNetworkInterfacePrototypeModel = new BareMetalServerPrimaryNetworkInterfacePrototype.Builder() - .allowIpSpoofing(true) - .allowedVlans(new java.util.ArrayList(java.util.Arrays.asList(Long.valueOf("4")))) - .enableInfrastructureNat(true) - .interfaceType("pci") - .name("my-network-interface") - .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) - .subnet(subnetIdentityModel) - .build(); + .allowIpSpoofing(true) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) + .enableInfrastructureNat(true) + .interfaceType("pci") + .name("my-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); BareMetalServerProfileIdentityByName bareMetalServerProfileIdentityModel = new BareMetalServerProfileIdentityByName.Builder() - .name("bx2-metal-192x768") - .build(); + .name("bx2-metal-192x768") + .build(); ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.Builder() - .allowIpSpoofing(true) - .enableInfrastructureNat(true) - .name("my-network-interface") - .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) - .subnet(subnetIdentityModel) - .allowInterfaceToFloat(false) - .interfaceType("vlan") - .vlan(Long.valueOf("4")) - .build(); + .name("us-south-1") + .build(); + + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.Builder() + .allowIpSpoofing(true) + .enableInfrastructureNat(true) + .name("my-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .interfaceType("hipersocket") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); + .id("4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); CreateBareMetalServerOptions createBareMetalServerOptions = new CreateBareMetalServerOptions.Builder() - .initialization(bareMetalServerInitializationPrototypeModel) - .primaryNetworkInterface(bareMetalServerPrimaryNetworkInterfacePrototypeModel) - .profile(bareMetalServerProfileIdentityModel) - .zone(zoneIdentityModel) - .name("my-bare-metal-server") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(bareMetalServerNetworkInterfacePrototypeModel))) - .resourceGroup(resourceGroupIdentityModel) - .vpc(vpcIdentityModel) - .build(); + .initialization(bareMetalServerInitializationPrototypeModel) + .primaryNetworkInterface(bareMetalServerPrimaryNetworkInterfacePrototypeModel) + .profile(bareMetalServerProfileIdentityModel) + .zone(zoneIdentityModel) + .name("my-bare-metal-server") + .networkInterfaces(java.util.Arrays.asList(bareMetalServerNetworkInterfacePrototypeModel)) + .resourceGroup(resourceGroupIdentityModel) + .vpc(vpcIdentityModel) + .build(); // Invoke operation Response response = service.createBareMetalServer(createBareMetalServerOptions).execute(); @@ -6060,15 +5909,6 @@ public void testCreateBareMetalServer() throws Exception { BareMetalServer bareMetalServerResult = response.getResult(); assertNotNull(bareMetalServerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6079,10 +5919,10 @@ public void testCreateBareMetalServer() throws Exception { public void testCreateBareMetalServerConsoleAccessToken() throws Exception { try { CreateBareMetalServerConsoleAccessTokenOptions createBareMetalServerConsoleAccessTokenOptions = new CreateBareMetalServerConsoleAccessTokenOptions.Builder() - .bareMetalServerId("testString") - .consoleType("serial") - .force(false) - .build(); + .bareMetalServerId("testString") + .consoleType("serial") + .force(false) + .build(); // Invoke operation Response response = service.createBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptions).execute(); @@ -6093,16 +5933,6 @@ public void testCreateBareMetalServerConsoleAccessToken() throws Exception { BareMetalServerConsoleAccessToken bareMetalServerConsoleAccessTokenResult = response.getResult(); assertNotNull(bareMetalServerConsoleAccessTokenResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6113,8 +5943,8 @@ public void testCreateBareMetalServerConsoleAccessToken() throws Exception { public void testListBareMetalServerDisks() throws Exception { try { ListBareMetalServerDisksOptions listBareMetalServerDisksOptions = new ListBareMetalServerDisksOptions.Builder() - .bareMetalServerId("testString") - .build(); + .bareMetalServerId("testString") + .build(); // Invoke operation Response response = service.listBareMetalServerDisks(listBareMetalServerDisksOptions).execute(); @@ -6125,15 +5955,6 @@ public void testListBareMetalServerDisks() throws Exception { BareMetalServerDiskCollection bareMetalServerDiskCollectionResult = response.getResult(); assertNotNull(bareMetalServerDiskCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6144,9 +5965,9 @@ public void testListBareMetalServerDisks() throws Exception { public void testGetBareMetalServerDisk() throws Exception { try { GetBareMetalServerDiskOptions getBareMetalServerDiskOptions = new GetBareMetalServerDiskOptions.Builder() - .bareMetalServerId("testString") - .id("testString") - .build(); + .bareMetalServerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getBareMetalServerDisk(getBareMetalServerDiskOptions).execute(); @@ -6157,15 +5978,6 @@ public void testGetBareMetalServerDisk() throws Exception { BareMetalServerDisk bareMetalServerDiskResult = response.getResult(); assertNotNull(bareMetalServerDiskResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6176,15 +5988,15 @@ public void testGetBareMetalServerDisk() throws Exception { public void testUpdateBareMetalServerDisk() throws Exception { try { BareMetalServerDiskPatch bareMetalServerDiskPatchModel = new BareMetalServerDiskPatch.Builder() - .name("my-bare-metal-server-disk-updated") - .build(); + .name("my-bare-metal-server-disk-updated") + .build(); Map bareMetalServerDiskPatchModelAsPatch = bareMetalServerDiskPatchModel.asPatch(); UpdateBareMetalServerDiskOptions updateBareMetalServerDiskOptions = new UpdateBareMetalServerDiskOptions.Builder() - .bareMetalServerId("testString") - .id("testString") - .bareMetalServerDiskPatch(bareMetalServerDiskPatchModelAsPatch) - .build(); + .bareMetalServerId("testString") + .id("testString") + .bareMetalServerDiskPatch(bareMetalServerDiskPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateBareMetalServerDisk(updateBareMetalServerDiskOptions).execute(); @@ -6195,16 +6007,6 @@ public void testUpdateBareMetalServerDisk() throws Exception { BareMetalServerDisk bareMetalServerDiskResult = response.getResult(); assertNotNull(bareMetalServerDiskResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6215,10 +6017,10 @@ public void testUpdateBareMetalServerDisk() throws Exception { public void testListBareMetalServerNetworkInterfaces() throws Exception { try { ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptions = new ListBareMetalServerNetworkInterfacesOptions.Builder() - .bareMetalServerId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .bareMetalServerId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptions).execute(); @@ -6229,15 +6031,38 @@ public void testListBareMetalServerNetworkInterfaces() throws Exception { BareMetalServerNetworkInterfaceCollection bareMetalServerNetworkInterfaceCollectionResult = response.getResult(); assertNotNull(bareMetalServerNetworkInterfaceCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListBareMetalServerNetworkInterfaces" }) + public void testListBareMetalServerNetworkInterfacesWithPager() throws Exception { + try { + ListBareMetalServerNetworkInterfacesOptions options = new ListBareMetalServerNetworkInterfacesOptions.Builder() + .bareMetalServerId("testString") + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + BareMetalServerNetworkInterfacesPager pager = new BareMetalServerNetworkInterfacesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + // Test getAll(); + pager = new BareMetalServerNetworkInterfacesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6248,35 +6073,33 @@ public void testListBareMetalServerNetworkInterfaces() throws Exception { public void testCreateBareMetalServerNetworkInterface() throws Exception { try { NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); + .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.Builder() - .allowIpSpoofing(true) - .enableInfrastructureNat(true) - .name("my-network-interface") - .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) - .subnet(subnetIdentityModel) - .allowInterfaceToFloat(false) - .interfaceType("vlan") - .vlan(Long.valueOf("4")) - .build(); + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.Builder() + .allowIpSpoofing(true) + .enableInfrastructureNat(true) + .name("my-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .interfaceType("hipersocket") + .build(); CreateBareMetalServerNetworkInterfaceOptions createBareMetalServerNetworkInterfaceOptions = new CreateBareMetalServerNetworkInterfaceOptions.Builder() - .bareMetalServerId("testString") - .bareMetalServerNetworkInterfacePrototype(bareMetalServerNetworkInterfacePrototypeModel) - .build(); + .bareMetalServerId("testString") + .bareMetalServerNetworkInterfacePrototype(bareMetalServerNetworkInterfacePrototypeModel) + .build(); // Invoke operation Response response = service.createBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptions).execute(); @@ -6287,16 +6110,6 @@ public void testCreateBareMetalServerNetworkInterface() throws Exception { BareMetalServerNetworkInterface bareMetalServerNetworkInterfaceResult = response.getResult(); assertNotNull(bareMetalServerNetworkInterfaceResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6307,9 +6120,9 @@ public void testCreateBareMetalServerNetworkInterface() throws Exception { public void testGetBareMetalServerNetworkInterface() throws Exception { try { GetBareMetalServerNetworkInterfaceOptions getBareMetalServerNetworkInterfaceOptions = new GetBareMetalServerNetworkInterfaceOptions.Builder() - .bareMetalServerId("testString") - .id("testString") - .build(); + .bareMetalServerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptions).execute(); @@ -6320,15 +6133,6 @@ public void testGetBareMetalServerNetworkInterface() throws Exception { BareMetalServerNetworkInterface bareMetalServerNetworkInterfaceResult = response.getResult(); assertNotNull(bareMetalServerNetworkInterfaceResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6339,18 +6143,18 @@ public void testGetBareMetalServerNetworkInterface() throws Exception { public void testUpdateBareMetalServerNetworkInterface() throws Exception { try { BareMetalServerNetworkInterfacePatch bareMetalServerNetworkInterfacePatchModel = new BareMetalServerNetworkInterfacePatch.Builder() - .allowIpSpoofing(true) - .allowedVlans(new java.util.ArrayList(java.util.Arrays.asList(Long.valueOf("4")))) - .enableInfrastructureNat(true) - .name("my-network-interface") - .build(); + .allowIpSpoofing(true) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) + .enableInfrastructureNat(true) + .name("my-network-interface") + .build(); Map bareMetalServerNetworkInterfacePatchModelAsPatch = bareMetalServerNetworkInterfacePatchModel.asPatch(); UpdateBareMetalServerNetworkInterfaceOptions updateBareMetalServerNetworkInterfaceOptions = new UpdateBareMetalServerNetworkInterfaceOptions.Builder() - .bareMetalServerId("testString") - .id("testString") - .bareMetalServerNetworkInterfacePatch(bareMetalServerNetworkInterfacePatchModelAsPatch) - .build(); + .bareMetalServerId("testString") + .id("testString") + .bareMetalServerNetworkInterfacePatch(bareMetalServerNetworkInterfacePatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptions).execute(); @@ -6361,16 +6165,6 @@ public void testUpdateBareMetalServerNetworkInterface() throws Exception { BareMetalServerNetworkInterface bareMetalServerNetworkInterfaceResult = response.getResult(); assertNotNull(bareMetalServerNetworkInterfaceResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6381,9 +6175,9 @@ public void testUpdateBareMetalServerNetworkInterface() throws Exception { public void testListBareMetalServerNetworkInterfaceFloatingIps() throws Exception { try { ListBareMetalServerNetworkInterfaceFloatingIpsOptions listBareMetalServerNetworkInterfaceFloatingIpsOptions = new ListBareMetalServerNetworkInterfaceFloatingIpsOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") - .build(); + .bareMetalServerId("testString") + .networkInterfaceId("testString") + .build(); // Invoke operation Response response = service.listBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptions).execute(); @@ -6394,15 +6188,6 @@ public void testListBareMetalServerNetworkInterfaceFloatingIps() throws Exceptio FloatingIPUnpaginatedCollection floatingIpUnpaginatedCollectionResult = response.getResult(); assertNotNull(floatingIpUnpaginatedCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6413,10 +6198,10 @@ public void testListBareMetalServerNetworkInterfaceFloatingIps() throws Exceptio public void testGetBareMetalServerNetworkInterfaceFloatingIp() throws Exception { try { GetBareMetalServerNetworkInterfaceFloatingIpOptions getBareMetalServerNetworkInterfaceFloatingIpOptions = new GetBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") - .id("testString") - .build(); + .bareMetalServerId("testString") + .networkInterfaceId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getBareMetalServerNetworkInterfaceFloatingIp(getBareMetalServerNetworkInterfaceFloatingIpOptions).execute(); @@ -6427,15 +6212,6 @@ public void testGetBareMetalServerNetworkInterfaceFloatingIp() throws Exception FloatingIP floatingIpResult = response.getResult(); assertNotNull(floatingIpResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6446,10 +6222,10 @@ public void testGetBareMetalServerNetworkInterfaceFloatingIp() throws Exception public void testAddBareMetalServerNetworkInterfaceFloatingIp() throws Exception { try { AddBareMetalServerNetworkInterfaceFloatingIpOptions addBareMetalServerNetworkInterfaceFloatingIpOptions = new AddBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") - .id("testString") - .build(); + .bareMetalServerId("testString") + .networkInterfaceId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.addBareMetalServerNetworkInterfaceFloatingIp(addBareMetalServerNetworkInterfaceFloatingIpOptions).execute(); @@ -6460,16 +6236,53 @@ public void testAddBareMetalServerNetworkInterfaceFloatingIp() throws Exception FloatingIP floatingIpResult = response.getResult(); assertNotNull(floatingIpResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test + public void testListBareMetalServerNetworkInterfaceIps() throws Exception { + try { + ListBareMetalServerNetworkInterfaceIpsOptions listBareMetalServerNetworkInterfaceIpsOptions = new ListBareMetalServerNetworkInterfaceIpsOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") + .build(); + + // Invoke operation + Response response = service.listBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ReservedIPCollectionNetworkInterfaceContext reservedIpCollectionNetworkInterfaceContextResult = response.getResult(); + + assertNotNull(reservedIpCollectionNetworkInterfaceContextResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test + public void testGetBareMetalServerNetworkInterfaceIp() throws Exception { + try { + GetBareMetalServerNetworkInterfaceIpOptions getBareMetalServerNetworkInterfaceIpOptions = new GetBareMetalServerNetworkInterfaceIpOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") + .id("testString") + .build(); - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // + // Invoke operation + Response response = service.getBareMetalServerNetworkInterfaceIp(getBareMetalServerNetworkInterfaceIpOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + ReservedIP reservedIpResult = response.getResult(); + + assertNotNull(reservedIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6480,8 +6293,8 @@ public void testAddBareMetalServerNetworkInterfaceFloatingIp() throws Exception public void testGetBareMetalServer() throws Exception { try { GetBareMetalServerOptions getBareMetalServerOptions = new GetBareMetalServerOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getBareMetalServer(getBareMetalServerOptions).execute(); @@ -6492,15 +6305,6 @@ public void testGetBareMetalServer() throws Exception { BareMetalServer bareMetalServerResult = response.getResult(); assertNotNull(bareMetalServerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6511,14 +6315,14 @@ public void testGetBareMetalServer() throws Exception { public void testUpdateBareMetalServer() throws Exception { try { BareMetalServerPatch bareMetalServerPatchModel = new BareMetalServerPatch.Builder() - .name("my-bare-metal-server") - .build(); + .name("my-bare-metal-server") + .build(); Map bareMetalServerPatchModelAsPatch = bareMetalServerPatchModel.asPatch(); UpdateBareMetalServerOptions updateBareMetalServerOptions = new UpdateBareMetalServerOptions.Builder() - .id("testString") - .bareMetalServerPatch(bareMetalServerPatchModelAsPatch) - .build(); + .id("testString") + .bareMetalServerPatch(bareMetalServerPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateBareMetalServer(updateBareMetalServerOptions).execute(); @@ -6529,17 +6333,6 @@ public void testUpdateBareMetalServer() throws Exception { BareMetalServer bareMetalServerResult = response.getResult(); assertNotNull(bareMetalServerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6550,8 +6343,8 @@ public void testUpdateBareMetalServer() throws Exception { public void testGetBareMetalServerInitialization() throws Exception { try { GetBareMetalServerInitializationOptions getBareMetalServerInitializationOptions = new GetBareMetalServerInitializationOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getBareMetalServerInitialization(getBareMetalServerInitializationOptions).execute(); @@ -6562,15 +6355,6 @@ public void testGetBareMetalServerInitialization() throws Exception { BareMetalServerInitialization bareMetalServerInitializationResult = response.getResult(); assertNotNull(bareMetalServerInitializationResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6581,25 +6365,14 @@ public void testGetBareMetalServerInitialization() throws Exception { public void testRestartBareMetalServer() throws Exception { try { RestartBareMetalServerOptions restartBareMetalServerOptions = new RestartBareMetalServerOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.restartBareMetalServer(restartBareMetalServerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6610,25 +6383,14 @@ public void testRestartBareMetalServer() throws Exception { public void testStartBareMetalServer() throws Exception { try { StartBareMetalServerOptions startBareMetalServerOptions = new StartBareMetalServerOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.startBareMetalServer(startBareMetalServerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6639,26 +6401,15 @@ public void testStartBareMetalServer() throws Exception { public void testStopBareMetalServer() throws Exception { try { StopBareMetalServerOptions stopBareMetalServerOptions = new StopBareMetalServerOptions.Builder() - .id("testString") - .type("hard") - .build(); + .id("testString") + .type("hard") + .build(); // Invoke operation Response response = service.stopBareMetalServer(stopBareMetalServerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6669,9 +6420,9 @@ public void testStopBareMetalServer() throws Exception { public void testListVolumeProfiles() throws Exception { try { ListVolumeProfilesOptions listVolumeProfilesOptions = new ListVolumeProfilesOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listVolumeProfiles(listVolumeProfilesOptions).execute(); @@ -6688,12 +6439,43 @@ public void testListVolumeProfiles() throws Exception { } } + @Test(dependsOnMethods = { "testListVolumeProfiles" }) + public void testListVolumeProfilesWithPager() throws Exception { + try { + ListVolumeProfilesOptions options = new ListVolumeProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + VolumeProfilesPager pager = new VolumeProfilesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new VolumeProfilesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testGetVolumeProfile() throws Exception { try { GetVolumeProfileOptions getVolumeProfileOptions = new GetVolumeProfileOptions.Builder() - .name("testString") - .build(); + .name("testString") + .build(); // Invoke operation Response response = service.getVolumeProfile(getVolumeProfileOptions).execute(); @@ -6704,15 +6486,6 @@ public void testGetVolumeProfile() throws Exception { VolumeProfile volumeProfileResult = response.getResult(); assertNotNull(volumeProfileResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6723,11 +6496,11 @@ public void testGetVolumeProfile() throws Exception { public void testListVolumes() throws Exception { try { ListVolumesOptions listVolumesOptions = new ListVolumesOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .name("testString") - .zoneName("testString") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .name("testString") + .zoneName("testString") + .build(); // Invoke operation Response response = service.listVolumes(listVolumesOptions).execute(); @@ -6744,39 +6517,72 @@ public void testListVolumes() throws Exception { } } + @Test(dependsOnMethods = { "testListVolumes" }) + public void testListVolumesWithPager() throws Exception { + try { + ListVolumesOptions options = new ListVolumesOptions.Builder() + .limit(Long.valueOf("10")) + .name("testString") + .zoneName("testString") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + VolumesPager pager = new VolumesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new VolumesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateVolume() throws Exception { try { VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() - .name("5iops-tier") - .build(); + .name("5iops-tier") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); + .name("us-south-1") + .build(); EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); VolumePrototypeVolumeByCapacity volumePrototypeModel = new VolumePrototypeVolumeByCapacity.Builder() - .iops(Long.valueOf("10000")) - .name("my-volume") - .profile(volumeProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .zone(zoneIdentityModel) - .capacity(Long.valueOf("100")) - .encryptionKey(encryptionKeyIdentityModel) - .build(); + .iops(Long.valueOf("10000")) + .name("my-volume") + .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList("testString")) + .zone(zoneIdentityModel) + .capacity(Long.valueOf("100")) + .encryptionKey(encryptionKeyIdentityModel) + .build(); CreateVolumeOptions createVolumeOptions = new CreateVolumeOptions.Builder() - .volumePrototype(volumePrototypeModel) - .build(); + .volumePrototype(volumePrototypeModel) + .build(); // Invoke operation Response response = service.createVolume(createVolumeOptions).execute(); @@ -6787,15 +6593,6 @@ public void testCreateVolume() throws Exception { Volume volumeResult = response.getResult(); assertNotNull(volumeResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6806,8 +6603,8 @@ public void testCreateVolume() throws Exception { public void testGetVolume() throws Exception { try { GetVolumeOptions getVolumeOptions = new GetVolumeOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getVolume(getVolumeOptions).execute(); @@ -6818,15 +6615,6 @@ public void testGetVolume() throws Exception { Volume volumeResult = response.getResult(); assertNotNull(volumeResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6837,23 +6625,23 @@ public void testGetVolume() throws Exception { public void testUpdateVolume() throws Exception { try { VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() - .name("general-purpose") - .build(); + .name("general-purpose") + .build(); VolumePatch volumePatchModel = new VolumePatch.Builder() - .capacity(Long.valueOf("100")) - .iops(Long.valueOf("10000")) - .name("my-volume") - .profile(volumeProfileIdentityModel) - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .build(); + .capacity(Long.valueOf("100")) + .iops(Long.valueOf("10000")) + .name("my-volume") + .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) + .build(); Map volumePatchModelAsPatch = volumePatchModel.asPatch(); UpdateVolumeOptions updateVolumeOptions = new UpdateVolumeOptions.Builder() - .id("testString") - .volumePatch(volumePatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") - .build(); + .id("testString") + .volumePatch(volumePatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.updateVolume(updateVolumeOptions).execute(); @@ -6864,17 +6652,6 @@ public void testUpdateVolume() throws Exception { Volume volumeResult = response.getResult(); assertNotNull(volumeResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 412 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6885,18 +6662,18 @@ public void testUpdateVolume() throws Exception { public void testListSnapshots() throws Exception { try { ListSnapshotsOptions listSnapshotsOptions = new ListSnapshotsOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .tag("testString") - .resourceGroupId("testString") - .name("testString") - .sourceVolumeId("testString") - .sourceVolumeCrn("testString") - .sourceImageId("testString") - .sourceImageCrn("testString") - .sort("name") - .backupPolicyPlanId("testString") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .tag("testString") + .resourceGroupId("testString") + .name("testString") + .sourceVolumeId("testString") + .sourceVolumeCrn("testString") + .sourceImageId("testString") + .sourceImageCrn("testString") + .sort("name") + .backupPolicyPlanId("testString") + .build(); // Invoke operation Response response = service.listSnapshots(listSnapshotsOptions).execute(); @@ -6913,27 +6690,67 @@ public void testListSnapshots() throws Exception { } } + @Test(dependsOnMethods = { "testListSnapshots" }) + public void testListSnapshotsWithPager() throws Exception { + try { + ListSnapshotsOptions options = new ListSnapshotsOptions.Builder() + .limit(Long.valueOf("10")) + .tag("testString") + .resourceGroupId("testString") + .name("testString") + .sourceVolumeId("testString") + .sourceVolumeCrn("testString") + .sourceImageId("testString") + .sourceImageCrn("testString") + .sort("name") + .backupPolicyPlanId("testString") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + SnapshotsPager pager = new SnapshotsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new SnapshotsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateSnapshot() throws Exception { try { ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); VolumeIdentityById volumeIdentityModel = new VolumeIdentityById.Builder() - .id("1a6b7274-678d-4dfb-8981-c71dd9d4daa5") - .build(); + .id("1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .build(); SnapshotPrototypeSnapshotBySourceVolume snapshotPrototypeModel = new SnapshotPrototypeSnapshotBySourceVolume.Builder() - .name("my-snapshot") - .resourceGroup(resourceGroupIdentityModel) - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .sourceVolume(volumeIdentityModel) - .build(); + .name("my-snapshot") + .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList("testString")) + .sourceVolume(volumeIdentityModel) + .build(); CreateSnapshotOptions createSnapshotOptions = new CreateSnapshotOptions.Builder() - .snapshotPrototype(snapshotPrototypeModel) - .build(); + .snapshotPrototype(snapshotPrototypeModel) + .build(); // Invoke operation Response response = service.createSnapshot(createSnapshotOptions).execute(); @@ -6944,15 +6761,6 @@ public void testCreateSnapshot() throws Exception { Snapshot snapshotResult = response.getResult(); assertNotNull(snapshotResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6963,8 +6771,8 @@ public void testCreateSnapshot() throws Exception { public void testGetSnapshot() throws Exception { try { GetSnapshotOptions getSnapshotOptions = new GetSnapshotOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getSnapshot(getSnapshotOptions).execute(); @@ -6975,15 +6783,6 @@ public void testGetSnapshot() throws Exception { Snapshot snapshotResult = response.getResult(); assertNotNull(snapshotResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -6994,16 +6793,16 @@ public void testGetSnapshot() throws Exception { public void testUpdateSnapshot() throws Exception { try { SnapshotPatch snapshotPatchModel = new SnapshotPatch.Builder() - .name("my-snapshot") - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .build(); + .name("my-snapshot") + .userTags(java.util.Arrays.asList("testString")) + .build(); Map snapshotPatchModelAsPatch = snapshotPatchModel.asPatch(); UpdateSnapshotOptions updateSnapshotOptions = new UpdateSnapshotOptions.Builder() - .id("testString") - .snapshotPatch(snapshotPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") - .build(); + .id("testString") + .snapshotPatch(snapshotPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.updateSnapshot(updateSnapshotOptions).execute(); @@ -7014,17 +6813,6 @@ public void testUpdateSnapshot() throws Exception { Snapshot snapshotResult = response.getResult(); assertNotNull(snapshotResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 412 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7055,8 +6843,8 @@ public void testListRegions() throws Exception { public void testGetRegion() throws Exception { try { GetRegionOptions getRegionOptions = new GetRegionOptions.Builder() - .name("testString") - .build(); + .name("testString") + .build(); // Invoke operation Response response = service.getRegion(getRegionOptions).execute(); @@ -7067,15 +6855,6 @@ public void testGetRegion() throws Exception { Region regionResult = response.getResult(); assertNotNull(regionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7086,8 +6865,8 @@ public void testGetRegion() throws Exception { public void testListRegionZones() throws Exception { try { ListRegionZonesOptions listRegionZonesOptions = new ListRegionZonesOptions.Builder() - .regionName("testString") - .build(); + .regionName("testString") + .build(); // Invoke operation Response response = service.listRegionZones(listRegionZonesOptions).execute(); @@ -7098,15 +6877,6 @@ public void testListRegionZones() throws Exception { ZoneCollection zoneCollectionResult = response.getResult(); assertNotNull(zoneCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7117,9 +6887,9 @@ public void testListRegionZones() throws Exception { public void testGetRegionZone() throws Exception { try { GetRegionZoneOptions getRegionZoneOptions = new GetRegionZoneOptions.Builder() - .regionName("testString") - .name("testString") - .build(); + .regionName("testString") + .name("testString") + .build(); // Invoke operation Response response = service.getRegionZone(getRegionZoneOptions).execute(); @@ -7130,15 +6900,6 @@ public void testGetRegionZone() throws Exception { Zone zoneResult = response.getResult(); assertNotNull(zoneResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7149,10 +6910,10 @@ public void testGetRegionZone() throws Exception { public void testListPublicGateways() throws Exception { try { ListPublicGatewaysOptions listPublicGatewaysOptions = new ListPublicGatewaysOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); // Invoke operation Response response = service.listPublicGateways(listPublicGatewaysOptions).execute(); @@ -7169,32 +6930,64 @@ public void testListPublicGateways() throws Exception { } } + @Test(dependsOnMethods = { "testListPublicGateways" }) + public void testListPublicGatewaysWithPager() throws Exception { + try { + ListPublicGatewaysOptions options = new ListPublicGatewaysOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + PublicGatewaysPager pager = new PublicGatewaysPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new PublicGatewaysPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreatePublicGateway() throws Exception { try { VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); + .id("4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); + .name("us-south-1") + .build(); PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById publicGatewayFloatingIpPrototypeModel = new PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.Builder() - .id("39300233-9995-4806-89a5-3c1b6eb88689") - .build(); + .id("39300233-9995-4806-89a5-3c1b6eb88689") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); CreatePublicGatewayOptions createPublicGatewayOptions = new CreatePublicGatewayOptions.Builder() - .vpc(vpcIdentityModel) - .zone(zoneIdentityModel) - .floatingIp(publicGatewayFloatingIpPrototypeModel) - .name("my-public-gateway") - .resourceGroup(resourceGroupIdentityModel) - .build(); + .vpc(vpcIdentityModel) + .zone(zoneIdentityModel) + .floatingIp(publicGatewayFloatingIpPrototypeModel) + .name("my-public-gateway") + .resourceGroup(resourceGroupIdentityModel) + .build(); // Invoke operation Response response = service.createPublicGateway(createPublicGatewayOptions).execute(); @@ -7205,15 +6998,6 @@ public void testCreatePublicGateway() throws Exception { PublicGateway publicGatewayResult = response.getResult(); assertNotNull(publicGatewayResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7224,8 +7008,8 @@ public void testCreatePublicGateway() throws Exception { public void testGetPublicGateway() throws Exception { try { GetPublicGatewayOptions getPublicGatewayOptions = new GetPublicGatewayOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getPublicGateway(getPublicGatewayOptions).execute(); @@ -7236,15 +7020,6 @@ public void testGetPublicGateway() throws Exception { PublicGateway publicGatewayResult = response.getResult(); assertNotNull(publicGatewayResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7255,14 +7030,14 @@ public void testGetPublicGateway() throws Exception { public void testUpdatePublicGateway() throws Exception { try { PublicGatewayPatch publicGatewayPatchModel = new PublicGatewayPatch.Builder() - .name("my-public-gateway") - .build(); + .name("my-public-gateway") + .build(); Map publicGatewayPatchModelAsPatch = publicGatewayPatchModel.asPatch(); UpdatePublicGatewayOptions updatePublicGatewayOptions = new UpdatePublicGatewayOptions.Builder() - .id("testString") - .publicGatewayPatch(publicGatewayPatchModelAsPatch) - .build(); + .id("testString") + .publicGatewayPatch(publicGatewayPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updatePublicGateway(updatePublicGatewayOptions).execute(); @@ -7273,16 +7048,6 @@ public void testUpdatePublicGateway() throws Exception { PublicGateway publicGatewayResult = response.getResult(); assertNotNull(publicGatewayResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7293,11 +7058,11 @@ public void testUpdatePublicGateway() throws Exception { public void testListFloatingIps() throws Exception { try { ListFloatingIpsOptions listFloatingIpsOptions = new ListFloatingIpsOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .sort("name") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .build(); // Invoke operation Response response = service.listFloatingIps(listFloatingIpsOptions).execute(); @@ -7314,26 +7079,59 @@ public void testListFloatingIps() throws Exception { } } + @Test(dependsOnMethods = { "testListFloatingIps" }) + public void testListFloatingIpsWithPager() throws Exception { + try { + ListFloatingIpsOptions options = new ListFloatingIpsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + FloatingIpsPager pager = new FloatingIpsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new FloatingIpsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateFloatingIp() throws Exception { try { ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); + .name("us-south-1") + .build(); FloatingIPPrototypeFloatingIPByZone floatingIpPrototypeModel = new FloatingIPPrototypeFloatingIPByZone.Builder() - .name("my-floating-ip") - .resourceGroup(resourceGroupIdentityModel) - .zone(zoneIdentityModel) - .build(); + .name("my-floating-ip") + .resourceGroup(resourceGroupIdentityModel) + .zone(zoneIdentityModel) + .build(); CreateFloatingIpOptions createFloatingIpOptions = new CreateFloatingIpOptions.Builder() - .floatingIpPrototype(floatingIpPrototypeModel) - .build(); + .floatingIpPrototype(floatingIpPrototypeModel) + .build(); // Invoke operation Response response = service.createFloatingIp(createFloatingIpOptions).execute(); @@ -7344,16 +7142,6 @@ public void testCreateFloatingIp() throws Exception { FloatingIP floatingIpResult = response.getResult(); assertNotNull(floatingIpResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7364,8 +7152,8 @@ public void testCreateFloatingIp() throws Exception { public void testGetFloatingIp() throws Exception { try { GetFloatingIpOptions getFloatingIpOptions = new GetFloatingIpOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getFloatingIp(getFloatingIpOptions).execute(); @@ -7376,15 +7164,6 @@ public void testGetFloatingIp() throws Exception { FloatingIP floatingIpResult = response.getResult(); assertNotNull(floatingIpResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7395,19 +7174,19 @@ public void testGetFloatingIp() throws Exception { public void testUpdateFloatingIp() throws Exception { try { FloatingIPTargetPatchNetworkInterfaceIdentityById floatingIpTargetPatchModel = new FloatingIPTargetPatchNetworkInterfaceIdentityById.Builder() - .id("10c02d81-0ecb-4dc5-897d-28392913b81e") - .build(); + .id("10c02d81-0ecb-4dc5-897d-28392913b81e") + .build(); FloatingIPPatch floatingIpPatchModel = new FloatingIPPatch.Builder() - .name("my-floating-ip") - .target(floatingIpTargetPatchModel) - .build(); + .name("my-floating-ip") + .target(floatingIpTargetPatchModel) + .build(); Map floatingIpPatchModelAsPatch = floatingIpPatchModel.asPatch(); UpdateFloatingIpOptions updateFloatingIpOptions = new UpdateFloatingIpOptions.Builder() - .id("testString") - .floatingIpPatch(floatingIpPatchModelAsPatch) - .build(); + .id("testString") + .floatingIpPatch(floatingIpPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateFloatingIp(updateFloatingIpOptions).execute(); @@ -7418,17 +7197,6 @@ public void testUpdateFloatingIp() throws Exception { FloatingIP floatingIpResult = response.getResult(); assertNotNull(floatingIpResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7439,10 +7207,10 @@ public void testUpdateFloatingIp() throws Exception { public void testListNetworkAcls() throws Exception { try { ListNetworkAclsOptions listNetworkAclsOptions = new ListNetworkAclsOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); // Invoke operation Response response = service.listNetworkAcls(listNetworkAclsOptions).execute(); @@ -7459,40 +7227,72 @@ public void testListNetworkAcls() throws Exception { } } + @Test(dependsOnMethods = { "testListNetworkAcls" }) + public void testListNetworkAclsWithPager() throws Exception { + try { + ListNetworkAclsOptions options = new ListNetworkAclsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + NetworkAclsPager pager = new NetworkAclsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new NetworkAclsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateNetworkAcl() throws Exception { try { ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("f0aae929-7047-46d1-92e1-9102b07a7f6f") - .build(); - - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP.Builder() - .action("allow") - .destination("192.168.3.2/32") - .direction("inbound") - .name("my-rule-2") - .source("192.168.3.2/32") - .destinationPortMax(Long.valueOf("22")) - .destinationPortMin(Long.valueOf("22")) - .protocol("udp") - .sourcePortMax(Long.valueOf("65535")) - .sourcePortMin(Long.valueOf("49152")) - .build(); + .id("f0aae929-7047-46d1-92e1-9102b07a7f6f") + .build(); + + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.Builder() + .action("allow") + .destination("192.168.3.2/32") + .direction("inbound") + .name("my-rule-2") + .source("192.168.3.2/32") + .destinationPortMax(Long.valueOf("22")) + .destinationPortMin(Long.valueOf("22")) + .protocol("udp") + .sourcePortMax(Long.valueOf("65535")) + .sourcePortMin(Long.valueOf("49152")) + .build(); NetworkACLPrototypeNetworkACLByRules networkAclPrototypeModel = new NetworkACLPrototypeNetworkACLByRules.Builder() - .name("my-network-acl") - .resourceGroup(resourceGroupIdentityModel) - .vpc(vpcIdentityModel) - .rules(new java.util.ArrayList(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel))) - .build(); + .name("my-network-acl") + .resourceGroup(resourceGroupIdentityModel) + .vpc(vpcIdentityModel) + .rules(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel)) + .build(); CreateNetworkAclOptions createNetworkAclOptions = new CreateNetworkAclOptions.Builder() - .networkAclPrototype(networkAclPrototypeModel) - .build(); + .networkAclPrototype(networkAclPrototypeModel) + .build(); // Invoke operation Response response = service.createNetworkAcl(createNetworkAclOptions).execute(); @@ -7503,15 +7303,6 @@ public void testCreateNetworkAcl() throws Exception { NetworkACL networkAclResult = response.getResult(); assertNotNull(networkAclResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7522,8 +7313,8 @@ public void testCreateNetworkAcl() throws Exception { public void testGetNetworkAcl() throws Exception { try { GetNetworkAclOptions getNetworkAclOptions = new GetNetworkAclOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getNetworkAcl(getNetworkAclOptions).execute(); @@ -7534,15 +7325,6 @@ public void testGetNetworkAcl() throws Exception { NetworkACL networkAclResult = response.getResult(); assertNotNull(networkAclResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7553,14 +7335,14 @@ public void testGetNetworkAcl() throws Exception { public void testUpdateNetworkAcl() throws Exception { try { NetworkACLPatch networkAclPatchModel = new NetworkACLPatch.Builder() - .name("my-network-acl") - .build(); + .name("my-network-acl") + .build(); Map networkAclPatchModelAsPatch = networkAclPatchModel.asPatch(); UpdateNetworkAclOptions updateNetworkAclOptions = new UpdateNetworkAclOptions.Builder() - .id("testString") - .networkAclPatch(networkAclPatchModelAsPatch) - .build(); + .id("testString") + .networkAclPatch(networkAclPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateNetworkAcl(updateNetworkAclOptions).execute(); @@ -7571,16 +7353,6 @@ public void testUpdateNetworkAcl() throws Exception { NetworkACL networkAclResult = response.getResult(); assertNotNull(networkAclResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7591,11 +7363,11 @@ public void testUpdateNetworkAcl() throws Exception { public void testListNetworkAclRules() throws Exception { try { ListNetworkAclRulesOptions listNetworkAclRulesOptions = new ListNetworkAclRulesOptions.Builder() - .networkAclId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .direction("inbound") - .build(); + .networkAclId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .direction("inbound") + .build(); // Invoke operation Response response = service.listNetworkAclRules(listNetworkAclRulesOptions).execute(); @@ -7606,15 +7378,39 @@ public void testListNetworkAclRules() throws Exception { NetworkACLRuleCollection networkAclRuleCollectionResult = response.getResult(); assertNotNull(networkAclRuleCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListNetworkAclRules" }) + public void testListNetworkAclRulesWithPager() throws Exception { + try { + ListNetworkAclRulesOptions options = new ListNetworkAclRulesOptions.Builder() + .networkAclId("testString") + .limit(Long.valueOf("10")) + .direction("inbound") + .build(); - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + // Test getNext(). + List allResults = new ArrayList<>(); + NetworkAclRulesPager pager = new NetworkAclRulesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + // Test getAll(); + pager = new NetworkAclRulesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7625,25 +7421,27 @@ public void testListNetworkAclRules() throws Exception { public void testCreateNetworkAclRule() throws Exception { try { NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById networkAclRuleBeforePrototypeModel = new NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.Builder() - .id("8daca77a-4980-4d33-8f3e-7038797be8f9") - .build(); - - NetworkACLRulePrototypeNetworkACLRuleProtocolICMP networkAclRulePrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolICMP.Builder() - .action("allow") - .before(networkAclRuleBeforePrototypeModel) - .destination("192.168.3.2/32") - .direction("inbound") - .name("my-rule-2") - .source("192.168.3.2/32") - .code(Long.valueOf("0")) - .protocol("icmp") - .type(Long.valueOf("8")) - .build(); + .id("8daca77a-4980-4d33-8f3e-7038797be8f9") + .build(); + + NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype networkAclRulePrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.Builder() + .action("allow") + .before(networkAclRuleBeforePrototypeModel) + .destination("192.168.3.2/32") + .direction("inbound") + .name("my-rule-2") + .source("192.168.3.2/32") + .destinationPortMax(Long.valueOf("22")) + .destinationPortMin(Long.valueOf("22")) + .protocol("udp") + .sourcePortMax(Long.valueOf("65535")) + .sourcePortMin(Long.valueOf("49152")) + .build(); CreateNetworkAclRuleOptions createNetworkAclRuleOptions = new CreateNetworkAclRuleOptions.Builder() - .networkAclId("testString") - .networkAclRulePrototype(networkAclRulePrototypeModel) - .build(); + .networkAclId("testString") + .networkAclRulePrototype(networkAclRulePrototypeModel) + .build(); // Invoke operation Response response = service.createNetworkAclRule(createNetworkAclRuleOptions).execute(); @@ -7654,16 +7452,6 @@ public void testCreateNetworkAclRule() throws Exception { NetworkACLRule networkAclRuleResult = response.getResult(); assertNotNull(networkAclRuleResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7674,9 +7462,9 @@ public void testCreateNetworkAclRule() throws Exception { public void testGetNetworkAclRule() throws Exception { try { GetNetworkAclRuleOptions getNetworkAclRuleOptions = new GetNetworkAclRuleOptions.Builder() - .networkAclId("testString") - .id("testString") - .build(); + .networkAclId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getNetworkAclRule(getNetworkAclRuleOptions).execute(); @@ -7687,15 +7475,6 @@ public void testGetNetworkAclRule() throws Exception { NetworkACLRule networkAclRuleResult = response.getResult(); assertNotNull(networkAclRuleResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7706,30 +7485,31 @@ public void testGetNetworkAclRule() throws Exception { public void testUpdateNetworkAclRule() throws Exception { try { NetworkACLRuleBeforePatchNetworkACLRuleIdentityById networkAclRuleBeforePatchModel = new NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.Builder() - .id("8daca77a-4980-4d33-8f3e-7038797be8f9") - .build(); + .id("8daca77a-4980-4d33-8f3e-7038797be8f9") + .build(); NetworkACLRulePatch networkAclRulePatchModel = new NetworkACLRulePatch.Builder() - .action("allow") - .before(networkAclRuleBeforePatchModel) - .code(Long.valueOf("0")) - .destination("192.168.3.2/32") - .destinationPortMax(Long.valueOf("22")) - .destinationPortMin(Long.valueOf("22")) - .direction("inbound") - .name("my-rule-2") - .source("192.168.3.2/32") - .sourcePortMax(Long.valueOf("65535")) - .sourcePortMin(Long.valueOf("49152")) - .type(Long.valueOf("8")) - .build(); + .action("allow") + .before(networkAclRuleBeforePatchModel) + .code(Long.valueOf("0")) + .destination("192.168.3.2/32") + .destinationPortMax(Long.valueOf("22")) + .destinationPortMin(Long.valueOf("22")) + .direction("inbound") + .name("my-rule-1") + .protocol("tcp") + .source("192.168.3.2/32") + .sourcePortMax(Long.valueOf("65535")) + .sourcePortMin(Long.valueOf("49152")) + .type(Long.valueOf("8")) + .build(); Map networkAclRulePatchModelAsPatch = networkAclRulePatchModel.asPatch(); UpdateNetworkAclRuleOptions updateNetworkAclRuleOptions = new UpdateNetworkAclRuleOptions.Builder() - .networkAclId("testString") - .id("testString") - .networkAclRulePatch(networkAclRulePatchModelAsPatch) - .build(); + .networkAclId("testString") + .id("testString") + .networkAclRulePatch(networkAclRulePatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateNetworkAclRule(updateNetworkAclRuleOptions).execute(); @@ -7740,16 +7520,6 @@ public void testUpdateNetworkAclRule() throws Exception { NetworkACLRule networkAclRuleResult = response.getResult(); assertNotNull(networkAclRuleResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7760,13 +7530,13 @@ public void testUpdateNetworkAclRule() throws Exception { public void testListSecurityGroups() throws Exception { try { ListSecurityGroupsOptions listSecurityGroupsOptions = new ListSecurityGroupsOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .build(); // Invoke operation Response response = service.listSecurityGroups(listSecurityGroupsOptions).execute(); @@ -7783,36 +7553,69 @@ public void testListSecurityGroups() throws Exception { } } + @Test(dependsOnMethods = { "testListSecurityGroups" }) + public void testListSecurityGroupsWithPager() throws Exception { + try { + ListSecurityGroupsOptions options = new ListSecurityGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + SecurityGroupsPager pager = new SecurityGroupsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new SecurityGroupsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateSecurityGroup() throws Exception { try { VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); + .id("4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); SecurityGroupRuleRemotePrototypeIP securityGroupRuleRemotePrototypeModel = new SecurityGroupRuleRemotePrototypeIP.Builder() - .address("192.168.3.4") - .build(); - - SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.Builder() - .code(Long.valueOf("0")) - .direction("inbound") - .ipVersion("ipv4") - .protocol("icmp") - .remote(securityGroupRuleRemotePrototypeModel) - .type(Long.valueOf("8")) - .build(); + .address("192.168.3.4") + .build(); + + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder() + .direction("inbound") + .ipVersion("ipv4") + .protocol("all") + .remote(securityGroupRuleRemotePrototypeModel) + .build(); CreateSecurityGroupOptions createSecurityGroupOptions = new CreateSecurityGroupOptions.Builder() - .vpc(vpcIdentityModel) - .name("my-security-group") - .resourceGroup(resourceGroupIdentityModel) - .rules(new java.util.ArrayList(java.util.Arrays.asList(securityGroupRulePrototypeModel))) - .build(); + .vpc(vpcIdentityModel) + .name("my-security-group") + .resourceGroup(resourceGroupIdentityModel) + .rules(java.util.Arrays.asList(securityGroupRulePrototypeModel)) + .build(); // Invoke operation Response response = service.createSecurityGroup(createSecurityGroupOptions).execute(); @@ -7823,15 +7626,6 @@ public void testCreateSecurityGroup() throws Exception { SecurityGroup securityGroupResult = response.getResult(); assertNotNull(securityGroupResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7842,8 +7636,8 @@ public void testCreateSecurityGroup() throws Exception { public void testGetSecurityGroup() throws Exception { try { GetSecurityGroupOptions getSecurityGroupOptions = new GetSecurityGroupOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getSecurityGroup(getSecurityGroupOptions).execute(); @@ -7854,15 +7648,6 @@ public void testGetSecurityGroup() throws Exception { SecurityGroup securityGroupResult = response.getResult(); assertNotNull(securityGroupResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7873,14 +7658,14 @@ public void testGetSecurityGroup() throws Exception { public void testUpdateSecurityGroup() throws Exception { try { SecurityGroupPatch securityGroupPatchModel = new SecurityGroupPatch.Builder() - .name("my-security-group") - .build(); + .name("my-security-group") + .build(); Map securityGroupPatchModelAsPatch = securityGroupPatchModel.asPatch(); UpdateSecurityGroupOptions updateSecurityGroupOptions = new UpdateSecurityGroupOptions.Builder() - .id("testString") - .securityGroupPatch(securityGroupPatchModelAsPatch) - .build(); + .id("testString") + .securityGroupPatch(securityGroupPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateSecurityGroup(updateSecurityGroupOptions).execute(); @@ -7891,16 +7676,6 @@ public void testUpdateSecurityGroup() throws Exception { SecurityGroup securityGroupResult = response.getResult(); assertNotNull(securityGroupResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7911,8 +7686,8 @@ public void testUpdateSecurityGroup() throws Exception { public void testListSecurityGroupRules() throws Exception { try { ListSecurityGroupRulesOptions listSecurityGroupRulesOptions = new ListSecurityGroupRulesOptions.Builder() - .securityGroupId("testString") - .build(); + .securityGroupId("testString") + .build(); // Invoke operation Response response = service.listSecurityGroupRules(listSecurityGroupRulesOptions).execute(); @@ -7923,15 +7698,6 @@ public void testListSecurityGroupRules() throws Exception { SecurityGroupRuleCollection securityGroupRuleCollectionResult = response.getResult(); assertNotNull(securityGroupRuleCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7942,22 +7708,20 @@ public void testListSecurityGroupRules() throws Exception { public void testCreateSecurityGroupRule() throws Exception { try { SecurityGroupRuleRemotePrototypeIP securityGroupRuleRemotePrototypeModel = new SecurityGroupRuleRemotePrototypeIP.Builder() - .address("192.168.3.4") - .build(); - - SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.Builder() - .code(Long.valueOf("0")) - .direction("inbound") - .ipVersion("ipv4") - .protocol("icmp") - .remote(securityGroupRuleRemotePrototypeModel) - .type(Long.valueOf("8")) - .build(); + .address("192.168.3.4") + .build(); + + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder() + .direction("inbound") + .ipVersion("ipv4") + .protocol("all") + .remote(securityGroupRuleRemotePrototypeModel) + .build(); CreateSecurityGroupRuleOptions createSecurityGroupRuleOptions = new CreateSecurityGroupRuleOptions.Builder() - .securityGroupId("testString") - .securityGroupRulePrototype(securityGroupRulePrototypeModel) - .build(); + .securityGroupId("testString") + .securityGroupRulePrototype(securityGroupRulePrototypeModel) + .build(); // Invoke operation Response response = service.createSecurityGroupRule(createSecurityGroupRuleOptions).execute(); @@ -7968,16 +7732,6 @@ public void testCreateSecurityGroupRule() throws Exception { SecurityGroupRule securityGroupRuleResult = response.getResult(); assertNotNull(securityGroupRuleResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -7988,9 +7742,9 @@ public void testCreateSecurityGroupRule() throws Exception { public void testGetSecurityGroupRule() throws Exception { try { GetSecurityGroupRuleOptions getSecurityGroupRuleOptions = new GetSecurityGroupRuleOptions.Builder() - .securityGroupId("testString") - .id("testString") - .build(); + .securityGroupId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getSecurityGroupRule(getSecurityGroupRuleOptions).execute(); @@ -8001,15 +7755,6 @@ public void testGetSecurityGroupRule() throws Exception { SecurityGroupRule securityGroupRuleResult = response.getResult(); assertNotNull(securityGroupRuleResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8020,25 +7765,25 @@ public void testGetSecurityGroupRule() throws Exception { public void testUpdateSecurityGroupRule() throws Exception { try { SecurityGroupRuleRemotePatchIP securityGroupRuleRemotePatchModel = new SecurityGroupRuleRemotePatchIP.Builder() - .address("192.168.3.4") - .build(); + .address("192.168.3.4") + .build(); SecurityGroupRulePatch securityGroupRulePatchModel = new SecurityGroupRulePatch.Builder() - .code(Long.valueOf("0")) - .direction("inbound") - .ipVersion("ipv4") - .portMax(Long.valueOf("22")) - .portMin(Long.valueOf("22")) - .remote(securityGroupRuleRemotePatchModel) - .type(Long.valueOf("8")) - .build(); + .code(Long.valueOf("0")) + .direction("inbound") + .ipVersion("ipv4") + .portMax(Long.valueOf("22")) + .portMin(Long.valueOf("22")) + .remote(securityGroupRuleRemotePatchModel) + .type(Long.valueOf("8")) + .build(); Map securityGroupRulePatchModelAsPatch = securityGroupRulePatchModel.asPatch(); UpdateSecurityGroupRuleOptions updateSecurityGroupRuleOptions = new UpdateSecurityGroupRuleOptions.Builder() - .securityGroupId("testString") - .id("testString") - .securityGroupRulePatch(securityGroupRulePatchModelAsPatch) - .build(); + .securityGroupId("testString") + .id("testString") + .securityGroupRulePatch(securityGroupRulePatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateSecurityGroupRule(updateSecurityGroupRuleOptions).execute(); @@ -8049,16 +7794,6 @@ public void testUpdateSecurityGroupRule() throws Exception { SecurityGroupRule securityGroupRuleResult = response.getResult(); assertNotNull(securityGroupRuleResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8069,10 +7804,10 @@ public void testUpdateSecurityGroupRule() throws Exception { public void testListSecurityGroupTargets() throws Exception { try { ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptions = new ListSecurityGroupTargetsOptions.Builder() - .securityGroupId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .securityGroupId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listSecurityGroupTargets(listSecurityGroupTargetsOptions).execute(); @@ -8083,15 +7818,38 @@ public void testListSecurityGroupTargets() throws Exception { SecurityGroupTargetCollection securityGroupTargetCollectionResult = response.getResult(); assertNotNull(securityGroupTargetCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + @Test(dependsOnMethods = { "testListSecurityGroupTargets" }) + public void testListSecurityGroupTargetsWithPager() throws Exception { + try { + ListSecurityGroupTargetsOptions options = new ListSecurityGroupTargetsOptions.Builder() + .securityGroupId("testString") + .limit(Long.valueOf("10")) + .build(); + // Test getNext(). + List allResults = new ArrayList<>(); + SecurityGroupTargetsPager pager = new SecurityGroupTargetsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new SecurityGroupTargetsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8102,9 +7860,9 @@ public void testListSecurityGroupTargets() throws Exception { public void testGetSecurityGroupTarget() throws Exception { try { GetSecurityGroupTargetOptions getSecurityGroupTargetOptions = new GetSecurityGroupTargetOptions.Builder() - .securityGroupId("testString") - .id("testString") - .build(); + .securityGroupId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getSecurityGroupTarget(getSecurityGroupTargetOptions).execute(); @@ -8115,15 +7873,6 @@ public void testGetSecurityGroupTarget() throws Exception { SecurityGroupTargetReference securityGroupTargetReferenceResult = response.getResult(); assertNotNull(securityGroupTargetReferenceResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8134,9 +7883,9 @@ public void testGetSecurityGroupTarget() throws Exception { public void testCreateSecurityGroupTargetBinding() throws Exception { try { CreateSecurityGroupTargetBindingOptions createSecurityGroupTargetBindingOptions = new CreateSecurityGroupTargetBindingOptions.Builder() - .securityGroupId("testString") - .id("testString") - .build(); + .securityGroupId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.createSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptions).execute(); @@ -8147,17 +7896,6 @@ public void testCreateSecurityGroupTargetBinding() throws Exception { SecurityGroupTargetReference securityGroupTargetReferenceResult = response.getResult(); assertNotNull(securityGroupTargetReferenceResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8168,9 +7906,9 @@ public void testCreateSecurityGroupTargetBinding() throws Exception { public void testListIkePolicies() throws Exception { try { ListIkePoliciesOptions listIkePoliciesOptions = new ListIkePoliciesOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listIkePolicies(listIkePoliciesOptions).execute(); @@ -8187,22 +7925,53 @@ public void testListIkePolicies() throws Exception { } } + @Test(dependsOnMethods = { "testListIkePolicies" }) + public void testListIkePoliciesWithPager() throws Exception { + try { + ListIkePoliciesOptions options = new ListIkePoliciesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + IkePoliciesPager pager = new IkePoliciesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new IkePoliciesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateIkePolicy() throws Exception { try { ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); CreateIkePolicyOptions createIkePolicyOptions = new CreateIkePolicyOptions.Builder() - .authenticationAlgorithm("md5") - .dhGroup(Long.valueOf("14")) - .encryptionAlgorithm("aes128") - .ikeVersion(Long.valueOf("1")) - .keyLifetime(Long.valueOf("28800")) - .name("my-ike-policy") - .resourceGroup(resourceGroupIdentityModel) - .build(); + .authenticationAlgorithm("md5") + .dhGroup(Long.valueOf("14")) + .encryptionAlgorithm("aes128") + .ikeVersion(Long.valueOf("1")) + .keyLifetime(Long.valueOf("28800")) + .name("my-ike-policy") + .resourceGroup(resourceGroupIdentityModel) + .build(); // Invoke operation Response response = service.createIkePolicy(createIkePolicyOptions).execute(); @@ -8213,15 +7982,6 @@ public void testCreateIkePolicy() throws Exception { IKEPolicy ikePolicyResult = response.getResult(); assertNotNull(ikePolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8232,8 +7992,8 @@ public void testCreateIkePolicy() throws Exception { public void testGetIkePolicy() throws Exception { try { GetIkePolicyOptions getIkePolicyOptions = new GetIkePolicyOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getIkePolicy(getIkePolicyOptions).execute(); @@ -8244,15 +8004,6 @@ public void testGetIkePolicy() throws Exception { IKEPolicy ikePolicyResult = response.getResult(); assertNotNull(ikePolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8263,19 +8014,19 @@ public void testGetIkePolicy() throws Exception { public void testUpdateIkePolicy() throws Exception { try { IKEPolicyPatch ikePolicyPatchModel = new IKEPolicyPatch.Builder() - .authenticationAlgorithm("md5") - .dhGroup(Long.valueOf("14")) - .encryptionAlgorithm("aes128") - .ikeVersion(Long.valueOf("1")) - .keyLifetime(Long.valueOf("28800")) - .name("my-ike-policy") - .build(); + .authenticationAlgorithm("md5") + .dhGroup(Long.valueOf("14")) + .encryptionAlgorithm("aes128") + .ikeVersion(Long.valueOf("1")) + .keyLifetime(Long.valueOf("28800")) + .name("my-ike-policy") + .build(); Map ikePolicyPatchModelAsPatch = ikePolicyPatchModel.asPatch(); UpdateIkePolicyOptions updateIkePolicyOptions = new UpdateIkePolicyOptions.Builder() - .id("testString") - .ikePolicyPatch(ikePolicyPatchModelAsPatch) - .build(); + .id("testString") + .ikePolicyPatch(ikePolicyPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateIkePolicy(updateIkePolicyOptions).execute(); @@ -8286,16 +8037,6 @@ public void testUpdateIkePolicy() throws Exception { IKEPolicy ikePolicyResult = response.getResult(); assertNotNull(ikePolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8306,8 +8047,8 @@ public void testUpdateIkePolicy() throws Exception { public void testListIkePolicyConnections() throws Exception { try { ListIkePolicyConnectionsOptions listIkePolicyConnectionsOptions = new ListIkePolicyConnectionsOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.listIkePolicyConnections(listIkePolicyConnectionsOptions).execute(); @@ -8318,15 +8059,6 @@ public void testListIkePolicyConnections() throws Exception { VPNGatewayConnectionCollection vpnGatewayConnectionCollectionResult = response.getResult(); assertNotNull(vpnGatewayConnectionCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8337,9 +8069,9 @@ public void testListIkePolicyConnections() throws Exception { public void testListIpsecPolicies() throws Exception { try { ListIpsecPoliciesOptions listIpsecPoliciesOptions = new ListIpsecPoliciesOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listIpsecPolicies(listIpsecPoliciesOptions).execute(); @@ -8356,21 +8088,52 @@ public void testListIpsecPolicies() throws Exception { } } + @Test(dependsOnMethods = { "testListIpsecPolicies" }) + public void testListIpsecPoliciesWithPager() throws Exception { + try { + ListIpsecPoliciesOptions options = new ListIpsecPoliciesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + IpsecPoliciesPager pager = new IpsecPoliciesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new IpsecPoliciesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateIpsecPolicy() throws Exception { try { ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); CreateIpsecPolicyOptions createIpsecPolicyOptions = new CreateIpsecPolicyOptions.Builder() - .authenticationAlgorithm("md5") - .encryptionAlgorithm("aes128") - .pfs("disabled") - .keyLifetime(Long.valueOf("3600")) - .name("my-ipsec-policy") - .resourceGroup(resourceGroupIdentityModel) - .build(); + .authenticationAlgorithm("disabled") + .encryptionAlgorithm("aes128") + .pfs("disabled") + .keyLifetime(Long.valueOf("3600")) + .name("my-ipsec-policy") + .resourceGroup(resourceGroupIdentityModel) + .build(); // Invoke operation Response response = service.createIpsecPolicy(createIpsecPolicyOptions).execute(); @@ -8381,15 +8144,6 @@ public void testCreateIpsecPolicy() throws Exception { IPsecPolicy iPsecPolicyResult = response.getResult(); assertNotNull(iPsecPolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8400,8 +8154,8 @@ public void testCreateIpsecPolicy() throws Exception { public void testGetIpsecPolicy() throws Exception { try { GetIpsecPolicyOptions getIpsecPolicyOptions = new GetIpsecPolicyOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getIpsecPolicy(getIpsecPolicyOptions).execute(); @@ -8412,15 +8166,6 @@ public void testGetIpsecPolicy() throws Exception { IPsecPolicy iPsecPolicyResult = response.getResult(); assertNotNull(iPsecPolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8431,18 +8176,18 @@ public void testGetIpsecPolicy() throws Exception { public void testUpdateIpsecPolicy() throws Exception { try { IPsecPolicyPatch iPsecPolicyPatchModel = new IPsecPolicyPatch.Builder() - .authenticationAlgorithm("md5") - .encryptionAlgorithm("aes128") - .keyLifetime(Long.valueOf("3600")) - .name("my-ipsec-policy") - .pfs("disabled") - .build(); + .authenticationAlgorithm("disabled") + .encryptionAlgorithm("aes128") + .keyLifetime(Long.valueOf("3600")) + .name("my-ipsec-policy") + .pfs("disabled") + .build(); Map iPsecPolicyPatchModelAsPatch = iPsecPolicyPatchModel.asPatch(); UpdateIpsecPolicyOptions updateIpsecPolicyOptions = new UpdateIpsecPolicyOptions.Builder() - .id("testString") - .iPsecPolicyPatch(iPsecPolicyPatchModelAsPatch) - .build(); + .id("testString") + .iPsecPolicyPatch(iPsecPolicyPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateIpsecPolicy(updateIpsecPolicyOptions).execute(); @@ -8453,16 +8198,6 @@ public void testUpdateIpsecPolicy() throws Exception { IPsecPolicy iPsecPolicyResult = response.getResult(); assertNotNull(iPsecPolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8473,8 +8208,8 @@ public void testUpdateIpsecPolicy() throws Exception { public void testListIpsecPolicyConnections() throws Exception { try { ListIpsecPolicyConnectionsOptions listIpsecPolicyConnectionsOptions = new ListIpsecPolicyConnectionsOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.listIpsecPolicyConnections(listIpsecPolicyConnectionsOptions).execute(); @@ -8485,15 +8220,6 @@ public void testListIpsecPolicyConnections() throws Exception { VPNGatewayConnectionCollection vpnGatewayConnectionCollectionResult = response.getResult(); assertNotNull(vpnGatewayConnectionCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8504,11 +8230,12 @@ public void testListIpsecPolicyConnections() throws Exception { public void testListVpnGateways() throws Exception { try { ListVpnGatewaysOptions listVpnGatewaysOptions = new ListVpnGatewaysOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .mode("route") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .mode("route") + .build(); // Invoke operation Response response = service.listVpnGateways(listVpnGatewaysOptions).execute(); @@ -8525,27 +8252,61 @@ public void testListVpnGateways() throws Exception { } } + @Test(dependsOnMethods = { "testListVpnGateways" }) + public void testListVpnGatewaysWithPager() throws Exception { + try { + ListVpnGatewaysOptions options = new ListVpnGatewaysOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .mode("route") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + VpnGatewaysPager pager = new VpnGatewaysPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new VpnGatewaysPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateVpnGateway() throws Exception { try { ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); VPNGatewayPrototypeVPNGatewayRouteModePrototype vpnGatewayPrototypeModel = new VPNGatewayPrototypeVPNGatewayRouteModePrototype.Builder() - .name("my-vpn-gateway") - .resourceGroup(resourceGroupIdentityModel) - .subnet(subnetIdentityModel) - .mode("route") - .build(); + .name("my-vpn-gateway") + .resourceGroup(resourceGroupIdentityModel) + .subnet(subnetIdentityModel) + .mode("route") + .build(); CreateVpnGatewayOptions createVpnGatewayOptions = new CreateVpnGatewayOptions.Builder() - .vpnGatewayPrototype(vpnGatewayPrototypeModel) - .build(); + .vpnGatewayPrototype(vpnGatewayPrototypeModel) + .build(); // Invoke operation Response response = service.createVpnGateway(createVpnGatewayOptions).execute(); @@ -8556,15 +8317,6 @@ public void testCreateVpnGateway() throws Exception { VPNGateway vpnGatewayResult = response.getResult(); assertNotNull(vpnGatewayResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8575,8 +8327,8 @@ public void testCreateVpnGateway() throws Exception { public void testGetVpnGateway() throws Exception { try { GetVpnGatewayOptions getVpnGatewayOptions = new GetVpnGatewayOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getVpnGateway(getVpnGatewayOptions).execute(); @@ -8587,15 +8339,6 @@ public void testGetVpnGateway() throws Exception { VPNGateway vpnGatewayResult = response.getResult(); assertNotNull(vpnGatewayResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8606,14 +8349,14 @@ public void testGetVpnGateway() throws Exception { public void testUpdateVpnGateway() throws Exception { try { VPNGatewayPatch vpnGatewayPatchModel = new VPNGatewayPatch.Builder() - .name("my-vpn-gateway") - .build(); + .name("my-vpn-gateway") + .build(); Map vpnGatewayPatchModelAsPatch = vpnGatewayPatchModel.asPatch(); UpdateVpnGatewayOptions updateVpnGatewayOptions = new UpdateVpnGatewayOptions.Builder() - .id("testString") - .vpnGatewayPatch(vpnGatewayPatchModelAsPatch) - .build(); + .id("testString") + .vpnGatewayPatch(vpnGatewayPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateVpnGateway(updateVpnGatewayOptions).execute(); @@ -8624,16 +8367,6 @@ public void testUpdateVpnGateway() throws Exception { VPNGateway vpnGatewayResult = response.getResult(); assertNotNull(vpnGatewayResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8644,9 +8377,9 @@ public void testUpdateVpnGateway() throws Exception { public void testListVpnGatewayConnections() throws Exception { try { ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptions = new ListVpnGatewayConnectionsOptions.Builder() - .vpnGatewayId("testString") - .status("testString") - .build(); + .vpnGatewayId("testString") + .status("testString") + .build(); // Invoke operation Response response = service.listVpnGatewayConnections(listVpnGatewayConnectionsOptions).execute(); @@ -8657,15 +8390,6 @@ public void testListVpnGatewayConnections() throws Exception { VPNGatewayConnectionCollection vpnGatewayConnectionCollectionResult = response.getResult(); assertNotNull(vpnGatewayConnectionCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8676,34 +8400,34 @@ public void testListVpnGatewayConnections() throws Exception { public void testCreateVpnGatewayConnection() throws Exception { try { VPNGatewayConnectionDPDPrototype vpnGatewayConnectionDpdPrototypeModel = new VPNGatewayConnectionDPDPrototype.Builder() - .action("restart") - .interval(Long.valueOf("30")) - .timeout(Long.valueOf("120")) - .build(); + .action("restart") + .interval(Long.valueOf("30")) + .timeout(Long.valueOf("120")) + .build(); VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById vpnGatewayConnectionIkePolicyPrototypeModel = new VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.Builder() - .id("ddf51bec-3424-11e8-b467-0ed5f89f718b") - .build(); + .id("ddf51bec-3424-11e8-b467-0ed5f89f718b") + .build(); VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById vpnGatewayConnectionIPsecPolicyPrototypeModel = new VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.Builder() - .id("ddf51bec-3424-11e8-b467-0ed5f89f718b") - .build(); + .id("ddf51bec-3424-11e8-b467-0ed5f89f718b") + .build(); VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype vpnGatewayConnectionPrototypeModel = new VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.Builder() - .adminStateUp(true) - .deadPeerDetection(vpnGatewayConnectionDpdPrototypeModel) - .ikePolicy(vpnGatewayConnectionIkePolicyPrototypeModel) - .ipsecPolicy(vpnGatewayConnectionIPsecPolicyPrototypeModel) - .name("my-vpn-connection") - .peerAddress("169.21.50.5") - .psk("lkj14b1oi0alcniejkso") - .routingProtocol("none") - .build(); + .adminStateUp(true) + .deadPeerDetection(vpnGatewayConnectionDpdPrototypeModel) + .ikePolicy(vpnGatewayConnectionIkePolicyPrototypeModel) + .ipsecPolicy(vpnGatewayConnectionIPsecPolicyPrototypeModel) + .name("my-vpn-connection") + .peerAddress("169.21.50.5") + .psk("lkj14b1oi0alcniejkso") + .routingProtocol("none") + .build(); CreateVpnGatewayConnectionOptions createVpnGatewayConnectionOptions = new CreateVpnGatewayConnectionOptions.Builder() - .vpnGatewayId("testString") - .vpnGatewayConnectionPrototype(vpnGatewayConnectionPrototypeModel) - .build(); + .vpnGatewayId("testString") + .vpnGatewayConnectionPrototype(vpnGatewayConnectionPrototypeModel) + .build(); // Invoke operation Response response = service.createVpnGatewayConnection(createVpnGatewayConnectionOptions).execute(); @@ -8714,15 +8438,6 @@ public void testCreateVpnGatewayConnection() throws Exception { VPNGatewayConnection vpnGatewayConnectionResult = response.getResult(); assertNotNull(vpnGatewayConnectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8733,9 +8448,9 @@ public void testCreateVpnGatewayConnection() throws Exception { public void testGetVpnGatewayConnection() throws Exception { try { GetVpnGatewayConnectionOptions getVpnGatewayConnectionOptions = new GetVpnGatewayConnectionOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .build(); + .vpnGatewayId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getVpnGatewayConnection(getVpnGatewayConnectionOptions).execute(); @@ -8746,15 +8461,6 @@ public void testGetVpnGatewayConnection() throws Exception { VPNGatewayConnection vpnGatewayConnectionResult = response.getResult(); assertNotNull(vpnGatewayConnectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8765,36 +8471,36 @@ public void testGetVpnGatewayConnection() throws Exception { public void testUpdateVpnGatewayConnection() throws Exception { try { VPNGatewayConnectionDPDPatch vpnGatewayConnectionDpdPatchModel = new VPNGatewayConnectionDPDPatch.Builder() - .action("restart") - .interval(Long.valueOf("30")) - .timeout(Long.valueOf("120")) - .build(); + .action("restart") + .interval(Long.valueOf("30")) + .timeout(Long.valueOf("120")) + .build(); VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById vpnGatewayConnectionIkePolicyPatchModel = new VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.Builder() - .id("ddf51bec-3424-11e8-b467-0ed5f89f718b") - .build(); + .id("ddf51bec-3424-11e8-b467-0ed5f89f718b") + .build(); VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById vpnGatewayConnectionIPsecPolicyPatchModel = new VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.Builder() - .id("ddf51bec-3424-11e8-b467-0ed5f89f718b") - .build(); + .id("ddf51bec-3424-11e8-b467-0ed5f89f718b") + .build(); VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch vpnGatewayConnectionPatchModel = new VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.Builder() - .adminStateUp(true) - .deadPeerDetection(vpnGatewayConnectionDpdPatchModel) - .ikePolicy(vpnGatewayConnectionIkePolicyPatchModel) - .ipsecPolicy(vpnGatewayConnectionIPsecPolicyPatchModel) - .name("my-vpn-connection") - .peerAddress("169.21.50.5") - .psk("lkj14b1oi0alcniejkso") - .routingProtocol("none") - .build(); + .adminStateUp(true) + .deadPeerDetection(vpnGatewayConnectionDpdPatchModel) + .ikePolicy(vpnGatewayConnectionIkePolicyPatchModel) + .ipsecPolicy(vpnGatewayConnectionIPsecPolicyPatchModel) + .name("my-vpn-connection") + .peerAddress("169.21.50.5") + .psk("lkj14b1oi0alcniejkso") + .routingProtocol("none") + .build(); Map vpnGatewayConnectionPatchModelAsPatch = vpnGatewayConnectionPatchModel.asPatch(); UpdateVpnGatewayConnectionOptions updateVpnGatewayConnectionOptions = new UpdateVpnGatewayConnectionOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .vpnGatewayConnectionPatch(vpnGatewayConnectionPatchModelAsPatch) - .build(); + .vpnGatewayId("testString") + .id("testString") + .vpnGatewayConnectionPatch(vpnGatewayConnectionPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateVpnGatewayConnection(updateVpnGatewayConnectionOptions).execute(); @@ -8805,16 +8511,6 @@ public void testUpdateVpnGatewayConnection() throws Exception { VPNGatewayConnection vpnGatewayConnectionResult = response.getResult(); assertNotNull(vpnGatewayConnectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8825,9 +8521,9 @@ public void testUpdateVpnGatewayConnection() throws Exception { public void testListVpnGatewayConnectionLocalCidrs() throws Exception { try { ListVpnGatewayConnectionLocalCidrsOptions listVpnGatewayConnectionLocalCidrsOptions = new ListVpnGatewayConnectionLocalCidrsOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .build(); + .vpnGatewayId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.listVpnGatewayConnectionLocalCidrs(listVpnGatewayConnectionLocalCidrsOptions).execute(); @@ -8838,15 +8534,6 @@ public void testListVpnGatewayConnectionLocalCidrs() throws Exception { VPNGatewayConnectionLocalCIDRs vpnGatewayConnectionLocalCidRsResult = response.getResult(); assertNotNull(vpnGatewayConnectionLocalCidRsResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8857,26 +8544,17 @@ public void testListVpnGatewayConnectionLocalCidrs() throws Exception { public void testCheckVpnGatewayConnectionLocalCidr() throws Exception { try { CheckVpnGatewayConnectionLocalCidrOptions checkVpnGatewayConnectionLocalCidrOptions = new CheckVpnGatewayConnectionLocalCidrOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .cidrPrefix("testString") - .prefixLength("testString") - .build(); + .vpnGatewayId("testString") + .id("testString") + .cidrPrefix("testString") + .prefixLength("testString") + .build(); // Invoke operation Response response = service.checkVpnGatewayConnectionLocalCidr(checkVpnGatewayConnectionLocalCidrOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8887,27 +8565,17 @@ public void testCheckVpnGatewayConnectionLocalCidr() throws Exception { public void testAddVpnGatewayConnectionLocalCidr() throws Exception { try { AddVpnGatewayConnectionLocalCidrOptions addVpnGatewayConnectionLocalCidrOptions = new AddVpnGatewayConnectionLocalCidrOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .cidrPrefix("testString") - .prefixLength("testString") - .build(); + .vpnGatewayId("testString") + .id("testString") + .cidrPrefix("testString") + .prefixLength("testString") + .build(); // Invoke operation Response response = service.addVpnGatewayConnectionLocalCidr(addVpnGatewayConnectionLocalCidrOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8918,9 +8586,9 @@ public void testAddVpnGatewayConnectionLocalCidr() throws Exception { public void testListVpnGatewayConnectionPeerCidrs() throws Exception { try { ListVpnGatewayConnectionPeerCidrsOptions listVpnGatewayConnectionPeerCidrsOptions = new ListVpnGatewayConnectionPeerCidrsOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .build(); + .vpnGatewayId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.listVpnGatewayConnectionPeerCidrs(listVpnGatewayConnectionPeerCidrsOptions).execute(); @@ -8931,15 +8599,6 @@ public void testListVpnGatewayConnectionPeerCidrs() throws Exception { VPNGatewayConnectionPeerCIDRs vpnGatewayConnectionPeerCidRsResult = response.getResult(); assertNotNull(vpnGatewayConnectionPeerCidRsResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8950,26 +8609,17 @@ public void testListVpnGatewayConnectionPeerCidrs() throws Exception { public void testCheckVpnGatewayConnectionPeerCidr() throws Exception { try { CheckVpnGatewayConnectionPeerCidrOptions checkVpnGatewayConnectionPeerCidrOptions = new CheckVpnGatewayConnectionPeerCidrOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .cidrPrefix("testString") - .prefixLength("testString") - .build(); + .vpnGatewayId("testString") + .id("testString") + .cidrPrefix("testString") + .prefixLength("testString") + .build(); // Invoke operation Response response = service.checkVpnGatewayConnectionPeerCidr(checkVpnGatewayConnectionPeerCidrOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -8980,27 +8630,17 @@ public void testCheckVpnGatewayConnectionPeerCidr() throws Exception { public void testAddVpnGatewayConnectionPeerCidr() throws Exception { try { AddVpnGatewayConnectionPeerCidrOptions addVpnGatewayConnectionPeerCidrOptions = new AddVpnGatewayConnectionPeerCidrOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .cidrPrefix("testString") - .prefixLength("testString") - .build(); + .vpnGatewayId("testString") + .id("testString") + .cidrPrefix("testString") + .prefixLength("testString") + .build(); // Invoke operation Response response = service.addVpnGatewayConnectionPeerCidr(addVpnGatewayConnectionPeerCidrOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9011,12 +8651,12 @@ public void testAddVpnGatewayConnectionPeerCidr() throws Exception { public void testListVpnServers() throws Exception { try { ListVpnServersOptions listVpnServersOptions = new ListVpnServersOptions.Builder() - .name("testString") - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .sort("name") - .build(); + .name("testString") + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .build(); // Invoke operation Response response = service.listVpnServers(listVpnServersOptions).execute(); @@ -9033,52 +8673,86 @@ public void testListVpnServers() throws Exception { } } + @Test(dependsOnMethods = { "testListVpnServers" }) + public void testListVpnServersWithPager() throws Exception { + try { + ListVpnServersOptions options = new ListVpnServersOptions.Builder() + .name("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + VpnServersPager pager = new VpnServersPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new VpnServersPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateVpnServer() throws Exception { try { CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") - .build(); + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") + .build(); VPNServerAuthenticationByUsernameIdProviderByIAM vpnServerAuthenticationByUsernameIdProviderModel = new VPNServerAuthenticationByUsernameIdProviderByIAM.Builder() - .providerType("iam") - .build(); + .providerType("iam") + .build(); VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype vpnServerAuthenticationPrototypeModel = new VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.Builder() - .method("certificate") - .identityProvider(vpnServerAuthenticationByUsernameIdProviderModel) - .build(); + .method("certificate") + .identityProvider(vpnServerAuthenticationByUsernameIdProviderModel) + .build(); SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); IP ipModel = new IP.Builder() - .address("192.168.3.4") - .build(); + .address("192.168.3.4") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); + .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); CreateVpnServerOptions createVpnServerOptions = new CreateVpnServerOptions.Builder() - .certificate(certificateInstanceIdentityModel) - .clientAuthentication(new java.util.ArrayList(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel))) - .clientIpPool("172.16.0.0/16") - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) - .clientDnsServerIps(new java.util.ArrayList(java.util.Arrays.asList(ipModel))) - .clientIdleTimeout(Long.valueOf("600")) - .enableSplitTunneling(false) - .name("my-vpn-server") - .port(Long.valueOf("443")) - .protocol("udp") - .resourceGroup(resourceGroupIdentityModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) - .build(); + .certificate(certificateInstanceIdentityModel) + .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) + .clientIpPool("172.16.0.0/16") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .clientDnsServerIps(java.util.Arrays.asList(ipModel)) + .clientIdleTimeout(Long.valueOf("600")) + .enableSplitTunneling(false) + .name("my-vpn-server") + .port(Long.valueOf("443")) + .protocol("udp") + .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .build(); // Invoke operation Response response = service.createVpnServer(createVpnServerOptions).execute(); @@ -9089,16 +8763,6 @@ public void testCreateVpnServer() throws Exception { VPNServer vpnServerResult = response.getResult(); assertNotNull(vpnServerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9109,8 +8773,8 @@ public void testCreateVpnServer() throws Exception { public void testGetVpnServer() throws Exception { try { GetVpnServerOptions getVpnServerOptions = new GetVpnServerOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getVpnServer(getVpnServerOptions).execute(); @@ -9121,15 +8785,6 @@ public void testGetVpnServer() throws Exception { VPNServer vpnServerResult = response.getResult(); assertNotNull(vpnServerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9140,45 +8795,45 @@ public void testGetVpnServer() throws Exception { public void testUpdateVpnServer() throws Exception { try { CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") - .build(); + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") + .build(); VPNServerAuthenticationByUsernameIdProviderByIAM vpnServerAuthenticationByUsernameIdProviderModel = new VPNServerAuthenticationByUsernameIdProviderByIAM.Builder() - .providerType("iam") - .build(); + .providerType("iam") + .build(); VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype vpnServerAuthenticationPrototypeModel = new VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.Builder() - .method("certificate") - .identityProvider(vpnServerAuthenticationByUsernameIdProviderModel) - .build(); + .method("certificate") + .identityProvider(vpnServerAuthenticationByUsernameIdProviderModel) + .build(); IP ipModel = new IP.Builder() - .address("192.168.3.4") - .build(); + .address("192.168.3.4") + .build(); SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); VPNServerPatch vpnServerPatchModel = new VPNServerPatch.Builder() - .certificate(certificateInstanceIdentityModel) - .clientAuthentication(new java.util.ArrayList(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel))) - .clientDnsServerIps(new java.util.ArrayList(java.util.Arrays.asList(ipModel))) - .clientIdleTimeout(Long.valueOf("600")) - .clientIpPool("172.16.0.0/16") - .enableSplitTunneling(true) - .name("my-vpn-server") - .port(Long.valueOf("443")) - .protocol("udp") - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) - .build(); + .certificate(certificateInstanceIdentityModel) + .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) + .clientDnsServerIps(java.util.Arrays.asList(ipModel)) + .clientIdleTimeout(Long.valueOf("600")) + .clientIpPool("172.16.0.0/16") + .enableSplitTunneling(true) + .name("my-vpn-server") + .port(Long.valueOf("443")) + .protocol("udp") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .build(); Map vpnServerPatchModelAsPatch = vpnServerPatchModel.asPatch(); UpdateVpnServerOptions updateVpnServerOptions = new UpdateVpnServerOptions.Builder() - .id("testString") - .vpnServerPatch(vpnServerPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") - .build(); + .id("testString") + .vpnServerPatch(vpnServerPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.updateVpnServer(updateVpnServerOptions).execute(); @@ -9189,18 +8844,6 @@ public void testUpdateVpnServer() throws Exception { VPNServer vpnServerResult = response.getResult(); assertNotNull(vpnServerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // 412 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9211,8 +8854,8 @@ public void testUpdateVpnServer() throws Exception { public void testGetVpnServerClientConfiguration() throws Exception { try { GetVpnServerClientConfigurationOptions getVpnServerClientConfigurationOptions = new GetVpnServerClientConfigurationOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getVpnServerClientConfiguration(getVpnServerClientConfigurationOptions).execute(); @@ -9223,16 +8866,6 @@ public void testGetVpnServerClientConfiguration() throws Exception { String resultResult = response.getResult(); assertNotNull(resultResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 406 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9243,11 +8876,11 @@ public void testGetVpnServerClientConfiguration() throws Exception { public void testListVpnServerClients() throws Exception { try { ListVpnServerClientsOptions listVpnServerClientsOptions = new ListVpnServerClientsOptions.Builder() - .vpnServerId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .sort("created_at") - .build(); + .vpnServerId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .sort("created_at") + .build(); // Invoke operation Response response = service.listVpnServerClients(listVpnServerClientsOptions).execute(); @@ -9258,15 +8891,39 @@ public void testListVpnServerClients() throws Exception { VPNServerClientCollection vpnServerClientCollectionResult = response.getResult(); assertNotNull(vpnServerClientCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + @Test(dependsOnMethods = { "testListVpnServerClients" }) + public void testListVpnServerClientsWithPager() throws Exception { + try { + ListVpnServerClientsOptions options = new ListVpnServerClientsOptions.Builder() + .vpnServerId("testString") + .limit(Long.valueOf("10")) + .sort("created_at") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + VpnServerClientsPager pager = new VpnServerClientsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + // Test getAll(); + pager = new VpnServerClientsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9277,9 +8934,9 @@ public void testListVpnServerClients() throws Exception { public void testGetVpnServerClient() throws Exception { try { GetVpnServerClientOptions getVpnServerClientOptions = new GetVpnServerClientOptions.Builder() - .vpnServerId("testString") - .id("testString") - .build(); + .vpnServerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getVpnServerClient(getVpnServerClientOptions).execute(); @@ -9290,15 +8947,6 @@ public void testGetVpnServerClient() throws Exception { VPNServerClient vpnServerClientResult = response.getResult(); assertNotNull(vpnServerClientResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9309,24 +8957,15 @@ public void testGetVpnServerClient() throws Exception { public void testDisconnectVpnClient() throws Exception { try { DisconnectVpnClientOptions disconnectVpnClientOptions = new DisconnectVpnClientOptions.Builder() - .vpnServerId("testString") - .id("testString") - .build(); + .vpnServerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.disconnectVpnClient(disconnectVpnClientOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9337,11 +8976,11 @@ public void testDisconnectVpnClient() throws Exception { public void testListVpnServerRoutes() throws Exception { try { ListVpnServerRoutesOptions listVpnServerRoutesOptions = new ListVpnServerRoutesOptions.Builder() - .vpnServerId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .sort("name") - .build(); + .vpnServerId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); // Invoke operation Response response = service.listVpnServerRoutes(listVpnServerRoutesOptions).execute(); @@ -9352,15 +8991,39 @@ public void testListVpnServerRoutes() throws Exception { VPNServerRouteCollection vpnServerRouteCollectionResult = response.getResult(); assertNotNull(vpnServerRouteCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListVpnServerRoutes" }) + public void testListVpnServerRoutesWithPager() throws Exception { + try { + ListVpnServerRoutesOptions options = new ListVpnServerRoutesOptions.Builder() + .vpnServerId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + VpnServerRoutesPager pager = new VpnServerRoutesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + // Test getAll(); + pager = new VpnServerRoutesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9371,11 +9034,11 @@ public void testListVpnServerRoutes() throws Exception { public void testCreateVpnServerRoute() throws Exception { try { CreateVpnServerRouteOptions createVpnServerRouteOptions = new CreateVpnServerRouteOptions.Builder() - .vpnServerId("testString") - .destination("172.16.0.0/16") - .action("deliver") - .name("my-vpn-route-2") - .build(); + .vpnServerId("testString") + .destination("172.16.0.0/16") + .action("deliver") + .name("my-vpn-route-2") + .build(); // Invoke operation Response response = service.createVpnServerRoute(createVpnServerRouteOptions).execute(); @@ -9386,17 +9049,6 @@ public void testCreateVpnServerRoute() throws Exception { VPNServerRoute vpnServerRouteResult = response.getResult(); assertNotNull(vpnServerRouteResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9407,9 +9059,9 @@ public void testCreateVpnServerRoute() throws Exception { public void testGetVpnServerRoute() throws Exception { try { GetVpnServerRouteOptions getVpnServerRouteOptions = new GetVpnServerRouteOptions.Builder() - .vpnServerId("testString") - .id("testString") - .build(); + .vpnServerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getVpnServerRoute(getVpnServerRouteOptions).execute(); @@ -9420,15 +9072,6 @@ public void testGetVpnServerRoute() throws Exception { VPNServerRoute vpnServerRouteResult = response.getResult(); assertNotNull(vpnServerRouteResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9439,15 +9082,15 @@ public void testGetVpnServerRoute() throws Exception { public void testUpdateVpnServerRoute() throws Exception { try { VPNServerRoutePatch vpnServerRoutePatchModel = new VPNServerRoutePatch.Builder() - .name("my-vpn-route-2") - .build(); + .name("my-vpn-route-2") + .build(); Map vpnServerRoutePatchModelAsPatch = vpnServerRoutePatchModel.asPatch(); UpdateVpnServerRouteOptions updateVpnServerRouteOptions = new UpdateVpnServerRouteOptions.Builder() - .vpnServerId("testString") - .id("testString") - .vpnServerRoutePatch(vpnServerRoutePatchModelAsPatch) - .build(); + .vpnServerId("testString") + .id("testString") + .vpnServerRoutePatch(vpnServerRoutePatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateVpnServerRoute(updateVpnServerRouteOptions).execute(); @@ -9458,17 +9101,6 @@ public void testUpdateVpnServerRoute() throws Exception { VPNServerRoute vpnServerRouteResult = response.getResult(); assertNotNull(vpnServerRouteResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9479,9 +9111,9 @@ public void testUpdateVpnServerRoute() throws Exception { public void testListLoadBalancerProfiles() throws Exception { try { ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptions = new ListLoadBalancerProfilesOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listLoadBalancerProfiles(listLoadBalancerProfilesOptions).execute(); @@ -9498,12 +9130,43 @@ public void testListLoadBalancerProfiles() throws Exception { } } + @Test(dependsOnMethods = { "testListLoadBalancerProfiles" }) + public void testListLoadBalancerProfilesWithPager() throws Exception { + try { + ListLoadBalancerProfilesOptions options = new ListLoadBalancerProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + LoadBalancerProfilesPager pager = new LoadBalancerProfilesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new LoadBalancerProfilesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testGetLoadBalancerProfile() throws Exception { try { GetLoadBalancerProfileOptions getLoadBalancerProfileOptions = new GetLoadBalancerProfileOptions.Builder() - .name("testString") - .build(); + .name("testString") + .build(); // Invoke operation Response response = service.getLoadBalancerProfile(getLoadBalancerProfileOptions).execute(); @@ -9514,15 +9177,6 @@ public void testGetLoadBalancerProfile() throws Exception { LoadBalancerProfile loadBalancerProfileResult = response.getResult(); assertNotNull(loadBalancerProfileResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9533,9 +9187,9 @@ public void testGetLoadBalancerProfile() throws Exception { public void testListLoadBalancers() throws Exception { try { ListLoadBalancersOptions listLoadBalancersOptions = new ListLoadBalancersOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .build(); // Invoke operation Response response = service.listLoadBalancers(listLoadBalancersOptions).execute(); @@ -9552,93 +9206,140 @@ public void testListLoadBalancers() throws Exception { } } + @Test(dependsOnMethods = { "testListLoadBalancers" }) + public void testListLoadBalancersWithPager() throws Exception { + try { + ListLoadBalancersOptions options = new ListLoadBalancersOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + LoadBalancersPager pager = new LoadBalancersPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new LoadBalancersPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateLoadBalancer() throws Exception { try { SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") + .build(); LoadBalancerPoolIdentityByName loadBalancerPoolIdentityByNameModel = new LoadBalancerPoolIdentityByName.Builder() - .name("my-load-balancer-pool") - .build(); + .name("my-load-balancer-pool") + .build(); + + LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() + .id("70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + + LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototypeModel = new LoadBalancerListenerHTTPSRedirectPrototype.Builder() + .httpStatusCode(Long.valueOf("301")) + .listener(loadBalancerListenerIdentityModel) + .uri("/example?doc=get") + .build(); LoadBalancerListenerPrototypeLoadBalancerContext loadBalancerListenerPrototypeLoadBalancerContextModel = new LoadBalancerListenerPrototypeLoadBalancerContext.Builder() - .acceptProxyProtocol(true) - .connectionLimit(Long.valueOf("2000")) - .defaultPool(loadBalancerPoolIdentityByNameModel) - .port(Long.valueOf("443")) - .portMax(Long.valueOf("499")) - .portMin(Long.valueOf("443")) - .protocol("http") - .build(); + .acceptProxyProtocol(true) + .certificateInstance(certificateInstanceIdentityModel) + .connectionLimit(Long.valueOf("2000")) + .defaultPool(loadBalancerPoolIdentityByNameModel) + .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) + .port(Long.valueOf("443")) + .portMax(Long.valueOf("499")) + .portMin(Long.valueOf("443")) + .protocol("http") + .build(); LoadBalancerLoggingDatapath loadBalancerLoggingDatapathModel = new LoadBalancerLoggingDatapath.Builder() - .active(true) - .build(); + .active(true) + .build(); LoadBalancerLogging loadBalancerLoggingModel = new LoadBalancerLogging.Builder() - .datapath(loadBalancerLoggingDatapathModel) - .build(); + .datapath(loadBalancerLoggingDatapathModel) + .build(); LoadBalancerPoolHealthMonitorPrototype loadBalancerPoolHealthMonitorPrototypeModel = new LoadBalancerPoolHealthMonitorPrototype.Builder() - .delay(Long.valueOf("5")) - .maxRetries(Long.valueOf("2")) - .port(Long.valueOf("22")) - .timeout(Long.valueOf("2")) - .type("http") - .urlPath("/") - .build(); + .delay(Long.valueOf("5")) + .maxRetries(Long.valueOf("2")) + .port(Long.valueOf("22")) + .timeout(Long.valueOf("2")) + .type("http") + .urlPath("/") + .build(); LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("1e09281b-f177-46fb-baf1-bc152b2e391a") - .build(); + .id("1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("50")) - .build(); + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("50")) + .build(); LoadBalancerPoolSessionPersistencePrototype loadBalancerPoolSessionPersistencePrototypeModel = new LoadBalancerPoolSessionPersistencePrototype.Builder() - .cookieName("my-cookie-name") - .type("app_cookie") - .build(); + .cookieName("my-cookie-name") + .type("app_cookie") + .build(); LoadBalancerPoolPrototype loadBalancerPoolPrototypeModel = new LoadBalancerPoolPrototype.Builder() - .algorithm("least_connections") - .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) - .members(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))) - .name("my-load-balancer-pool") - .protocol("http") - .proxyProtocol("disabled") - .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) - .build(); + .algorithm("least_connections") + .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) + .name("my-load-balancer-pool") + .protocol("http") + .proxyProtocol("disabled") + .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) + .build(); LoadBalancerProfileIdentityByName loadBalancerProfileIdentityModel = new LoadBalancerProfileIdentityByName.Builder() - .name("network-fixed") - .build(); + .name("network-fixed") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); + .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); CreateLoadBalancerOptions createLoadBalancerOptions = new CreateLoadBalancerOptions.Builder() - .isPublic(true) - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) - .listeners(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPrototypeLoadBalancerContextModel))) - .logging(loadBalancerLoggingModel) - .name("my-load-balancer") - .pools(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolPrototypeModel))) - .profile(loadBalancerProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .routeMode(true) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) - .build(); + .isPublic(true) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .listeners(java.util.Arrays.asList(loadBalancerListenerPrototypeLoadBalancerContextModel)) + .logging(loadBalancerLoggingModel) + .name("my-load-balancer") + .pools(java.util.Arrays.asList(loadBalancerPoolPrototypeModel)) + .profile(loadBalancerProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .routeMode(true) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .build(); // Invoke operation Response response = service.createLoadBalancer(createLoadBalancerOptions).execute(); @@ -9649,16 +9350,6 @@ public void testCreateLoadBalancer() throws Exception { LoadBalancer loadBalancerResult = response.getResult(); assertNotNull(loadBalancerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9669,8 +9360,8 @@ public void testCreateLoadBalancer() throws Exception { public void testGetLoadBalancer() throws Exception { try { GetLoadBalancerOptions getLoadBalancerOptions = new GetLoadBalancerOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getLoadBalancer(getLoadBalancerOptions).execute(); @@ -9681,15 +9372,6 @@ public void testGetLoadBalancer() throws Exception { LoadBalancer loadBalancerResult = response.getResult(); assertNotNull(loadBalancerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9700,23 +9382,29 @@ public void testGetLoadBalancer() throws Exception { public void testUpdateLoadBalancer() throws Exception { try { LoadBalancerLoggingDatapath loadBalancerLoggingDatapathModel = new LoadBalancerLoggingDatapath.Builder() - .active(true) - .build(); + .active(true) + .build(); LoadBalancerLogging loadBalancerLoggingModel = new LoadBalancerLogging.Builder() - .datapath(loadBalancerLoggingDatapathModel) - .build(); + .datapath(loadBalancerLoggingDatapathModel) + .build(); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); LoadBalancerPatch loadBalancerPatchModel = new LoadBalancerPatch.Builder() - .logging(loadBalancerLoggingModel) - .name("my-load-balancer") - .build(); + .logging(loadBalancerLoggingModel) + .name("my-load-balancer") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .build(); Map loadBalancerPatchModelAsPatch = loadBalancerPatchModel.asPatch(); UpdateLoadBalancerOptions updateLoadBalancerOptions = new UpdateLoadBalancerOptions.Builder() - .id("testString") - .loadBalancerPatch(loadBalancerPatchModelAsPatch) - .build(); + .id("testString") + .loadBalancerPatch(loadBalancerPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.updateLoadBalancer(updateLoadBalancerOptions).execute(); @@ -9727,16 +9415,6 @@ public void testUpdateLoadBalancer() throws Exception { LoadBalancer loadBalancerResult = response.getResult(); assertNotNull(loadBalancerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9747,8 +9425,8 @@ public void testUpdateLoadBalancer() throws Exception { public void testGetLoadBalancerStatistics() throws Exception { try { GetLoadBalancerStatisticsOptions getLoadBalancerStatisticsOptions = new GetLoadBalancerStatisticsOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getLoadBalancerStatistics(getLoadBalancerStatisticsOptions).execute(); @@ -9759,15 +9437,6 @@ public void testGetLoadBalancerStatistics() throws Exception { LoadBalancerStatistics loadBalancerStatisticsResult = response.getResult(); assertNotNull(loadBalancerStatisticsResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9778,8 +9447,8 @@ public void testGetLoadBalancerStatistics() throws Exception { public void testListLoadBalancerListeners() throws Exception { try { ListLoadBalancerListenersOptions listLoadBalancerListenersOptions = new ListLoadBalancerListenersOptions.Builder() - .loadBalancerId("testString") - .build(); + .loadBalancerId("testString") + .build(); // Invoke operation Response response = service.listLoadBalancerListeners(listLoadBalancerListenersOptions).execute(); @@ -9800,55 +9469,55 @@ public void testListLoadBalancerListeners() throws Exception { public void testCreateLoadBalancerListener() throws Exception { try { CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") - .build(); + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") + .build(); LoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityById.Builder() - .id("70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); + .id("70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() - .id("70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); + .id("70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototypeModel = new LoadBalancerListenerHTTPSRedirectPrototype.Builder() - .httpStatusCode(Long.valueOf("301")) - .listener(loadBalancerListenerIdentityModel) - .uri("/example?doc=get") - .build(); + .httpStatusCode(Long.valueOf("301")) + .listener(loadBalancerListenerIdentityModel) + .uri("/example?doc=get") + .build(); LoadBalancerListenerPolicyRulePrototype loadBalancerListenerPolicyRulePrototypeModel = new LoadBalancerListenerPolicyRulePrototype.Builder() - .condition("contains") - .field("MY-APP-HEADER") - .type("body") - .value("testString") - .build(); + .condition("contains") + .field("MY-APP-HEADER") + .type("body") + .value("testString") + .build(); LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPrototypeModel = new LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); + .id("70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); LoadBalancerListenerPolicyPrototype loadBalancerListenerPolicyPrototypeModel = new LoadBalancerListenerPolicyPrototype.Builder() - .action("forward") - .name("my-policy") - .priority(Long.valueOf("5")) - .rules(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel))) - .target(loadBalancerListenerPolicyTargetPrototypeModel) - .build(); + .action("forward") + .name("my-policy") + .priority(Long.valueOf("5")) + .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) + .target(loadBalancerListenerPolicyTargetPrototypeModel) + .build(); CreateLoadBalancerListenerOptions createLoadBalancerListenerOptions = new CreateLoadBalancerListenerOptions.Builder() - .loadBalancerId("testString") - .protocol("http") - .acceptProxyProtocol(true) - .certificateInstance(certificateInstanceIdentityModel) - .connectionLimit(Long.valueOf("2000")) - .defaultPool(loadBalancerPoolIdentityModel) - .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) - .policies(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyPrototypeModel))) - .port(Long.valueOf("443")) - .portMax(Long.valueOf("499")) - .portMin(Long.valueOf("443")) - .build(); + .loadBalancerId("testString") + .protocol("http") + .acceptProxyProtocol(true) + .certificateInstance(certificateInstanceIdentityModel) + .connectionLimit(Long.valueOf("2000")) + .defaultPool(loadBalancerPoolIdentityModel) + .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) + .policies(java.util.Arrays.asList(loadBalancerListenerPolicyPrototypeModel)) + .port(Long.valueOf("443")) + .portMax(Long.valueOf("499")) + .portMin(Long.valueOf("443")) + .build(); // Invoke operation Response response = service.createLoadBalancerListener(createLoadBalancerListenerOptions).execute(); @@ -9859,15 +9528,6 @@ public void testCreateLoadBalancerListener() throws Exception { LoadBalancerListener loadBalancerListenerResult = response.getResult(); assertNotNull(loadBalancerListenerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9878,9 +9538,9 @@ public void testCreateLoadBalancerListener() throws Exception { public void testGetLoadBalancerListener() throws Exception { try { GetLoadBalancerListenerOptions getLoadBalancerListenerOptions = new GetLoadBalancerListenerOptions.Builder() - .loadBalancerId("testString") - .id("testString") - .build(); + .loadBalancerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getLoadBalancerListener(getLoadBalancerListenerOptions).execute(); @@ -9891,15 +9551,6 @@ public void testGetLoadBalancerListener() throws Exception { LoadBalancerListener loadBalancerListenerResult = response.getResult(); assertNotNull(loadBalancerListenerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9910,41 +9561,41 @@ public void testGetLoadBalancerListener() throws Exception { public void testUpdateLoadBalancerListener() throws Exception { try { CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") - .build(); + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") + .build(); LoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityById.Builder() - .id("70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); + .id("70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() - .id("70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); + .id("70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); LoadBalancerListenerHTTPSRedirectPatch loadBalancerListenerHttpsRedirectPatchModel = new LoadBalancerListenerHTTPSRedirectPatch.Builder() - .httpStatusCode(Long.valueOf("301")) - .listener(loadBalancerListenerIdentityModel) - .uri("/example?doc=get") - .build(); + .httpStatusCode(Long.valueOf("301")) + .listener(loadBalancerListenerIdentityModel) + .uri("/example?doc=get") + .build(); LoadBalancerListenerPatch loadBalancerListenerPatchModel = new LoadBalancerListenerPatch.Builder() - .acceptProxyProtocol(true) - .certificateInstance(certificateInstanceIdentityModel) - .connectionLimit(Long.valueOf("2000")) - .defaultPool(loadBalancerPoolIdentityModel) - .httpsRedirect(loadBalancerListenerHttpsRedirectPatchModel) - .port(Long.valueOf("443")) - .portMax(Long.valueOf("499")) - .portMin(Long.valueOf("443")) - .protocol("http") - .build(); + .acceptProxyProtocol(true) + .certificateInstance(certificateInstanceIdentityModel) + .connectionLimit(Long.valueOf("2000")) + .defaultPool(loadBalancerPoolIdentityModel) + .httpsRedirect(loadBalancerListenerHttpsRedirectPatchModel) + .port(Long.valueOf("443")) + .portMax(Long.valueOf("499")) + .portMin(Long.valueOf("443")) + .protocol("http") + .build(); Map loadBalancerListenerPatchModelAsPatch = loadBalancerListenerPatchModel.asPatch(); UpdateLoadBalancerListenerOptions updateLoadBalancerListenerOptions = new UpdateLoadBalancerListenerOptions.Builder() - .loadBalancerId("testString") - .id("testString") - .loadBalancerListenerPatch(loadBalancerListenerPatchModelAsPatch) - .build(); + .loadBalancerId("testString") + .id("testString") + .loadBalancerListenerPatch(loadBalancerListenerPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateLoadBalancerListener(updateLoadBalancerListenerOptions).execute(); @@ -9955,16 +9606,6 @@ public void testUpdateLoadBalancerListener() throws Exception { LoadBalancerListener loadBalancerListenerResult = response.getResult(); assertNotNull(loadBalancerListenerResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -9975,9 +9616,9 @@ public void testUpdateLoadBalancerListener() throws Exception { public void testListLoadBalancerListenerPolicies() throws Exception { try { ListLoadBalancerListenerPoliciesOptions listLoadBalancerListenerPoliciesOptions = new ListLoadBalancerListenerPoliciesOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .build(); + .loadBalancerId("testString") + .listenerId("testString") + .build(); // Invoke operation Response response = service.listLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptions).execute(); @@ -9998,25 +9639,25 @@ public void testListLoadBalancerListenerPolicies() throws Exception { public void testCreateLoadBalancerListenerPolicy() throws Exception { try { LoadBalancerListenerPolicyRulePrototype loadBalancerListenerPolicyRulePrototypeModel = new LoadBalancerListenerPolicyRulePrototype.Builder() - .condition("contains") - .field("MY-APP-HEADER") - .type("body") - .value("testString") - .build(); + .condition("contains") + .field("MY-APP-HEADER") + .type("body") + .value("testString") + .build(); LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPrototypeModel = new LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); + .id("70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); CreateLoadBalancerListenerPolicyOptions createLoadBalancerListenerPolicyOptions = new CreateLoadBalancerListenerPolicyOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .action("forward") - .priority(Long.valueOf("5")) - .name("my-policy") - .rules(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel))) - .target(loadBalancerListenerPolicyTargetPrototypeModel) - .build(); + .loadBalancerId("testString") + .listenerId("testString") + .action("forward") + .priority(Long.valueOf("5")) + .name("my-policy") + .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) + .target(loadBalancerListenerPolicyTargetPrototypeModel) + .build(); // Invoke operation Response response = service.createLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptions).execute(); @@ -10027,15 +9668,6 @@ public void testCreateLoadBalancerListenerPolicy() throws Exception { LoadBalancerListenerPolicy loadBalancerListenerPolicyResult = response.getResult(); assertNotNull(loadBalancerListenerPolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10046,10 +9678,10 @@ public void testCreateLoadBalancerListenerPolicy() throws Exception { public void testGetLoadBalancerListenerPolicy() throws Exception { try { GetLoadBalancerListenerPolicyOptions getLoadBalancerListenerPolicyOptions = new GetLoadBalancerListenerPolicyOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .id("testString") - .build(); + .loadBalancerId("testString") + .listenerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptions).execute(); @@ -10060,15 +9692,6 @@ public void testGetLoadBalancerListenerPolicy() throws Exception { LoadBalancerListenerPolicy loadBalancerListenerPolicyResult = response.getResult(); assertNotNull(loadBalancerListenerPolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10079,22 +9702,22 @@ public void testGetLoadBalancerListenerPolicy() throws Exception { public void testUpdateLoadBalancerListenerPolicy() throws Exception { try { LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPatchModel = new LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); + .id("70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); LoadBalancerListenerPolicyPatch loadBalancerListenerPolicyPatchModel = new LoadBalancerListenerPolicyPatch.Builder() - .name("my-policy") - .priority(Long.valueOf("5")) - .target(loadBalancerListenerPolicyTargetPatchModel) - .build(); + .name("my-policy") + .priority(Long.valueOf("5")) + .target(loadBalancerListenerPolicyTargetPatchModel) + .build(); Map loadBalancerListenerPolicyPatchModelAsPatch = loadBalancerListenerPolicyPatchModel.asPatch(); UpdateLoadBalancerListenerPolicyOptions updateLoadBalancerListenerPolicyOptions = new UpdateLoadBalancerListenerPolicyOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .id("testString") - .loadBalancerListenerPolicyPatch(loadBalancerListenerPolicyPatchModelAsPatch) - .build(); + .loadBalancerId("testString") + .listenerId("testString") + .id("testString") + .loadBalancerListenerPolicyPatch(loadBalancerListenerPolicyPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptions).execute(); @@ -10105,16 +9728,6 @@ public void testUpdateLoadBalancerListenerPolicy() throws Exception { LoadBalancerListenerPolicy loadBalancerListenerPolicyResult = response.getResult(); assertNotNull(loadBalancerListenerPolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10125,10 +9738,10 @@ public void testUpdateLoadBalancerListenerPolicy() throws Exception { public void testListLoadBalancerListenerPolicyRules() throws Exception { try { ListLoadBalancerListenerPolicyRulesOptions listLoadBalancerListenerPolicyRulesOptions = new ListLoadBalancerListenerPolicyRulesOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") - .build(); + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") + .build(); // Invoke operation Response response = service.listLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptions).execute(); @@ -10149,14 +9762,14 @@ public void testListLoadBalancerListenerPolicyRules() throws Exception { public void testCreateLoadBalancerListenerPolicyRule() throws Exception { try { CreateLoadBalancerListenerPolicyRuleOptions createLoadBalancerListenerPolicyRuleOptions = new CreateLoadBalancerListenerPolicyRuleOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") - .condition("contains") - .type("body") - .value("testString") - .field("MY-APP-HEADER") - .build(); + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") + .condition("contains") + .type("body") + .value("testString") + .field("MY-APP-HEADER") + .build(); // Invoke operation Response response = service.createLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptions).execute(); @@ -10167,15 +9780,6 @@ public void testCreateLoadBalancerListenerPolicyRule() throws Exception { LoadBalancerListenerPolicyRule loadBalancerListenerPolicyRuleResult = response.getResult(); assertNotNull(loadBalancerListenerPolicyRuleResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10186,11 +9790,11 @@ public void testCreateLoadBalancerListenerPolicyRule() throws Exception { public void testGetLoadBalancerListenerPolicyRule() throws Exception { try { GetLoadBalancerListenerPolicyRuleOptions getLoadBalancerListenerPolicyRuleOptions = new GetLoadBalancerListenerPolicyRuleOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") - .id("testString") - .build(); + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptions).execute(); @@ -10201,15 +9805,6 @@ public void testGetLoadBalancerListenerPolicyRule() throws Exception { LoadBalancerListenerPolicyRule loadBalancerListenerPolicyRuleResult = response.getResult(); assertNotNull(loadBalancerListenerPolicyRuleResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10220,20 +9815,20 @@ public void testGetLoadBalancerListenerPolicyRule() throws Exception { public void testUpdateLoadBalancerListenerPolicyRule() throws Exception { try { LoadBalancerListenerPolicyRulePatch loadBalancerListenerPolicyRulePatchModel = new LoadBalancerListenerPolicyRulePatch.Builder() - .condition("contains") - .field("MY-APP-HEADER") - .type("body") - .value("testString") - .build(); + .condition("contains") + .field("MY-APP-HEADER") + .type("body") + .value("testString") + .build(); Map loadBalancerListenerPolicyRulePatchModelAsPatch = loadBalancerListenerPolicyRulePatchModel.asPatch(); UpdateLoadBalancerListenerPolicyRuleOptions updateLoadBalancerListenerPolicyRuleOptions = new UpdateLoadBalancerListenerPolicyRuleOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") - .id("testString") - .loadBalancerListenerPolicyRulePatch(loadBalancerListenerPolicyRulePatchModelAsPatch) - .build(); + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") + .id("testString") + .loadBalancerListenerPolicyRulePatch(loadBalancerListenerPolicyRulePatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptions).execute(); @@ -10244,16 +9839,6 @@ public void testUpdateLoadBalancerListenerPolicyRule() throws Exception { LoadBalancerListenerPolicyRule loadBalancerListenerPolicyRuleResult = response.getResult(); assertNotNull(loadBalancerListenerPolicyRuleResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10264,8 +9849,8 @@ public void testUpdateLoadBalancerListenerPolicyRule() throws Exception { public void testListLoadBalancerPools() throws Exception { try { ListLoadBalancerPoolsOptions listLoadBalancerPoolsOptions = new ListLoadBalancerPoolsOptions.Builder() - .loadBalancerId("testString") - .build(); + .loadBalancerId("testString") + .build(); // Invoke operation Response response = service.listLoadBalancerPools(listLoadBalancerPoolsOptions).execute(); @@ -10286,39 +9871,39 @@ public void testListLoadBalancerPools() throws Exception { public void testCreateLoadBalancerPool() throws Exception { try { LoadBalancerPoolHealthMonitorPrototype loadBalancerPoolHealthMonitorPrototypeModel = new LoadBalancerPoolHealthMonitorPrototype.Builder() - .delay(Long.valueOf("5")) - .maxRetries(Long.valueOf("2")) - .port(Long.valueOf("22")) - .timeout(Long.valueOf("2")) - .type("http") - .urlPath("/") - .build(); + .delay(Long.valueOf("5")) + .maxRetries(Long.valueOf("2")) + .port(Long.valueOf("22")) + .timeout(Long.valueOf("2")) + .type("http") + .urlPath("/") + .build(); LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("1e09281b-f177-46fb-baf1-bc152b2e391a") - .build(); + .id("1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("50")) - .build(); + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("50")) + .build(); LoadBalancerPoolSessionPersistencePrototype loadBalancerPoolSessionPersistencePrototypeModel = new LoadBalancerPoolSessionPersistencePrototype.Builder() - .cookieName("my-cookie-name") - .type("app_cookie") - .build(); + .cookieName("my-cookie-name") + .type("app_cookie") + .build(); CreateLoadBalancerPoolOptions createLoadBalancerPoolOptions = new CreateLoadBalancerPoolOptions.Builder() - .loadBalancerId("testString") - .algorithm("least_connections") - .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) - .protocol("http") - .members(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))) - .name("my-load-balancer-pool") - .proxyProtocol("disabled") - .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) - .build(); + .loadBalancerId("testString") + .algorithm("least_connections") + .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) + .protocol("http") + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) + .name("my-load-balancer-pool") + .proxyProtocol("disabled") + .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) + .build(); // Invoke operation Response response = service.createLoadBalancerPool(createLoadBalancerPoolOptions).execute(); @@ -10329,17 +9914,6 @@ public void testCreateLoadBalancerPool() throws Exception { LoadBalancerPool loadBalancerPoolResult = response.getResult(); assertNotNull(loadBalancerPoolResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10350,9 +9924,9 @@ public void testCreateLoadBalancerPool() throws Exception { public void testGetLoadBalancerPool() throws Exception { try { GetLoadBalancerPoolOptions getLoadBalancerPoolOptions = new GetLoadBalancerPoolOptions.Builder() - .loadBalancerId("testString") - .id("testString") - .build(); + .loadBalancerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getLoadBalancerPool(getLoadBalancerPoolOptions).execute(); @@ -10363,15 +9937,6 @@ public void testGetLoadBalancerPool() throws Exception { LoadBalancerPool loadBalancerPoolResult = response.getResult(); assertNotNull(loadBalancerPoolResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10382,34 +9947,34 @@ public void testGetLoadBalancerPool() throws Exception { public void testUpdateLoadBalancerPool() throws Exception { try { LoadBalancerPoolHealthMonitorPatch loadBalancerPoolHealthMonitorPatchModel = new LoadBalancerPoolHealthMonitorPatch.Builder() - .delay(Long.valueOf("5")) - .maxRetries(Long.valueOf("2")) - .port(Long.valueOf("22")) - .timeout(Long.valueOf("2")) - .type("http") - .urlPath("/") - .build(); + .delay(Long.valueOf("5")) + .maxRetries(Long.valueOf("2")) + .port(Long.valueOf("22")) + .timeout(Long.valueOf("2")) + .type("http") + .urlPath("/") + .build(); LoadBalancerPoolSessionPersistencePatch loadBalancerPoolSessionPersistencePatchModel = new LoadBalancerPoolSessionPersistencePatch.Builder() - .cookieName("my-cookie-name") - .type("app_cookie") - .build(); + .cookieName("my-cookie-name") + .type("app_cookie") + .build(); LoadBalancerPoolPatch loadBalancerPoolPatchModel = new LoadBalancerPoolPatch.Builder() - .algorithm("least_connections") - .healthMonitor(loadBalancerPoolHealthMonitorPatchModel) - .name("my-load-balancer-pool") - .protocol("http") - .proxyProtocol("disabled") - .sessionPersistence(loadBalancerPoolSessionPersistencePatchModel) - .build(); + .algorithm("least_connections") + .healthMonitor(loadBalancerPoolHealthMonitorPatchModel) + .name("my-load-balancer-pool") + .protocol("http") + .proxyProtocol("disabled") + .sessionPersistence(loadBalancerPoolSessionPersistencePatchModel) + .build(); Map loadBalancerPoolPatchModelAsPatch = loadBalancerPoolPatchModel.asPatch(); UpdateLoadBalancerPoolOptions updateLoadBalancerPoolOptions = new UpdateLoadBalancerPoolOptions.Builder() - .loadBalancerId("testString") - .id("testString") - .loadBalancerPoolPatch(loadBalancerPoolPatchModelAsPatch) - .build(); + .loadBalancerId("testString") + .id("testString") + .loadBalancerPoolPatch(loadBalancerPoolPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateLoadBalancerPool(updateLoadBalancerPoolOptions).execute(); @@ -10420,16 +9985,6 @@ public void testUpdateLoadBalancerPool() throws Exception { LoadBalancerPool loadBalancerPoolResult = response.getResult(); assertNotNull(loadBalancerPoolResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10440,9 +9995,9 @@ public void testUpdateLoadBalancerPool() throws Exception { public void testListLoadBalancerPoolMembers() throws Exception { try { ListLoadBalancerPoolMembersOptions listLoadBalancerPoolMembersOptions = new ListLoadBalancerPoolMembersOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .build(); + .loadBalancerId("testString") + .poolId("testString") + .build(); // Invoke operation Response response = service.listLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptions).execute(); @@ -10463,16 +10018,16 @@ public void testListLoadBalancerPoolMembers() throws Exception { public void testCreateLoadBalancerPoolMember() throws Exception { try { LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("1e09281b-f177-46fb-baf1-bc152b2e391a") - .build(); + .id("1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); CreateLoadBalancerPoolMemberOptions createLoadBalancerPoolMemberOptions = new CreateLoadBalancerPoolMemberOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("50")) - .build(); + .loadBalancerId("testString") + .poolId("testString") + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("50")) + .build(); // Invoke operation Response response = service.createLoadBalancerPoolMember(createLoadBalancerPoolMemberOptions).execute(); @@ -10483,17 +10038,6 @@ public void testCreateLoadBalancerPoolMember() throws Exception { LoadBalancerPoolMember loadBalancerPoolMemberResult = response.getResult(); assertNotNull(loadBalancerPoolMemberResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10504,20 +10048,20 @@ public void testCreateLoadBalancerPoolMember() throws Exception { public void testReplaceLoadBalancerPoolMembers() throws Exception { try { LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("1e09281b-f177-46fb-baf1-bc152b2e391a") - .build(); + .id("1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("50")) - .build(); + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("50")) + .build(); ReplaceLoadBalancerPoolMembersOptions replaceLoadBalancerPoolMembersOptions = new ReplaceLoadBalancerPoolMembersOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .members(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))) - .build(); + .loadBalancerId("testString") + .poolId("testString") + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) + .build(); // Invoke operation Response response = service.replaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptions).execute(); @@ -10528,17 +10072,6 @@ public void testReplaceLoadBalancerPoolMembers() throws Exception { LoadBalancerPoolMemberCollection loadBalancerPoolMemberCollectionResult = response.getResult(); assertNotNull(loadBalancerPoolMemberCollectionResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10549,10 +10082,10 @@ public void testReplaceLoadBalancerPoolMembers() throws Exception { public void testGetLoadBalancerPoolMember() throws Exception { try { GetLoadBalancerPoolMemberOptions getLoadBalancerPoolMemberOptions = new GetLoadBalancerPoolMemberOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .id("testString") - .build(); + .loadBalancerId("testString") + .poolId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getLoadBalancerPoolMember(getLoadBalancerPoolMemberOptions).execute(); @@ -10563,15 +10096,6 @@ public void testGetLoadBalancerPoolMember() throws Exception { LoadBalancerPoolMember loadBalancerPoolMemberResult = response.getResult(); assertNotNull(loadBalancerPoolMemberResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10582,22 +10106,22 @@ public void testGetLoadBalancerPoolMember() throws Exception { public void testUpdateLoadBalancerPoolMember() throws Exception { try { LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("1e09281b-f177-46fb-baf1-bc152b2e391a") - .build(); + .id("1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); LoadBalancerPoolMemberPatch loadBalancerPoolMemberPatchModel = new LoadBalancerPoolMemberPatch.Builder() - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("50")) - .build(); + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("50")) + .build(); Map loadBalancerPoolMemberPatchModelAsPatch = loadBalancerPoolMemberPatchModel.asPatch(); UpdateLoadBalancerPoolMemberOptions updateLoadBalancerPoolMemberOptions = new UpdateLoadBalancerPoolMemberOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .id("testString") - .loadBalancerPoolMemberPatch(loadBalancerPoolMemberPatchModelAsPatch) - .build(); + .loadBalancerId("testString") + .poolId("testString") + .id("testString") + .loadBalancerPoolMemberPatch(loadBalancerPoolMemberPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptions).execute(); @@ -10608,17 +10132,6 @@ public void testUpdateLoadBalancerPoolMember() throws Exception { LoadBalancerPoolMember loadBalancerPoolMemberResult = response.getResult(); assertNotNull(loadBalancerPoolMemberResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10629,11 +10142,11 @@ public void testUpdateLoadBalancerPoolMember() throws Exception { public void testListEndpointGateways() throws Exception { try { ListEndpointGatewaysOptions listEndpointGatewaysOptions = new ListEndpointGatewaysOptions.Builder() - .name("testString") - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .build(); + .name("testString") + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); // Invoke operation Response response = service.listEndpointGateways(listEndpointGatewaysOptions).execute(); @@ -10650,38 +10163,71 @@ public void testListEndpointGateways() throws Exception { } } + @Test(dependsOnMethods = { "testListEndpointGateways" }) + public void testListEndpointGatewaysWithPager() throws Exception { + try { + ListEndpointGatewaysOptions options = new ListEndpointGatewaysOptions.Builder() + .name("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + EndpointGatewaysPager pager = new EndpointGatewaysPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new EndpointGatewaysPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateEndpointGateway() throws Exception { try { - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN endpointGatewayTargetPrototypeModel = new EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.Builder() - .resourceType("provider_infrastructure_service") - .crn("crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::") - .build(); + EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName endpointGatewayTargetPrototypeModel = new EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.Builder() + .resourceType("provider_infrastructure_service") + .name("ibm-ntp-server") + .build(); VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("f025b503-ae66-46de-a011-3bd08fd5f7bf") - .build(); + .id("f025b503-ae66-46de-a011-3bd08fd5f7bf") + .build(); EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById endpointGatewayReservedIpModel = new EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById.Builder() - .id("6d353a0f-aeb1-4ae1-832e-1110d10981bb") - .build(); + .id("6d353a0f-aeb1-4ae1-832e-1110d10981bb") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); + .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); CreateEndpointGatewayOptions createEndpointGatewayOptions = new CreateEndpointGatewayOptions.Builder() - .target(endpointGatewayTargetPrototypeModel) - .vpc(vpcIdentityModel) - .ips(new java.util.ArrayList(java.util.Arrays.asList(endpointGatewayReservedIpModel))) - .name("testString") - .resourceGroup(resourceGroupIdentityModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) - .build(); + .target(endpointGatewayTargetPrototypeModel) + .vpc(vpcIdentityModel) + .ips(java.util.Arrays.asList(endpointGatewayReservedIpModel)) + .name("testString") + .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .build(); // Invoke operation Response response = service.createEndpointGateway(createEndpointGatewayOptions).execute(); @@ -10692,16 +10238,6 @@ public void testCreateEndpointGateway() throws Exception { EndpointGateway endpointGatewayResult = response.getResult(); assertNotNull(endpointGatewayResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10712,11 +10248,11 @@ public void testCreateEndpointGateway() throws Exception { public void testListEndpointGatewayIps() throws Exception { try { ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptions = new ListEndpointGatewayIpsOptions.Builder() - .endpointGatewayId("testString") - .start("testString") - .limit(Long.valueOf("1")) - .sort("name") - .build(); + .endpointGatewayId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); // Invoke operation Response response = service.listEndpointGatewayIps(listEndpointGatewayIpsOptions).execute(); @@ -10727,15 +10263,39 @@ public void testListEndpointGatewayIps() throws Exception { ReservedIPCollectionEndpointGatewayContext reservedIpCollectionEndpointGatewayContextResult = response.getResult(); assertNotNull(reservedIpCollectionEndpointGatewayContextResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListEndpointGatewayIps" }) + public void testListEndpointGatewayIpsWithPager() throws Exception { + try { + ListEndpointGatewayIpsOptions options = new ListEndpointGatewayIpsOptions.Builder() + .endpointGatewayId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + EndpointGatewayIpsPager pager = new EndpointGatewayIpsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // + // Test getAll(); + pager = new EndpointGatewayIpsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10746,9 +10306,9 @@ public void testListEndpointGatewayIps() throws Exception { public void testGetEndpointGatewayIp() throws Exception { try { GetEndpointGatewayIpOptions getEndpointGatewayIpOptions = new GetEndpointGatewayIpOptions.Builder() - .endpointGatewayId("testString") - .id("testString") - .build(); + .endpointGatewayId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.getEndpointGatewayIp(getEndpointGatewayIpOptions).execute(); @@ -10759,15 +10319,6 @@ public void testGetEndpointGatewayIp() throws Exception { ReservedIP reservedIpResult = response.getResult(); assertNotNull(reservedIpResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10778,9 +10329,9 @@ public void testGetEndpointGatewayIp() throws Exception { public void testAddEndpointGatewayIp() throws Exception { try { AddEndpointGatewayIpOptions addEndpointGatewayIpOptions = new AddEndpointGatewayIpOptions.Builder() - .endpointGatewayId("testString") - .id("testString") - .build(); + .endpointGatewayId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.addEndpointGatewayIp(addEndpointGatewayIpOptions).execute(); @@ -10791,16 +10342,6 @@ public void testAddEndpointGatewayIp() throws Exception { ReservedIP reservedIpResult = response.getResult(); assertNotNull(reservedIpResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10811,8 +10352,8 @@ public void testAddEndpointGatewayIp() throws Exception { public void testGetEndpointGateway() throws Exception { try { GetEndpointGatewayOptions getEndpointGatewayOptions = new GetEndpointGatewayOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getEndpointGateway(getEndpointGatewayOptions).execute(); @@ -10823,15 +10364,6 @@ public void testGetEndpointGateway() throws Exception { EndpointGateway endpointGatewayResult = response.getResult(); assertNotNull(endpointGatewayResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10842,14 +10374,14 @@ public void testGetEndpointGateway() throws Exception { public void testUpdateEndpointGateway() throws Exception { try { EndpointGatewayPatch endpointGatewayPatchModel = new EndpointGatewayPatch.Builder() - .name("my-endpoint-gateway") - .build(); + .name("my-endpoint-gateway") + .build(); Map endpointGatewayPatchModelAsPatch = endpointGatewayPatchModel.asPatch(); UpdateEndpointGatewayOptions updateEndpointGatewayOptions = new UpdateEndpointGatewayOptions.Builder() - .id("testString") - .endpointGatewayPatch(endpointGatewayPatchModelAsPatch) - .build(); + .id("testString") + .endpointGatewayPatch(endpointGatewayPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateEndpointGateway(updateEndpointGatewayOptions).execute(); @@ -10860,16 +10392,6 @@ public void testUpdateEndpointGateway() throws Exception { EndpointGateway endpointGatewayResult = response.getResult(); assertNotNull(endpointGatewayResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10880,16 +10402,16 @@ public void testUpdateEndpointGateway() throws Exception { public void testListFlowLogCollectors() throws Exception { try { ListFlowLogCollectorsOptions listFlowLogCollectorsOptions = new ListFlowLogCollectorsOptions.Builder() - .start("testString") - .limit(Long.valueOf("1")) - .resourceGroupId("testString") - .name("testString") - .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") - .targetId("testString") - .targetResourceType("instance") - .build(); + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .targetId("testString") + .targetResourceType("instance") + .build(); // Invoke operation Response response = service.listFlowLogCollectors(listFlowLogCollectorsOptions).execute(); @@ -10906,28 +10428,66 @@ public void testListFlowLogCollectors() throws Exception { } } + @Test(dependsOnMethods = { "testListFlowLogCollectors" }) + public void testListFlowLogCollectorsWithPager() throws Exception { + try { + ListFlowLogCollectorsOptions options = new ListFlowLogCollectorsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .targetId("testString") + .targetResourceType("instance") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + FlowLogCollectorsPager pager = new FlowLogCollectorsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new FlowLogCollectorsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @Test public void testCreateFlowLogCollector() throws Exception { try { LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName legacyCloudObjectStorageBucketIdentityModel = new LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.Builder() - .name("bucket-27200-lwx4cfvcue") - .build(); + .name("bucket-27200-lwx4cfvcue") + .build(); FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById flowLogCollectorTargetPrototypeModel = new FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById.Builder() - .id("10c02d81-0ecb-4dc5-897d-28392913b81e") - .build(); + .id("10c02d81-0ecb-4dc5-897d-28392913b81e") + .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); CreateFlowLogCollectorOptions createFlowLogCollectorOptions = new CreateFlowLogCollectorOptions.Builder() - .storageBucket(legacyCloudObjectStorageBucketIdentityModel) - .target(flowLogCollectorTargetPrototypeModel) - .active(false) - .name("my-flow-log-collector") - .resourceGroup(resourceGroupIdentityModel) - .build(); + .storageBucket(legacyCloudObjectStorageBucketIdentityModel) + .target(flowLogCollectorTargetPrototypeModel) + .active(false) + .name("my-flow-log-collector") + .resourceGroup(resourceGroupIdentityModel) + .build(); // Invoke operation Response response = service.createFlowLogCollector(createFlowLogCollectorOptions).execute(); @@ -10938,16 +10498,6 @@ public void testCreateFlowLogCollector() throws Exception { FlowLogCollector flowLogCollectorResult = response.getResult(); assertNotNull(flowLogCollectorResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10958,8 +10508,8 @@ public void testCreateFlowLogCollector() throws Exception { public void testGetFlowLogCollector() throws Exception { try { GetFlowLogCollectorOptions getFlowLogCollectorOptions = new GetFlowLogCollectorOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.getFlowLogCollector(getFlowLogCollectorOptions).execute(); @@ -10970,15 +10520,6 @@ public void testGetFlowLogCollector() throws Exception { FlowLogCollector flowLogCollectorResult = response.getResult(); assertNotNull(flowLogCollectorResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -10989,15 +10530,15 @@ public void testGetFlowLogCollector() throws Exception { public void testUpdateFlowLogCollector() throws Exception { try { FlowLogCollectorPatch flowLogCollectorPatchModel = new FlowLogCollectorPatch.Builder() - .active(true) - .name("my-flow-log-collector") - .build(); + .active(true) + .name("my-flow-log-collector") + .build(); Map flowLogCollectorPatchModelAsPatch = flowLogCollectorPatchModel.asPatch(); UpdateFlowLogCollectorOptions updateFlowLogCollectorOptions = new UpdateFlowLogCollectorOptions.Builder() - .id("testString") - .flowLogCollectorPatch(flowLogCollectorPatchModelAsPatch) - .build(); + .id("testString") + .flowLogCollectorPatch(flowLogCollectorPatchModelAsPatch) + .build(); // Invoke operation Response response = service.updateFlowLogCollector(updateFlowLogCollectorOptions).execute(); @@ -11008,16 +10549,6 @@ public void testUpdateFlowLogCollector() throws Exception { FlowLogCollector flowLogCollectorResult = response.getResult(); assertNotNull(flowLogCollectorResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11028,23 +10559,14 @@ public void testUpdateFlowLogCollector() throws Exception { public void testUnsetSubnetPublicGateway() throws Exception { try { UnsetSubnetPublicGatewayOptions unsetSubnetPublicGatewayOptions = new UnsetSubnetPublicGatewayOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.unsetSubnetPublicGateway(unsetSubnetPublicGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11055,26 +10577,17 @@ public void testUnsetSubnetPublicGateway() throws Exception { public void testRemoveVpnGatewayConnectionPeerCidr() throws Exception { try { RemoveVpnGatewayConnectionPeerCidrOptions removeVpnGatewayConnectionPeerCidrOptions = new RemoveVpnGatewayConnectionPeerCidrOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .cidrPrefix("testString") - .prefixLength("testString") - .build(); + .vpnGatewayId("testString") + .id("testString") + .cidrPrefix("testString") + .prefixLength("testString") + .build(); // Invoke operation Response response = service.removeVpnGatewayConnectionPeerCidr(removeVpnGatewayConnectionPeerCidrOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11085,26 +10598,17 @@ public void testRemoveVpnGatewayConnectionPeerCidr() throws Exception { public void testRemoveVpnGatewayConnectionLocalCidr() throws Exception { try { RemoveVpnGatewayConnectionLocalCidrOptions removeVpnGatewayConnectionLocalCidrOptions = new RemoveVpnGatewayConnectionLocalCidrOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .cidrPrefix("testString") - .prefixLength("testString") - .build(); + .vpnGatewayId("testString") + .id("testString") + .cidrPrefix("testString") + .prefixLength("testString") + .build(); // Invoke operation Response response = service.removeVpnGatewayConnectionLocalCidr(removeVpnGatewayConnectionLocalCidrOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11115,25 +10619,16 @@ public void testRemoveVpnGatewayConnectionLocalCidr() throws Exception { public void testRemoveInstanceNetworkInterfaceFloatingIp() throws Exception { try { RemoveInstanceNetworkInterfaceFloatingIpOptions removeInstanceNetworkInterfaceFloatingIpOptions = new RemoveInstanceNetworkInterfaceFloatingIpOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") - .id("testString") - .build(); + .instanceId("testString") + .networkInterfaceId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.removeInstanceNetworkInterfaceFloatingIp(removeInstanceNetworkInterfaceFloatingIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11144,25 +10639,15 @@ public void testRemoveInstanceNetworkInterfaceFloatingIp() throws Exception { public void testRemoveEndpointGatewayIp() throws Exception { try { RemoveEndpointGatewayIpOptions removeEndpointGatewayIpOptions = new RemoveEndpointGatewayIpOptions.Builder() - .endpointGatewayId("testString") - .id("testString") - .build(); + .endpointGatewayId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.removeEndpointGatewayIp(removeEndpointGatewayIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11173,26 +10658,16 @@ public void testRemoveEndpointGatewayIp() throws Exception { public void testRemoveBareMetalServerNetworkInterfaceFloatingIp() throws Exception { try { RemoveBareMetalServerNetworkInterfaceFloatingIpOptions removeBareMetalServerNetworkInterfaceFloatingIpOptions = new RemoveBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") - .id("testString") - .build(); + .bareMetalServerId("testString") + .networkInterfaceId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.removeBareMetalServerNetworkInterfaceFloatingIp(removeBareMetalServerNetworkInterfaceFloatingIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11203,24 +10678,15 @@ public void testRemoveBareMetalServerNetworkInterfaceFloatingIp() throws Excepti public void testDeleteVpnServerRoute() throws Exception { try { DeleteVpnServerRouteOptions deleteVpnServerRouteOptions = new DeleteVpnServerRouteOptions.Builder() - .vpnServerId("testString") - .id("testString") - .build(); + .vpnServerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteVpnServerRoute(deleteVpnServerRouteOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11231,24 +10697,15 @@ public void testDeleteVpnServerRoute() throws Exception { public void testDeleteVpnServerClient() throws Exception { try { DeleteVpnServerClientOptions deleteVpnServerClientOptions = new DeleteVpnServerClientOptions.Builder() - .vpnServerId("testString") - .id("testString") - .build(); + .vpnServerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteVpnServerClient(deleteVpnServerClientOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11259,25 +10716,15 @@ public void testDeleteVpnServerClient() throws Exception { public void testDeleteVpnServer() throws Exception { try { DeleteVpnServerOptions deleteVpnServerOptions = new DeleteVpnServerOptions.Builder() - .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") - .build(); + .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.deleteVpnServer(deleteVpnServerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 412 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11288,25 +10735,15 @@ public void testDeleteVpnServer() throws Exception { public void testDeleteVpnGatewayConnection() throws Exception { try { DeleteVpnGatewayConnectionOptions deleteVpnGatewayConnectionOptions = new DeleteVpnGatewayConnectionOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .build(); + .vpnGatewayId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteVpnGatewayConnection(deleteVpnGatewayConnectionOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11317,24 +10754,14 @@ public void testDeleteVpnGatewayConnection() throws Exception { public void testDeleteVpnGateway() throws Exception { try { DeleteVpnGatewayOptions deleteVpnGatewayOptions = new DeleteVpnGatewayOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteVpnGateway(deleteVpnGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11345,25 +10772,16 @@ public void testDeleteVpnGateway() throws Exception { public void testDeleteVpcRoutingTableRoute() throws Exception { try { DeleteVpcRoutingTableRouteOptions deleteVpcRoutingTableRouteOptions = new DeleteVpcRoutingTableRouteOptions.Builder() - .vpcId("testString") - .routingTableId("testString") - .id("testString") - .build(); + .vpcId("testString") + .routingTableId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteVpcRoutingTableRoute(deleteVpcRoutingTableRouteOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11374,28 +10792,16 @@ public void testDeleteVpcRoutingTableRoute() throws Exception { public void testDeleteVpcRoutingTable() throws Exception { try { DeleteVpcRoutingTableOptions deleteVpcRoutingTableOptions = new DeleteVpcRoutingTableOptions.Builder() - .vpcId("testString") - .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") - .build(); + .vpcId("testString") + .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.deleteVpcRoutingTable(deleteVpcRoutingTableOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 403 - // 404 - // 409 - // 412 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11406,24 +10812,15 @@ public void testDeleteVpcRoutingTable() throws Exception { public void testDeleteVpcRoute() throws Exception { try { DeleteVpcRouteOptions deleteVpcRouteOptions = new DeleteVpcRouteOptions.Builder() - .vpcId("testString") - .id("testString") - .build(); + .vpcId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteVpcRoute(deleteVpcRouteOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11434,25 +10831,15 @@ public void testDeleteVpcRoute() throws Exception { public void testDeleteVpcAddressPrefix() throws Exception { try { DeleteVpcAddressPrefixOptions deleteVpcAddressPrefixOptions = new DeleteVpcAddressPrefixOptions.Builder() - .vpcId("testString") - .id("testString") - .build(); + .vpcId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteVpcAddressPrefix(deleteVpcAddressPrefixOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11463,24 +10850,14 @@ public void testDeleteVpcAddressPrefix() throws Exception { public void testDeleteVpc() throws Exception { try { DeleteVpcOptions deleteVpcOptions = new DeleteVpcOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteVpc(deleteVpcOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11491,26 +10868,15 @@ public void testDeleteVpc() throws Exception { public void testDeleteVolume() throws Exception { try { DeleteVolumeOptions deleteVolumeOptions = new DeleteVolumeOptions.Builder() - .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") - .build(); + .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.deleteVolume(deleteVolumeOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // 412 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11521,26 +10887,15 @@ public void testDeleteVolume() throws Exception { public void testDeleteSubnetReservedIp() throws Exception { try { DeleteSubnetReservedIpOptions deleteSubnetReservedIpOptions = new DeleteSubnetReservedIpOptions.Builder() - .subnetId("testString") - .id("testString") - .build(); + .subnetId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteSubnetReservedIp(deleteSubnetReservedIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 403 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11551,24 +10906,14 @@ public void testDeleteSubnetReservedIp() throws Exception { public void testDeleteSubnet() throws Exception { try { DeleteSubnetOptions deleteSubnetOptions = new DeleteSubnetOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteSubnet(deleteSubnetOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11579,24 +10924,14 @@ public void testDeleteSubnet() throws Exception { public void testDeleteSnapshots() throws Exception { try { DeleteSnapshotsOptions deleteSnapshotsOptions = new DeleteSnapshotsOptions.Builder() - .sourceVolumeId("testString") - .build(); + .sourceVolumeId("testString") + .build(); // Invoke operation Response response = service.deleteSnapshots(deleteSnapshotsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 412 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11607,25 +10942,15 @@ public void testDeleteSnapshots() throws Exception { public void testDeleteSnapshot() throws Exception { try { DeleteSnapshotOptions deleteSnapshotOptions = new DeleteSnapshotOptions.Builder() - .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") - .build(); + .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.deleteSnapshot(deleteSnapshotOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 412 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11636,25 +10961,15 @@ public void testDeleteSnapshot() throws Exception { public void testDeleteSecurityGroupTargetBinding() throws Exception { try { DeleteSecurityGroupTargetBindingOptions deleteSecurityGroupTargetBindingOptions = new DeleteSecurityGroupTargetBindingOptions.Builder() - .securityGroupId("testString") - .id("testString") - .build(); + .securityGroupId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11665,24 +10980,15 @@ public void testDeleteSecurityGroupTargetBinding() throws Exception { public void testDeleteSecurityGroupRule() throws Exception { try { DeleteSecurityGroupRuleOptions deleteSecurityGroupRuleOptions = new DeleteSecurityGroupRuleOptions.Builder() - .securityGroupId("testString") - .id("testString") - .build(); + .securityGroupId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteSecurityGroupRule(deleteSecurityGroupRuleOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11693,25 +10999,14 @@ public void testDeleteSecurityGroupRule() throws Exception { public void testDeleteSecurityGroup() throws Exception { try { DeleteSecurityGroupOptions deleteSecurityGroupOptions = new DeleteSecurityGroupOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteSecurityGroup(deleteSecurityGroupOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 403 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11722,24 +11017,14 @@ public void testDeleteSecurityGroup() throws Exception { public void testDeletePublicGateway() throws Exception { try { DeletePublicGatewayOptions deletePublicGatewayOptions = new DeletePublicGatewayOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deletePublicGateway(deletePublicGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11750,24 +11035,14 @@ public void testDeletePublicGateway() throws Exception { public void testDeletePlacementGroup() throws Exception { try { DeletePlacementGroupOptions deletePlacementGroupOptions = new DeletePlacementGroupOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deletePlacementGroup(deletePlacementGroupOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11778,24 +11053,15 @@ public void testDeletePlacementGroup() throws Exception { public void testDeleteNetworkAclRule() throws Exception { try { DeleteNetworkAclRuleOptions deleteNetworkAclRuleOptions = new DeleteNetworkAclRuleOptions.Builder() - .networkAclId("testString") - .id("testString") - .build(); + .networkAclId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteNetworkAclRule(deleteNetworkAclRuleOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11806,25 +11072,14 @@ public void testDeleteNetworkAclRule() throws Exception { public void testDeleteNetworkAcl() throws Exception { try { DeleteNetworkAclOptions deleteNetworkAclOptions = new DeleteNetworkAclOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteNetworkAcl(deleteNetworkAclOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 403 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11835,26 +11090,16 @@ public void testDeleteNetworkAcl() throws Exception { public void testDeleteLoadBalancerPoolMember() throws Exception { try { DeleteLoadBalancerPoolMemberOptions deleteLoadBalancerPoolMemberOptions = new DeleteLoadBalancerPoolMemberOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .id("testString") - .build(); + .loadBalancerId("testString") + .poolId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteLoadBalancerPoolMember(deleteLoadBalancerPoolMemberOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11865,25 +11110,15 @@ public void testDeleteLoadBalancerPoolMember() throws Exception { public void testDeleteLoadBalancerPool() throws Exception { try { DeleteLoadBalancerPoolOptions deleteLoadBalancerPoolOptions = new DeleteLoadBalancerPoolOptions.Builder() - .loadBalancerId("testString") - .id("testString") - .build(); + .loadBalancerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteLoadBalancerPool(deleteLoadBalancerPoolOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11894,26 +11129,17 @@ public void testDeleteLoadBalancerPool() throws Exception { public void testDeleteLoadBalancerListenerPolicyRule() throws Exception { try { DeleteLoadBalancerListenerPolicyRuleOptions deleteLoadBalancerListenerPolicyRuleOptions = new DeleteLoadBalancerListenerPolicyRuleOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") - .id("testString") - .build(); + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11924,25 +11150,16 @@ public void testDeleteLoadBalancerListenerPolicyRule() throws Exception { public void testDeleteLoadBalancerListenerPolicy() throws Exception { try { DeleteLoadBalancerListenerPolicyOptions deleteLoadBalancerListenerPolicyOptions = new DeleteLoadBalancerListenerPolicyOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .id("testString") - .build(); + .loadBalancerId("testString") + .listenerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11953,25 +11170,15 @@ public void testDeleteLoadBalancerListenerPolicy() throws Exception { public void testDeleteLoadBalancerListener() throws Exception { try { DeleteLoadBalancerListenerOptions deleteLoadBalancerListenerOptions = new DeleteLoadBalancerListenerOptions.Builder() - .loadBalancerId("testString") - .id("testString") - .build(); + .loadBalancerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteLoadBalancerListener(deleteLoadBalancerListenerOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -11982,24 +11189,15 @@ public void testDeleteLoadBalancerListener() throws Exception { public void testDeleteLoadBalancer() throws Exception { try { DeleteLoadBalancerOptions deleteLoadBalancerOptions = new DeleteLoadBalancerOptions.Builder() - .id("testString") - .build(); + .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.deleteLoadBalancer(deleteLoadBalancerOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12010,23 +11208,14 @@ public void testDeleteLoadBalancer() throws Exception { public void testDeleteKey() throws Exception { try { DeleteKeyOptions deleteKeyOptions = new DeleteKeyOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteKey(deleteKeyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12037,24 +11226,14 @@ public void testDeleteKey() throws Exception { public void testDeleteIpsecPolicy() throws Exception { try { DeleteIpsecPolicyOptions deleteIpsecPolicyOptions = new DeleteIpsecPolicyOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteIpsecPolicy(deleteIpsecPolicyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12065,26 +11244,15 @@ public void testDeleteIpsecPolicy() throws Exception { public void testDeleteInstanceVolumeAttachment() throws Exception { try { DeleteInstanceVolumeAttachmentOptions deleteInstanceVolumeAttachmentOptions = new DeleteInstanceVolumeAttachmentOptions.Builder() - .instanceId("testString") - .id("testString") - .build(); + .instanceId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteInstanceVolumeAttachment(deleteInstanceVolumeAttachmentOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 400 - // 403 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12095,24 +11263,14 @@ public void testDeleteInstanceVolumeAttachment() throws Exception { public void testDeleteInstanceTemplate() throws Exception { try { DeleteInstanceTemplateOptions deleteInstanceTemplateOptions = new DeleteInstanceTemplateOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteInstanceTemplate(deleteInstanceTemplateOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12123,25 +11281,15 @@ public void testDeleteInstanceTemplate() throws Exception { public void testDeleteInstanceNetworkInterface() throws Exception { try { DeleteInstanceNetworkInterfaceOptions deleteInstanceNetworkInterfaceOptions = new DeleteInstanceNetworkInterfaceOptions.Builder() - .instanceId("testString") - .id("testString") - .build(); + .instanceId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteInstanceNetworkInterface(deleteInstanceNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 403 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12152,23 +11300,14 @@ public void testDeleteInstanceNetworkInterface() throws Exception { public void testDeleteInstanceGroupMemberships() throws Exception { try { DeleteInstanceGroupMembershipsOptions deleteInstanceGroupMembershipsOptions = new DeleteInstanceGroupMembershipsOptions.Builder() - .instanceGroupId("testString") - .build(); + .instanceGroupId("testString") + .build(); // Invoke operation Response response = service.deleteInstanceGroupMemberships(deleteInstanceGroupMembershipsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12179,24 +11318,15 @@ public void testDeleteInstanceGroupMemberships() throws Exception { public void testDeleteInstanceGroupMembership() throws Exception { try { DeleteInstanceGroupMembershipOptions deleteInstanceGroupMembershipOptions = new DeleteInstanceGroupMembershipOptions.Builder() - .instanceGroupId("testString") - .id("testString") - .build(); + .instanceGroupId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteInstanceGroupMembership(deleteInstanceGroupMembershipOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12207,25 +11337,16 @@ public void testDeleteInstanceGroupMembership() throws Exception { public void testDeleteInstanceGroupManagerPolicy() throws Exception { try { DeleteInstanceGroupManagerPolicyOptions deleteInstanceGroupManagerPolicyOptions = new DeleteInstanceGroupManagerPolicyOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .id("testString") - .build(); + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteInstanceGroupManagerPolicy(deleteInstanceGroupManagerPolicyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12236,25 +11357,16 @@ public void testDeleteInstanceGroupManagerPolicy() throws Exception { public void testDeleteInstanceGroupManagerAction() throws Exception { try { DeleteInstanceGroupManagerActionOptions deleteInstanceGroupManagerActionOptions = new DeleteInstanceGroupManagerActionOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .id("testString") - .build(); + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteInstanceGroupManagerAction(deleteInstanceGroupManagerActionOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12265,24 +11377,15 @@ public void testDeleteInstanceGroupManagerAction() throws Exception { public void testDeleteInstanceGroupManager() throws Exception { try { DeleteInstanceGroupManagerOptions deleteInstanceGroupManagerOptions = new DeleteInstanceGroupManagerOptions.Builder() - .instanceGroupId("testString") - .id("testString") - .build(); + .instanceGroupId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteInstanceGroupManager(deleteInstanceGroupManagerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12293,23 +11396,14 @@ public void testDeleteInstanceGroupManager() throws Exception { public void testDeleteInstanceGroupLoadBalancer() throws Exception { try { DeleteInstanceGroupLoadBalancerOptions deleteInstanceGroupLoadBalancerOptions = new DeleteInstanceGroupLoadBalancerOptions.Builder() - .instanceGroupId("testString") - .build(); + .instanceGroupId("testString") + .build(); // Invoke operation Response response = service.deleteInstanceGroupLoadBalancer(deleteInstanceGroupLoadBalancerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12320,23 +11414,14 @@ public void testDeleteInstanceGroupLoadBalancer() throws Exception { public void testDeleteInstanceGroup() throws Exception { try { DeleteInstanceGroupOptions deleteInstanceGroupOptions = new DeleteInstanceGroupOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteInstanceGroup(deleteInstanceGroupOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12347,23 +11432,14 @@ public void testDeleteInstanceGroup() throws Exception { public void testDeleteInstance() throws Exception { try { DeleteInstanceOptions deleteInstanceOptions = new DeleteInstanceOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteInstance(deleteInstanceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12374,25 +11450,14 @@ public void testDeleteInstance() throws Exception { public void testDeleteImage() throws Exception { try { DeleteImageOptions deleteImageOptions = new DeleteImageOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteImage(deleteImageOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 403 - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12403,24 +11468,14 @@ public void testDeleteImage() throws Exception { public void testDeleteIkePolicy() throws Exception { try { DeleteIkePolicyOptions deleteIkePolicyOptions = new DeleteIkePolicyOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteIkePolicy(deleteIkePolicyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12431,23 +11486,14 @@ public void testDeleteIkePolicy() throws Exception { public void testDeleteFlowLogCollector() throws Exception { try { DeleteFlowLogCollectorOptions deleteFlowLogCollectorOptions = new DeleteFlowLogCollectorOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteFlowLogCollector(deleteFlowLogCollectorOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12458,24 +11504,14 @@ public void testDeleteFlowLogCollector() throws Exception { public void testDeleteFloatingIp() throws Exception { try { DeleteFloatingIpOptions deleteFloatingIpOptions = new DeleteFloatingIpOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteFloatingIp(deleteFloatingIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12486,24 +11522,14 @@ public void testDeleteFloatingIp() throws Exception { public void testDeleteEndpointGateway() throws Exception { try { DeleteEndpointGatewayOptions deleteEndpointGatewayOptions = new DeleteEndpointGatewayOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteEndpointGateway(deleteEndpointGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 409 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12514,23 +11540,14 @@ public void testDeleteEndpointGateway() throws Exception { public void testDeleteDedicatedHostGroup() throws Exception { try { DeleteDedicatedHostGroupOptions deleteDedicatedHostGroupOptions = new DeleteDedicatedHostGroupOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteDedicatedHostGroup(deleteDedicatedHostGroupOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12541,23 +11558,14 @@ public void testDeleteDedicatedHostGroup() throws Exception { public void testDeleteDedicatedHost() throws Exception { try { DeleteDedicatedHostOptions deleteDedicatedHostOptions = new DeleteDedicatedHostOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteDedicatedHost(deleteDedicatedHostOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12568,25 +11576,15 @@ public void testDeleteDedicatedHost() throws Exception { public void testDeleteBareMetalServerNetworkInterface() throws Exception { try { DeleteBareMetalServerNetworkInterfaceOptions deleteBareMetalServerNetworkInterfaceOptions = new DeleteBareMetalServerNetworkInterfaceOptions.Builder() - .bareMetalServerId("testString") - .id("testString") - .build(); + .bareMetalServerId("testString") + .id("testString") + .build(); // Invoke operation Response response = service.deleteBareMetalServerNetworkInterface(deleteBareMetalServerNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 403 - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12597,23 +11595,14 @@ public void testDeleteBareMetalServerNetworkInterface() throws Exception { public void testDeleteBareMetalServer() throws Exception { try { DeleteBareMetalServerOptions deleteBareMetalServerOptions = new DeleteBareMetalServerOptions.Builder() - .id("testString") - .build(); + .id("testString") + .build(); // Invoke operation Response response = service.deleteBareMetalServer(deleteBareMetalServerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12624,10 +11613,10 @@ public void testDeleteBareMetalServer() throws Exception { public void testDeleteBackupPolicyPlan() throws Exception { try { DeleteBackupPolicyPlanOptions deleteBackupPolicyPlanOptions = new DeleteBackupPolicyPlanOptions.Builder() - .backupPolicyId("testString") - .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") - .build(); + .backupPolicyId("testString") + .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.deleteBackupPolicyPlan(deleteBackupPolicyPlanOptions).execute(); @@ -12638,16 +11627,6 @@ public void testDeleteBackupPolicyPlan() throws Exception { BackupPolicyPlan backupPolicyPlanResult = response.getResult(); assertNotNull(backupPolicyPlanResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 412 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -12658,9 +11637,9 @@ public void testDeleteBackupPolicyPlan() throws Exception { public void testDeleteBackupPolicy() throws Exception { try { DeleteBackupPolicyOptions deleteBackupPolicyOptions = new DeleteBackupPolicyOptions.Builder() - .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") - .build(); + .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation Response response = service.deleteBackupPolicy(deleteBackupPolicyOptions).execute(); @@ -12671,16 +11650,6 @@ public void testDeleteBackupPolicy() throws Exception { BackupPolicy backupPolicyResult = response.getResult(); assertNotNull(backupPolicyResult); - - // - // The following status codes aren't covered by tests. - // Please provide integration tests for these too. - // - // 404 - // 412 - // - // - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcTest.java index c0375f4ca8..2df427d36f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcTest.java @@ -23,6 +23,7 @@ import com.ibm.cloud.is.vpc.v1.model.AddressPrefixCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.AddressPrefixCollectionNext; import com.ibm.cloud.is.vpc.v1.model.AddressPrefixPatch; +import com.ibm.cloud.is.vpc.v1.model.BackupPoliciesPager; import com.ibm.cloud.is.vpc.v1.model.BackupPolicy; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyCollection; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyCollectionFirst; @@ -54,6 +55,7 @@ import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationUserAccount; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterface; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceByHiperSocket; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceByPCI; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceByVLAN; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceCollection; @@ -61,8 +63,10 @@ import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceCollectionNext; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePatch; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototype; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacesPager; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerPatch; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerPrimaryNetworkInterfacePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfile; @@ -108,8 +112,15 @@ import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfileOSArchitecture; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfileReference; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfileSupportedTrustedPlatformModuleModes; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfilesPager; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerStatusReason; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerTrustedPlatformModule; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServersPager; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingIdentity; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingIdentityCatalogOfferingByCRN; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionIdentity; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionReference; import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceIdentity; import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceReference; @@ -184,6 +195,7 @@ import com.ibm.cloud.is.vpc.v1.model.DedicatedHostGroupPrototypeDedicatedHostByZoneContext; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostGroupReference; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostGroupReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.DedicatedHostGroupsPager; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostPatch; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostProfile; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostProfileCollection; @@ -214,11 +226,13 @@ import com.ibm.cloud.is.vpc.v1.model.DedicatedHostProfileVCPUEnum; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostProfileVCPUFixed; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostProfileVCPURange; +import com.ibm.cloud.is.vpc.v1.model.DedicatedHostProfilesPager; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostPrototype; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostPrototypeDedicatedHostByGroup; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostPrototypeDedicatedHostByZone; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostReference; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.DedicatedHostsPager; import com.ibm.cloud.is.vpc.v1.model.DefaultNetworkACL; import com.ibm.cloud.is.vpc.v1.model.DefaultRoutingTable; import com.ibm.cloud.is.vpc.v1.model.DefaultSecurityGroup; @@ -282,6 +296,7 @@ import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayCollection; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayCollectionNext; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayIpsPager; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayPatch; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayReservedIP; @@ -297,6 +312,7 @@ import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayTargetProviderCloudServiceReference; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayTargetProviderInfrastructureServiceReference; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewaysPager; import com.ibm.cloud.is.vpc.v1.model.FloatingIP; import com.ibm.cloud.is.vpc.v1.model.FloatingIPByTargetNetworkInterfaceIdentity; import com.ibm.cloud.is.vpc.v1.model.FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref; @@ -317,6 +333,7 @@ import com.ibm.cloud.is.vpc.v1.model.FloatingIPTargetPatchNetworkInterfaceIdentityById; import com.ibm.cloud.is.vpc.v1.model.FloatingIPTargetPublicGatewayReference; import com.ibm.cloud.is.vpc.v1.model.FloatingIPUnpaginatedCollection; +import com.ibm.cloud.is.vpc.v1.model.FloatingIpsPager; import com.ibm.cloud.is.vpc.v1.model.FlowLogCollector; import com.ibm.cloud.is.vpc.v1.model.FlowLogCollectorCollection; import com.ibm.cloud.is.vpc.v1.model.FlowLogCollectorCollectionFirst; @@ -343,12 +360,14 @@ import com.ibm.cloud.is.vpc.v1.model.FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.FlowLogCollectorTargetSubnetReference; import com.ibm.cloud.is.vpc.v1.model.FlowLogCollectorTargetVPCReference; +import com.ibm.cloud.is.vpc.v1.model.FlowLogCollectorsPager; import com.ibm.cloud.is.vpc.v1.model.GenericResourceReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.GetBackupPolicyOptions; import com.ibm.cloud.is.vpc.v1.model.GetBackupPolicyPlanOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerDiskOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerInitializationOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerNetworkInterfaceFloatingIpOptions; +import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerNetworkInterfaceIpOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerNetworkInterfaceOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.GetBareMetalServerProfileOptions; @@ -433,7 +452,9 @@ import com.ibm.cloud.is.vpc.v1.model.IPsecPolicyPatch; import com.ibm.cloud.is.vpc.v1.model.IPsecPolicyReference; import com.ibm.cloud.is.vpc.v1.model.IPsecPolicyReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.IkePoliciesPager; import com.ibm.cloud.is.vpc.v1.model.Image; +import com.ibm.cloud.is.vpc.v1.model.ImageCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.ImageCollection; import com.ibm.cloud.is.vpc.v1.model.ImageCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.ImageCollectionNext; @@ -451,11 +472,16 @@ import com.ibm.cloud.is.vpc.v1.model.ImageReference; import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ImageStatusReason; +import com.ibm.cloud.is.vpc.v1.model.ImagesPager; import com.ibm.cloud.is.vpc.v1.model.Instance; import com.ibm.cloud.is.vpc.v1.model.InstanceAction; import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPolicy; import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPolicyPatch; import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOffering; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototypeCatalogOfferingByOffering; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototypeCatalogOfferingByVersion; import com.ibm.cloud.is.vpc.v1.model.InstanceCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.InstanceCollectionNext; @@ -492,11 +518,13 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionsCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionsCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionsCollectionNext; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionsPager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerAutoScale; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerCollectionNext; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerPatch; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerPoliciesPager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerPolicy; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerPolicyCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerPolicyCollectionFirst; @@ -521,20 +549,24 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagersPager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembership; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipCollectionNext; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipPatch; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipsPager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupPatch; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupReference; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupsPager; import com.ibm.cloud.is.vpc.v1.model.InstanceInitialization; import com.ibm.cloud.is.vpc.v1.model.InstanceInitializationDefaultTrustedProfile; import com.ibm.cloud.is.vpc.v1.model.InstanceInitializationPassword; import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataService; import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePatch; import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceNetworkInterfaceIpsPager; import com.ibm.cloud.is.vpc.v1.model.InstancePatch; import com.ibm.cloud.is.vpc.v1.model.InstancePatchProfile; import com.ibm.cloud.is.vpc.v1.model.InstancePatchProfileInstanceProfileIdentityByHref; @@ -621,6 +653,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthFixed; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthRange; import com.ibm.cloud.is.vpc.v1.model.InstancePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByImage; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceBySourceTemplate; @@ -635,15 +668,20 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityById; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImage; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePatch; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceByCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceByImage; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceBySourceTemplate; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateReference; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.InstanceVCPU; +import com.ibm.cloud.is.vpc.v1.model.InstancesPager; +import com.ibm.cloud.is.vpc.v1.model.IpsecPoliciesPager; import com.ibm.cloud.is.vpc.v1.model.Key; import com.ibm.cloud.is.vpc.v1.model.KeyCollection; import com.ibm.cloud.is.vpc.v1.model.KeyCollectionFirst; @@ -656,13 +694,16 @@ import com.ibm.cloud.is.vpc.v1.model.KeyPatch; import com.ibm.cloud.is.vpc.v1.model.KeyReference; import com.ibm.cloud.is.vpc.v1.model.KeyReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.KeysPager; import com.ibm.cloud.is.vpc.v1.model.LegacyCloudObjectStorageBucketIdentity; import com.ibm.cloud.is.vpc.v1.model.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName; import com.ibm.cloud.is.vpc.v1.model.LegacyCloudObjectStorageBucketReference; +import com.ibm.cloud.is.vpc.v1.model.LifecycleReason; import com.ibm.cloud.is.vpc.v1.model.ListBackupPoliciesOptions; import com.ibm.cloud.is.vpc.v1.model.ListBackupPolicyPlansOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerDisksOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerNetworkInterfaceFloatingIpsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerNetworkInterfaceIpsOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerNetworkInterfacesOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServerProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListBareMetalServersOptions; @@ -828,8 +869,10 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupported; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupportedDependent; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupportedFixed; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfilesPager; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerStatistics; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancersPager; import com.ibm.cloud.is.vpc.v1.model.NetworkACL; import com.ibm.cloud.is.vpc.v1.model.NetworkACLCollection; import com.ibm.cloud.is.vpc.v1.model.NetworkACLCollectionFirst; @@ -864,14 +907,16 @@ import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePatch; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContext; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolAll; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolICMP; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.NetworkAclRulesPager; +import com.ibm.cloud.is.vpc.v1.model.NetworkAclsPager; import com.ibm.cloud.is.vpc.v1.model.NetworkInterface; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceBareMetalServerContextReference; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceBareMetalServerContextReferenceDeleted; @@ -895,12 +940,14 @@ import com.ibm.cloud.is.vpc.v1.model.OperatingSystemIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemIdentityByName; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemReference; +import com.ibm.cloud.is.vpc.v1.model.OperatingSystemsPager; import com.ibm.cloud.is.vpc.v1.model.PlacementGroup; import com.ibm.cloud.is.vpc.v1.model.PlacementGroupCollection; import com.ibm.cloud.is.vpc.v1.model.PlacementGroupCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.PlacementGroupCollectionNext; import com.ibm.cloud.is.vpc.v1.model.PlacementGroupPatch; import com.ibm.cloud.is.vpc.v1.model.PlacementGroupReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.PlacementGroupsPager; import com.ibm.cloud.is.vpc.v1.model.PublicGateway; import com.ibm.cloud.is.vpc.v1.model.PublicGatewayCollection; import com.ibm.cloud.is.vpc.v1.model.PublicGatewayCollectionFirst; @@ -920,6 +967,7 @@ import com.ibm.cloud.is.vpc.v1.model.PublicGatewayPatch; import com.ibm.cloud.is.vpc.v1.model.PublicGatewayReference; import com.ibm.cloud.is.vpc.v1.model.PublicGatewayReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.PublicGatewaysPager; import com.ibm.cloud.is.vpc.v1.model.Region; import com.ibm.cloud.is.vpc.v1.model.RegionCollection; import com.ibm.cloud.is.vpc.v1.model.RegionReference; @@ -1037,6 +1085,8 @@ import com.ibm.cloud.is.vpc.v1.model.SecurityGroupTargetReferenceLoadBalancerReference; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupTargetReferenceVPNServerReference; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupTargetsPager; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupsPager; import com.ibm.cloud.is.vpc.v1.model.SetSubnetPublicGatewayOptions; import com.ibm.cloud.is.vpc.v1.model.Snapshot; import com.ibm.cloud.is.vpc.v1.model.SnapshotCollection; @@ -1051,6 +1101,7 @@ import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototypeSnapshotBySourceVolume; import com.ibm.cloud.is.vpc.v1.model.SnapshotReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SnapshotsPager; import com.ibm.cloud.is.vpc.v1.model.StartBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.StopBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.Subnet; @@ -1071,6 +1122,8 @@ import com.ibm.cloud.is.vpc.v1.model.SubnetPublicGatewayPatchPublicGatewayIdentityById; import com.ibm.cloud.is.vpc.v1.model.SubnetReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SubnetReservedIpsPager; +import com.ibm.cloud.is.vpc.v1.model.SubnetsPager; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentity; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityTrustedProfileByCRN; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityTrustedProfileById; @@ -1247,6 +1300,7 @@ import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileReference; +import com.ibm.cloud.is.vpc.v1.model.VolumeProfilesPager; import com.ibm.cloud.is.vpc.v1.model.VolumePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeInstanceBySourceSnapshotContext; @@ -1255,6 +1309,16 @@ import com.ibm.cloud.is.vpc.v1.model.VolumeReference; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.VolumeStatusReason; +import com.ibm.cloud.is.vpc.v1.model.VolumesPager; +import com.ibm.cloud.is.vpc.v1.model.VpcAddressPrefixesPager; +import com.ibm.cloud.is.vpc.v1.model.VpcRoutesPager; +import com.ibm.cloud.is.vpc.v1.model.VpcRoutingTableRoutesPager; +import com.ibm.cloud.is.vpc.v1.model.VpcRoutingTablesPager; +import com.ibm.cloud.is.vpc.v1.model.VpcsPager; +import com.ibm.cloud.is.vpc.v1.model.VpnGatewaysPager; +import com.ibm.cloud.is.vpc.v1.model.VpnServerClientsPager; +import com.ibm.cloud.is.vpc.v1.model.VpnServerRoutesPager; +import com.ibm.cloud.is.vpc.v1.model.VpnServersPager; import com.ibm.cloud.is.vpc.v1.model.Zone; import com.ibm.cloud.is.vpc.v1.model.ZoneCollection; import com.ibm.cloud.is.vpc.v1.model.ZoneIdentity; @@ -1271,7 +1335,6 @@ import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -1296,7 +1359,7 @@ public class VpcTest extends PowerMockTestCase { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - String version = "2022-03-29"; + String version = "2022-09-13"; protected MockWebServer server; protected Vpc vpcService; @@ -1330,7 +1393,7 @@ public void testListVpcsWOptions() throws Throwable { // Construct an instance of the ListVpcsOptions model ListVpcsOptions listVpcsOptionsModel = new ListVpcsOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .classicAccess(true) .build(); @@ -1354,7 +1417,7 @@ public void testListVpcsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(Boolean.valueOf(query.get("classic_access")), Boolean.valueOf(true)); } @@ -1369,6 +1432,72 @@ public void testListVpcsWRetries() throws Throwable { testListVpcsWOptions(); } + // Test the listVpcs operation using the VpcsPager.getNext() method + @Test + public void testListVpcsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"vpcs\":[{\"classic_access\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"cse_source_ips\":[{\"ip\":{\"address\":\"192.168.3.4\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"default_network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"default_routing_table\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"default_security_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpc\",\"status\":\"available\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"vpcs\":[{\"classic_access\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"cse_source_ips\":[{\"ip\":{\"address\":\"192.168.3.4\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"default_network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"default_routing_table\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"default_security_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpc\",\"status\":\"available\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpcsOptions listVpcsOptions = new ListVpcsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .classicAccess(true) + .build(); + + List allResults = new ArrayList<>(); + VpcsPager pager = new VpcsPager(vpcService, listVpcsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listVpcs operation using the VpcsPager.getAll() method + @Test + public void testListVpcsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"vpcs\":[{\"classic_access\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"cse_source_ips\":[{\"ip\":{\"address\":\"192.168.3.4\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"default_network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"default_routing_table\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"default_security_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpc\",\"status\":\"available\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"vpcs\":[{\"classic_access\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"cse_source_ips\":[{\"ip\":{\"address\":\"192.168.3.4\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"default_network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"default_routing_table\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"default_security_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpc\",\"status\":\"available\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpcsOptions listVpcsOptions = new ListVpcsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .classicAccess(true) + .build(); + + VpcsPager pager = new VpcsPager(vpcService, listVpcsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createVpc operation with a valid options model parameter @Test public void testCreateVpcWOptions() throws Throwable { @@ -1592,7 +1721,7 @@ public void testUpdateVpcNoOptions() throws Throwable { @Test public void testGetVpcDefaultNetworkAclWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"mnemonic-ersatz-eatery-mythology\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-2\", \"source\": \"192.168.3.0/24\", \"code\": 0, \"protocol\": \"icmp\", \"type\": 8}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"mnemonic-ersatz-eatery-mythology\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-1\", \"source\": \"192.168.3.0/24\", \"destination_port_max\": 22, \"destination_port_min\": 22, \"protocol\": \"udp\", \"source_port_max\": 65535, \"source_port_min\": 49152}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; String getVpcDefaultNetworkAclPath = "/vpcs/testString/default_network_acl"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -1762,7 +1891,7 @@ public void testListVpcAddressPrefixesWOptions() throws Throwable { ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptionsModel = new ListVpcAddressPrefixesOptions.Builder() .vpcId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listVpcAddressPrefixes() with a valid options model and verify the result @@ -1784,7 +1913,7 @@ public void testListVpcAddressPrefixesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listVpcAddressPrefixes operation with and without retries enabled @@ -1804,6 +1933,70 @@ public void testListVpcAddressPrefixesNoOptions() throws Throwable { vpcService.listVpcAddressPrefixes(null).execute(); } + // Test the listVpcAddressPrefixes operation using the VpcAddressPrefixesPager.getNext() method + @Test + public void testListVpcAddressPrefixesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"address_prefixes\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"has_subnets\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"name\":\"my-address-prefix-2\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"address_prefixes\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"has_subnets\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"name\":\"my-address-prefix-2\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptions = new ListVpcAddressPrefixesOptions.Builder() + .vpcId("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + VpcAddressPrefixesPager pager = new VpcAddressPrefixesPager(vpcService, listVpcAddressPrefixesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listVpcAddressPrefixes operation using the VpcAddressPrefixesPager.getAll() method + @Test + public void testListVpcAddressPrefixesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"address_prefixes\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"has_subnets\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"name\":\"my-address-prefix-2\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"address_prefixes\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"has_subnets\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"name\":\"my-address-prefix-2\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptions = new ListVpcAddressPrefixesOptions.Builder() + .vpcId("testString") + .limit(Long.valueOf("10")) + .build(); + + VpcAddressPrefixesPager pager = new VpcAddressPrefixesPager(vpcService, listVpcAddressPrefixesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createVpcAddressPrefix operation with a valid options model parameter @Test public void testCreateVpcAddressPrefixWOptions() throws Throwable { @@ -2051,7 +2244,7 @@ public void testListVpcRoutesWOptions() throws Throwable { .vpcId("testString") .zoneName("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listVpcRoutes() with a valid options model and verify the result @@ -2074,7 +2267,7 @@ public void testListVpcRoutesWOptions() throws Throwable { assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("zone.name"), "testString"); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listVpcRoutes operation with and without retries enabled @@ -2094,6 +2287,72 @@ public void testListVpcRoutesNoOptions() throws Throwable { vpcService.listVpcRoutes(null).execute(); } + // Test the listVpcRoutes operation using the VpcRoutesPager.getNext() method + @Test + public void testListVpcRoutesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routes\":[{\"action\":\"delegate\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpcRoutesOptions listVpcRoutesOptions = new ListVpcRoutesOptions.Builder() + .vpcId("testString") + .zoneName("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + VpcRoutesPager pager = new VpcRoutesPager(vpcService, listVpcRoutesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listVpcRoutes operation using the VpcRoutesPager.getAll() method + @Test + public void testListVpcRoutesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routes\":[{\"action\":\"delegate\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpcRoutesOptions listVpcRoutesOptions = new ListVpcRoutesOptions.Builder() + .vpcId("testString") + .zoneName("testString") + .limit(Long.valueOf("10")) + .build(); + + VpcRoutesPager pager = new VpcRoutesPager(vpcService, listVpcRoutesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createVpcRoute operation with a valid options model parameter @Test public void testCreateVpcRouteWOptions() throws Throwable { @@ -2345,7 +2604,7 @@ public void testListVpcRoutingTablesWOptions() throws Throwable { ListVpcRoutingTablesOptions listVpcRoutingTablesOptionsModel = new ListVpcRoutingTablesOptions.Builder() .vpcId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .isDefault(true) .build(); @@ -2368,7 +2627,7 @@ public void testListVpcRoutingTablesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(Boolean.valueOf(query.get("is_default")), Boolean.valueOf(true)); } @@ -2389,6 +2648,72 @@ public void testListVpcRoutingTablesNoOptions() throws Throwable { vpcService.listVpcRoutingTables(null).execute(); } + // Test the listVpcRoutingTables operation using the VpcRoutingTablesPager.getNext() method + @Test + public void testListVpcRoutingTablesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_gateway\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\",\"route_direct_link_ingress\":true,\"route_transit_gateway_ingress\":true,\"route_vpc_zone_ingress\":false,\"routes\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-route-1\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_gateway\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\",\"route_direct_link_ingress\":true,\"route_transit_gateway_ingress\":true,\"route_vpc_zone_ingress\":false,\"routes\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-route-1\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpcRoutingTablesOptions listVpcRoutingTablesOptions = new ListVpcRoutingTablesOptions.Builder() + .vpcId("testString") + .limit(Long.valueOf("10")) + .isDefault(true) + .build(); + + List allResults = new ArrayList<>(); + VpcRoutingTablesPager pager = new VpcRoutingTablesPager(vpcService, listVpcRoutingTablesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listVpcRoutingTables operation using the VpcRoutingTablesPager.getAll() method + @Test + public void testListVpcRoutingTablesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_gateway\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\",\"route_direct_link_ingress\":true,\"route_transit_gateway_ingress\":true,\"route_vpc_zone_ingress\":false,\"routes\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-route-1\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_gateway\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\",\"route_direct_link_ingress\":true,\"route_transit_gateway_ingress\":true,\"route_vpc_zone_ingress\":false,\"routes\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-route-1\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpcRoutingTablesOptions listVpcRoutingTablesOptions = new ListVpcRoutingTablesOptions.Builder() + .vpcId("testString") + .limit(Long.valueOf("10")) + .isDefault(true) + .build(); + + VpcRoutingTablesPager pager = new VpcRoutingTablesPager(vpcService, listVpcRoutingTablesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createVpcRoutingTable operation with a valid options model parameter @Test public void testCreateVpcRoutingTableWOptions() throws Throwable { @@ -2427,12 +2752,12 @@ public void testCreateVpcRoutingTableWOptions() throws Throwable { // Construct an instance of the CreateVpcRoutingTableOptions model CreateVpcRoutingTableOptions createVpcRoutingTableOptionsModel = new CreateVpcRoutingTableOptions.Builder() .vpcId("testString") - .acceptRoutesFrom(new java.util.ArrayList(java.util.Arrays.asList(resourceFilterModel))) + .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) .name("my-routing-table-2") .routeDirectLinkIngress(false) .routeTransitGatewayIngress(false) .routeVpcZoneIngress(false) - .routes(new java.util.ArrayList(java.util.Arrays.asList(routePrototypeModel))) + .routes(java.util.Arrays.asList(routePrototypeModel)) .build(); // Invoke createVpcRoutingTable() with a valid options model and verify the result @@ -2598,7 +2923,7 @@ public void testUpdateVpcRoutingTableWOptions() throws Throwable { // Construct an instance of the RoutingTablePatch model RoutingTablePatch routingTablePatchModel = new RoutingTablePatch.Builder() - .acceptRoutesFrom(new java.util.ArrayList(java.util.Arrays.asList(resourceFilterModel))) + .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) .name("my-routing-table-2") .routeDirectLinkIngress(true) .routeTransitGatewayIngress(true) @@ -2667,7 +2992,7 @@ public void testListVpcRoutingTableRoutesWOptions() throws Throwable { .vpcId("testString") .routingTableId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listVpcRoutingTableRoutes() with a valid options model and verify the result @@ -2689,7 +3014,7 @@ public void testListVpcRoutingTableRoutesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listVpcRoutingTableRoutes operation with and without retries enabled @@ -2709,6 +3034,72 @@ public void testListVpcRoutingTableRoutesNoOptions() throws Throwable { vpcService.listVpcRoutingTableRoutes(null).execute(); } + // Test the listVpcRoutingTableRoutes operation using the VpcRoutingTableRoutesPager.getNext() method + @Test + public void testListVpcRoutingTableRoutesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routes\":[{\"action\":\"delegate\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptions = new ListVpcRoutingTableRoutesOptions.Builder() + .vpcId("testString") + .routingTableId("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + VpcRoutingTableRoutesPager pager = new VpcRoutingTableRoutesPager(vpcService, listVpcRoutingTableRoutesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listVpcRoutingTableRoutes operation using the VpcRoutingTableRoutesPager.getAll() method + @Test + public void testListVpcRoutingTableRoutesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routes\":[{\"action\":\"delegate\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptions = new ListVpcRoutingTableRoutesOptions.Builder() + .vpcId("testString") + .routingTableId("testString") + .limit(Long.valueOf("10")) + .build(); + + VpcRoutingTableRoutesPager pager = new VpcRoutingTableRoutesPager(vpcService, listVpcRoutingTableRoutesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createVpcRoutingTableRoute operation with a valid options model parameter @Test public void testCreateVpcRoutingTableRouteWOptions() throws Throwable { @@ -2963,7 +3354,7 @@ public void testListSubnetsWOptions() throws Throwable { // Construct an instance of the ListSubnetsOptions model ListSubnetsOptions listSubnetsOptionsModel = new ListSubnetsOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .routingTableId("testString") .routingTableName("testString") @@ -2988,7 +3379,7 @@ public void testListSubnetsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("routing_table.id"), "testString"); assertEquals(query.get("routing_table.name"), "testString"); @@ -3004,6 +3395,74 @@ public void testListSubnetsWRetries() throws Throwable { testListSubnetsWOptions(); } + // Test the listSubnets operation using the SubnetsPager.getNext() method + @Test + public void testListSubnetsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"name\":\"my-subnet\",\"network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"public_gateway\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_type\":\"public_gateway\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"subnet\",\"routing_table\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"status\":\"available\",\"total_ipv4_address_count\":256,\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"name\":\"my-subnet\",\"network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"public_gateway\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_type\":\"public_gateway\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"subnet\",\"routing_table\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"status\":\"available\",\"total_ipv4_address_count\":256,\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListSubnetsOptions listSubnetsOptions = new ListSubnetsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .routingTableId("testString") + .routingTableName("testString") + .build(); + + List allResults = new ArrayList<>(); + SubnetsPager pager = new SubnetsPager(vpcService, listSubnetsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listSubnets operation using the SubnetsPager.getAll() method + @Test + public void testListSubnetsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"name\":\"my-subnet\",\"network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"public_gateway\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_type\":\"public_gateway\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"subnet\",\"routing_table\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"status\":\"available\",\"total_ipv4_address_count\":256,\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"name\":\"my-subnet\",\"network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"public_gateway\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_type\":\"public_gateway\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"subnet\",\"routing_table\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"status\":\"available\",\"total_ipv4_address_count\":256,\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListSubnetsOptions listSubnetsOptions = new ListSubnetsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .routingTableId("testString") + .routingTableName("testString") + .build(); + + SubnetsPager pager = new SubnetsPager(vpcService, listSubnetsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createSubnet operation with a valid options model parameter @Test public void testCreateSubnetWOptions() throws Throwable { @@ -3287,7 +3746,7 @@ public void testUpdateSubnetNoOptions() throws Throwable { @Test public void testGetSubnetNetworkAclWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-2\", \"source\": \"192.168.3.0/24\", \"code\": 0, \"protocol\": \"icmp\", \"type\": 8}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-1\", \"source\": \"192.168.3.0/24\", \"destination_port_max\": 22, \"destination_port_min\": 22, \"protocol\": \"udp\", \"source_port_max\": 65535, \"source_port_min\": 49152}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; String getSubnetNetworkAclPath = "/subnets/testString/network_acl"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -3340,7 +3799,7 @@ public void testGetSubnetNetworkAclNoOptions() throws Throwable { @Test public void testReplaceSubnetNetworkAclWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-2\", \"source\": \"192.168.3.0/24\", \"code\": 0, \"protocol\": \"icmp\", \"type\": 8}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-1\", \"source\": \"192.168.3.0/24\", \"destination_port_max\": 22, \"destination_port_min\": 22, \"protocol\": \"udp\", \"source_port_max\": 65535, \"source_port_min\": 49152}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; String replaceSubnetNetworkAclPath = "/subnets/testString/network_acl"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -3686,7 +4145,7 @@ public void testListSubnetReservedIpsWOptions() throws Throwable { ListSubnetReservedIpsOptions listSubnetReservedIpsOptionsModel = new ListSubnetReservedIpsOptions.Builder() .subnetId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .sort("name") .build(); @@ -3709,7 +4168,7 @@ public void testListSubnetReservedIpsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("sort"), "name"); } @@ -3730,6 +4189,72 @@ public void testListSubnetReservedIpsNoOptions() throws Throwable { vpcService.listSubnetReservedIps(null).execute(); } + // Test the listSubnetReservedIps operation using the SubnetReservedIpsPager.getNext() method + @Test + public void testListSubnetReservedIpsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reserved_ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"reserved_ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListSubnetReservedIpsOptions listSubnetReservedIpsOptions = new ListSubnetReservedIpsOptions.Builder() + .subnetId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); + + List allResults = new ArrayList<>(); + SubnetReservedIpsPager pager = new SubnetReservedIpsPager(vpcService, listSubnetReservedIpsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listSubnetReservedIps operation using the SubnetReservedIpsPager.getAll() method + @Test + public void testListSubnetReservedIpsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reserved_ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"reserved_ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListSubnetReservedIpsOptions listSubnetReservedIpsOptions = new ListSubnetReservedIpsOptions.Builder() + .subnetId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); + + SubnetReservedIpsPager pager = new SubnetReservedIpsPager(vpcService, listSubnetReservedIpsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createSubnetReservedIp operation with a valid options model parameter @Test public void testCreateSubnetReservedIpWOptions() throws Throwable { @@ -3965,7 +4490,7 @@ public void testUpdateSubnetReservedIpNoOptions() throws Throwable { @Test public void testListImagesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images?limit=20\"}, \"images\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"operating_system\": {\"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"visibility\": \"private\"}], \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images?limit=20\"}, \"images\": [{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"operating_system\": {\"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"visibility\": \"private\"}], \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}}"; String listImagesPath = "/images"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -3975,7 +4500,7 @@ public void testListImagesWOptions() throws Throwable { // Construct an instance of the ListImagesOptions model ListImagesOptions listImagesOptionsModel = new ListImagesOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .name("testString") .visibility("private") @@ -4000,7 +4525,7 @@ public void testListImagesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("name"), "testString"); assertEquals(query.get("visibility"), "private"); @@ -4016,11 +4541,79 @@ public void testListImagesWRetries() throws Throwable { testListImagesWOptions(); } + // Test the listImages operation using the ImagesPager.getNext() method + @Test + public void testListImagesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"images\":[{\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"file\":{\"checksums\":{\"sha256\":\"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"},\"size\":1},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"operating_system\":{\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"images\":[{\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"file\":{\"checksums\":{\"sha256\":\"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"},\"size\":1},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"operating_system\":{\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListImagesOptions listImagesOptions = new ListImagesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .visibility("private") + .build(); + + List allResults = new ArrayList<>(); + ImagesPager pager = new ImagesPager(vpcService, listImagesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listImages operation using the ImagesPager.getAll() method + @Test + public void testListImagesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"images\":[{\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"file\":{\"checksums\":{\"sha256\":\"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"},\"size\":1},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"operating_system\":{\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"images\":[{\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"file\":{\"checksums\":{\"sha256\":\"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"},\"size\":1},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"operating_system\":{\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListImagesOptions listImagesOptions = new ListImagesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .visibility("private") + .build(); + + ImagesPager pager = new ImagesPager(vpcService, listImagesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createImage operation with a valid options model parameter @Test public void testCreateImageWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"operating_system\": {\"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"visibility\": \"private\"}"; + String mockResponseBody = "{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"operating_system\": {\"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"visibility\": \"private\"}"; String createImagePath = "/images"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -4155,7 +4748,7 @@ public void testDeleteImageNoOptions() throws Throwable { @Test public void testGetImageWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"operating_system\": {\"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"visibility\": \"private\"}"; + String mockResponseBody = "{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"operating_system\": {\"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"visibility\": \"private\"}"; String getImagePath = "/images/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -4208,7 +4801,7 @@ public void testGetImageNoOptions() throws Throwable { @Test public void testUpdateImageWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"operating_system\": {\"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"visibility\": \"private\"}"; + String mockResponseBody = "{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"operating_system\": {\"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"visibility\": \"private\"}"; String updateImagePath = "/images/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -4278,7 +4871,7 @@ public void testListOperatingSystemsWOptions() throws Throwable { // Construct an instance of the ListOperatingSystemsOptions model ListOperatingSystemsOptions listOperatingSystemsOptionsModel = new ListOperatingSystemsOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listOperatingSystems() with a valid options model and verify the result @@ -4300,7 +4893,7 @@ public void testListOperatingSystemsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listOperatingSystems operation with and without retries enabled @@ -4313,16 +4906,78 @@ public void testListOperatingSystemsWRetries() throws Throwable { testListOperatingSystemsWOptions(); } - // Test the getOperatingSystem operation with a valid options model parameter + // Test the listOperatingSystems operation using the OperatingSystemsPager.getNext() method @Test - public void testGetOperatingSystemWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}"; - String getOperatingSystemPath = "/operating_systems/testString"; + public void testListOperatingSystemsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"operating_systems\":[{\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"operating_systems\":[{\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponseBody)); + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListOperatingSystemsOptions listOperatingSystemsOptions = new ListOperatingSystemsOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + OperatingSystemsPager pager = new OperatingSystemsPager(vpcService, listOperatingSystemsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listOperatingSystems operation using the OperatingSystemsPager.getAll() method + @Test + public void testListOperatingSystemsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"operating_systems\":[{\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"operating_systems\":[{\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListOperatingSystemsOptions listOperatingSystemsOptions = new ListOperatingSystemsOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + OperatingSystemsPager pager = new OperatingSystemsPager(vpcService, listOperatingSystemsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the getOperatingSystem operation with a valid options model parameter + @Test + public void testGetOperatingSystemWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}"; + String getOperatingSystemPath = "/operating_systems/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the GetOperatingSystemOptions model GetOperatingSystemOptions getOperatingSystemOptionsModel = new GetOperatingSystemOptions.Builder() @@ -4380,7 +5035,7 @@ public void testListKeysWOptions() throws Throwable { // Construct an instance of the ListKeysOptions model ListKeysOptions listKeysOptionsModel = new ListKeysOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listKeys() with a valid options model and verify the result @@ -4402,7 +5057,7 @@ public void testListKeysWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listKeys operation with and without retries enabled @@ -4415,6 +5070,68 @@ public void testListKeysWRetries() throws Throwable { testListKeysWOptions(); } + // Test the listKeys operation using the KeysPager.getNext() method + @Test + public void testListKeysWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"keys\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"length\":2048,\"name\":\"my-key\",\"public_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"type\":\"rsa\"}],\"limit\":1}"; + String mockResponsePage2 = "{\"total_count\":2,\"keys\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"length\":2048,\"name\":\"my-key\",\"public_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"type\":\"rsa\"}],\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListKeysOptions listKeysOptions = new ListKeysOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + KeysPager pager = new KeysPager(vpcService, listKeysOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listKeys operation using the KeysPager.getAll() method + @Test + public void testListKeysWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"keys\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"length\":2048,\"name\":\"my-key\",\"public_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"type\":\"rsa\"}],\"limit\":1}"; + String mockResponsePage2 = "{\"total_count\":2,\"keys\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"length\":2048,\"name\":\"my-key\",\"public_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"type\":\"rsa\"}],\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListKeysOptions listKeysOptions = new ListKeysOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + KeysPager pager = new KeysPager(vpcService, listKeysOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createKey operation with a valid options model parameter @Test public void testCreateKeyWOptions() throws Throwable { @@ -4742,7 +5459,7 @@ public void testGetInstanceProfileNoOptions() throws Throwable { @Test public void testListInstanceTemplatesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"templates\": [{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance-template\", \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 250, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}}}, \"image\": {\"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}], \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"templates\": [{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance-template\", \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 250, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}], \"total_count\": 132}"; String listInstanceTemplatesPath = "/instance/templates"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -4786,7 +5503,7 @@ public void testListInstanceTemplatesWRetries() throws Throwable { @Test public void testCreateInstanceTemplateWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance-template\", \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 250, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}}}, \"image\": {\"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance-template\", \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 250, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}"; String createInstanceTemplatePath = "/instance/templates"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -4841,7 +5558,7 @@ public void testCreateInstanceTemplateWOptions() throws Throwable { .allowIpSpoofing(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); @@ -4894,6 +5611,7 @@ public void testCreateInstanceTemplateWOptions() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); // Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model @@ -4917,16 +5635,16 @@ public void testCreateInstanceTemplateWOptions() throws Throwable { InstanceTemplatePrototypeInstanceByImage instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceByImage.Builder() .availabilityPolicy(instanceAvailabilityPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) + .keys(java.util.Arrays.asList(keyIdentityModel)) .metadataService(instanceMetadataServicePrototypeModel) .name("my-instance-template") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))) + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) .placementTarget(instancePlacementTargetPrototypeModel) .profile(instanceProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") - .volumeAttachments(new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))) + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .image(imageIdentityModel) @@ -5032,7 +5750,7 @@ public void testDeleteInstanceTemplateNoOptions() throws Throwable { @Test public void testGetInstanceTemplateWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance-template\", \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 250, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}}}, \"image\": {\"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance-template\", \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 250, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}"; String getInstanceTemplatePath = "/instance/templates/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -5085,7 +5803,7 @@ public void testGetInstanceTemplateNoOptions() throws Throwable { @Test public void testUpdateInstanceTemplateWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance-template\", \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 250, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}}}, \"image\": {\"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance-template\", \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 250, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}"; String updateInstanceTemplatePath = "/instance/templates/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -5145,7 +5863,7 @@ public void testUpdateInstanceTemplateNoOptions() throws Throwable { @Test public void testListInstancesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20\"}, \"instances\": [{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"memory\": 8, \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20\"}, \"instances\": [{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}, \"catalog_offering\": {\"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 8, \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; String listInstancesPath = "/instances"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -5155,7 +5873,7 @@ public void testListInstancesWOptions() throws Throwable { // Construct an instance of the ListInstancesOptions model ListInstancesOptions listInstancesOptionsModel = new ListInstancesOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .name("testString") .vpcId("testString") @@ -5188,7 +5906,7 @@ public void testListInstancesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("name"), "testString"); assertEquals(query.get("vpc.id"), "testString"); @@ -5212,11 +5930,95 @@ public void testListInstancesWRetries() throws Throwable { testListInstancesWOptions(); } + // Test the listInstances operation using the InstancesPager.getNext() method + @Test + public void testListInstancesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}},\"catalog_offering\":{\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"},\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"nvme\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\",\"size\":100}],\"gpu\":{\"count\":1,\"manufacturer\":\"nvidia\",\"memory\":1,\"model\":\"Tesla V100\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":8,\"metadata_service\":{\"enabled\":false},\"name\":\"my-instance\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"instance\",\"startable\":false,\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_storage\",\"message\":\"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"total_network_bandwidth\":500,\"total_volume_bandwidth\":500,\"vcpu\":{\"architecture\":\"amd64\",\"count\":4},\"volume_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}},\"catalog_offering\":{\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"},\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"nvme\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\",\"size\":100}],\"gpu\":{\"count\":1,\"manufacturer\":\"nvidia\",\"memory\":1,\"model\":\"Tesla V100\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":8,\"metadata_service\":{\"enabled\":false},\"name\":\"my-instance\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"instance\",\"startable\":false,\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_storage\",\"message\":\"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"total_network_bandwidth\":500,\"total_volume_bandwidth\":500,\"vcpu\":{\"architecture\":\"amd64\",\"count\":4},\"volume_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstancesOptions listInstancesOptions = new ListInstancesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .dedicatedHostId("testString") + .dedicatedHostCrn("testString") + .dedicatedHostName("testString") + .placementGroupId("testString") + .placementGroupCrn("testString") + .placementGroupName("testString") + .build(); + + List allResults = new ArrayList<>(); + InstancesPager pager = new InstancesPager(vpcService, listInstancesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listInstances operation using the InstancesPager.getAll() method + @Test + public void testListInstancesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}},\"catalog_offering\":{\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"},\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"nvme\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\",\"size\":100}],\"gpu\":{\"count\":1,\"manufacturer\":\"nvidia\",\"memory\":1,\"model\":\"Tesla V100\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":8,\"metadata_service\":{\"enabled\":false},\"name\":\"my-instance\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"instance\",\"startable\":false,\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_storage\",\"message\":\"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"total_network_bandwidth\":500,\"total_volume_bandwidth\":500,\"vcpu\":{\"architecture\":\"amd64\",\"count\":4},\"volume_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}},\"catalog_offering\":{\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"},\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"nvme\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\",\"size\":100}],\"gpu\":{\"count\":1,\"manufacturer\":\"nvidia\",\"memory\":1,\"model\":\"Tesla V100\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":8,\"metadata_service\":{\"enabled\":false},\"name\":\"my-instance\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"instance\",\"startable\":false,\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_storage\",\"message\":\"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"total_network_bandwidth\":500,\"total_volume_bandwidth\":500,\"vcpu\":{\"architecture\":\"amd64\",\"count\":4},\"volume_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstancesOptions listInstancesOptions = new ListInstancesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .dedicatedHostId("testString") + .dedicatedHostCrn("testString") + .dedicatedHostName("testString") + .placementGroupId("testString") + .placementGroupCrn("testString") + .placementGroupName("testString") + .build(); + + InstancesPager pager = new InstancesPager(vpcService, listInstancesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createInstance operation with a valid options model parameter @Test public void testCreateInstanceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"memory\": 8, \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}, \"catalog_offering\": {\"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 8, \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; String createInstancePath = "/instances"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -5271,7 +6073,7 @@ public void testCreateInstanceWOptions() throws Throwable { .allowIpSpoofing(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); @@ -5305,6 +6107,7 @@ public void testCreateInstanceWOptions() throws Throwable { .iops(Long.valueOf("10000")) .name("my-data-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .capacity(Long.valueOf("1000")) .encryptionKey(encryptionKeyIdentityModel) .build(); @@ -5328,6 +6131,7 @@ public void testCreateInstanceWOptions() throws Throwable { .iops(Long.valueOf("10000")) .name("my-boot-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); // Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model @@ -5351,16 +6155,16 @@ public void testCreateInstanceWOptions() throws Throwable { InstancePrototypeInstanceByImage instancePrototypeModel = new InstancePrototypeInstanceByImage.Builder() .availabilityPolicy(instanceAvailabilityPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) + .keys(java.util.Arrays.asList(keyIdentityModel)) .metadataService(instanceMetadataServicePrototypeModel) .name("my-instance") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))) + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) .placementTarget(instancePlacementTargetPrototypeModel) .profile(instanceProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") - .volumeAttachments(new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))) + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .image(imageIdentityModel) @@ -5466,7 +6270,7 @@ public void testDeleteInstanceNoOptions() throws Throwable { @Test public void testGetInstanceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"memory\": 8, \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}, \"catalog_offering\": {\"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 8, \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; String getInstancePath = "/instances/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -5519,7 +6323,7 @@ public void testGetInstanceNoOptions() throws Throwable { @Test public void testUpdateInstanceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"memory\": 8, \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}, \"catalog_offering\": {\"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 8, \"metadata_service\": {\"enabled\": false}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; String updateInstancePath = "/instances/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -6019,7 +6823,7 @@ public void testCreateInstanceNetworkInterfaceWOptions() throws Throwable { .allowIpSpoofing(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); // Invoke createInstanceNetworkInterface() with a valid options model and verify the result @@ -6462,7 +7266,7 @@ public void testListInstanceNetworkInterfaceIpsWOptions() throws Throwable { .instanceId("testString") .networkInterfaceId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listInstanceNetworkInterfaceIps() with a valid options model and verify the result @@ -6484,7 +7288,7 @@ public void testListInstanceNetworkInterfaceIpsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listInstanceNetworkInterfaceIps operation with and without retries enabled @@ -6504,6 +7308,72 @@ public void testListInstanceNetworkInterfaceIpsNoOptions() throws Throwable { vpcService.listInstanceNetworkInterfaceIps(null).execute(); } + // Test the listInstanceNetworkInterfaceIps operation using the InstanceNetworkInterfaceIpsPager.getNext() method + @Test + public void testListInstanceNetworkInterfaceIpsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptions = new ListInstanceNetworkInterfaceIpsOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + InstanceNetworkInterfaceIpsPager pager = new InstanceNetworkInterfaceIpsPager(vpcService, listInstanceNetworkInterfaceIpsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listInstanceNetworkInterfaceIps operation using the InstanceNetworkInterfaceIpsPager.getAll() method + @Test + public void testListInstanceNetworkInterfaceIpsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptions = new ListInstanceNetworkInterfaceIpsOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") + .limit(Long.valueOf("10")) + .build(); + + InstanceNetworkInterfaceIpsPager pager = new InstanceNetworkInterfaceIpsPager(vpcService, listInstanceNetworkInterfaceIpsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the getInstanceNetworkInterfaceIp operation with a valid options model parameter @Test public void testGetInstanceNetworkInterfaceIpWOptions() throws Throwable { @@ -6856,7 +7726,7 @@ public void testListInstanceGroupsWOptions() throws Throwable { // Construct an instance of the ListInstanceGroupsOptions model ListInstanceGroupsOptions listInstanceGroupsOptionsModel = new ListInstanceGroupsOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listInstanceGroups() with a valid options model and verify the result @@ -6878,7 +7748,7 @@ public void testListInstanceGroupsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listInstanceGroups operation with and without retries enabled @@ -6891,6 +7761,68 @@ public void testListInstanceGroupsWRetries() throws Throwable { testListInstanceGroupsWOptions(); } + // Test the listInstanceGroups operation using the InstanceGroupsPager.getNext() method + @Test + public void testListInstanceGroupsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"instance_groups\":[{\"application_port\":22,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_template\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"name\":\"my-instance-template\"},\"load_balancer_pool\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"},\"managers\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager\"}],\"membership_count\":10,\"name\":\"my-instance-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"deleting\",\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"instance_groups\":[{\"application_port\":22,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_template\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"name\":\"my-instance-template\"},\"load_balancer_pool\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"},\"managers\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager\"}],\"membership_count\":10,\"name\":\"my-instance-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"deleting\",\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstanceGroupsOptions listInstanceGroupsOptions = new ListInstanceGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + InstanceGroupsPager pager = new InstanceGroupsPager(vpcService, listInstanceGroupsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listInstanceGroups operation using the InstanceGroupsPager.getAll() method + @Test + public void testListInstanceGroupsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"instance_groups\":[{\"application_port\":22,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_template\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"name\":\"my-instance-template\"},\"load_balancer_pool\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"},\"managers\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager\"}],\"membership_count\":10,\"name\":\"my-instance-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"deleting\",\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"instance_groups\":[{\"application_port\":22,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_template\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"name\":\"my-instance-template\"},\"load_balancer_pool\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"},\"managers\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager\"}],\"membership_count\":10,\"name\":\"my-instance-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"deleting\",\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstanceGroupsOptions listInstanceGroupsOptions = new ListInstanceGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + InstanceGroupsPager pager = new InstanceGroupsPager(vpcService, listInstanceGroupsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createInstanceGroup operation with a valid options model parameter @Test public void testCreateInstanceGroupWOptions() throws Throwable { @@ -6930,7 +7862,7 @@ public void testCreateInstanceGroupWOptions() throws Throwable { // Construct an instance of the CreateInstanceGroupOptions model CreateInstanceGroupOptions createInstanceGroupOptionsModel = new CreateInstanceGroupOptions.Builder() .instanceTemplate(instanceTemplateIdentityModel) - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) .applicationPort(Long.valueOf("22")) .loadBalancer(loadBalancerIdentityModel) .loadBalancerPool(loadBalancerPoolIdentityModel) @@ -7120,7 +8052,7 @@ public void testUpdateInstanceGroupWOptions() throws Throwable { .loadBalancerPool(loadBalancerPoolIdentityModel) .membershipCount(Long.valueOf("10")) .name("my-instance-group") - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) .build(); Map instanceGroupPatchModelAsPatch = instanceGroupPatchModel.asPatch(); @@ -7234,7 +8166,7 @@ public void testListInstanceGroupManagersWOptions() throws Throwable { ListInstanceGroupManagersOptions listInstanceGroupManagersOptionsModel = new ListInstanceGroupManagersOptions.Builder() .instanceGroupId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listInstanceGroupManagers() with a valid options model and verify the result @@ -7256,7 +8188,7 @@ public void testListInstanceGroupManagersWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listInstanceGroupManagers operation with and without retries enabled @@ -7276,6 +8208,70 @@ public void testListInstanceGroupManagersNoOptions() throws Throwable { vpcService.listInstanceGroupManagers(null).execute(); } + // Test the listInstanceGroupManagers operation using the InstanceGroupManagersPager.getNext() method + @Test + public void testListInstanceGroupManagersWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"managers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"management_enabled\":false,\"name\":\"my-instance-group-manager\",\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"aggregation_window\":120,\"cooldown\":210,\"manager_type\":\"autoscale\",\"max_membership_count\":10,\"min_membership_count\":10,\"policies\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager-policy\"}]}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"managers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"management_enabled\":false,\"name\":\"my-instance-group-manager\",\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"aggregation_window\":120,\"cooldown\":210,\"manager_type\":\"autoscale\",\"max_membership_count\":10,\"min_membership_count\":10,\"policies\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager-policy\"}]}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstanceGroupManagersOptions listInstanceGroupManagersOptions = new ListInstanceGroupManagersOptions.Builder() + .instanceGroupId("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + InstanceGroupManagersPager pager = new InstanceGroupManagersPager(vpcService, listInstanceGroupManagersOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listInstanceGroupManagers operation using the InstanceGroupManagersPager.getAll() method + @Test + public void testListInstanceGroupManagersWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"managers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"management_enabled\":false,\"name\":\"my-instance-group-manager\",\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"aggregation_window\":120,\"cooldown\":210,\"manager_type\":\"autoscale\",\"max_membership_count\":10,\"min_membership_count\":10,\"policies\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager-policy\"}]}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"managers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"management_enabled\":false,\"name\":\"my-instance-group-manager\",\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"aggregation_window\":120,\"cooldown\":210,\"manager_type\":\"autoscale\",\"max_membership_count\":10,\"min_membership_count\":10,\"policies\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager-policy\"}]}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstanceGroupManagersOptions listInstanceGroupManagersOptions = new ListInstanceGroupManagersOptions.Builder() + .instanceGroupId("testString") + .limit(Long.valueOf("10")) + .build(); + + InstanceGroupManagersPager pager = new InstanceGroupManagersPager(vpcService, listInstanceGroupManagersOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createInstanceGroupManager operation with a valid options model parameter @Test public void testCreateInstanceGroupManagerWOptions() throws Throwable { @@ -7530,7 +8526,7 @@ public void testListInstanceGroupManagerActionsWOptions() throws Throwable { .instanceGroupId("testString") .instanceGroupManagerId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listInstanceGroupManagerActions() with a valid options model and verify the result @@ -7552,7 +8548,7 @@ public void testListInstanceGroupManagerActionsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listInstanceGroupManagerActions operation with and without retries enabled @@ -7572,6 +8568,72 @@ public void testListInstanceGroupManagerActionsNoOptions() throws Throwable { vpcService.listInstanceGroupManagerActions(null).execute(); } + // Test the listInstanceGroupManagerActions operation using the InstanceGroupManagerActionsPager.getNext() method + @Test + public void testListInstanceGroupManagerActionsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"actions\":[{\"auto_delete\":true,\"auto_delete_timeout\":24,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager-action\",\"resource_type\":\"instance_group_manager_action\",\"status\":\"active\",\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"action_type\":\"scheduled\",\"cron_spec\":\"*/5 1,2,3 * * *\",\"last_applied_at\":\"2019-01-01T12:00:00.000Z\",\"next_run_at\":\"2019-01-01T12:00:00.000Z\",\"group\":{\"membership_count\":10}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"actions\":[{\"auto_delete\":true,\"auto_delete_timeout\":24,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager-action\",\"resource_type\":\"instance_group_manager_action\",\"status\":\"active\",\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"action_type\":\"scheduled\",\"cron_spec\":\"*/5 1,2,3 * * *\",\"last_applied_at\":\"2019-01-01T12:00:00.000Z\",\"next_run_at\":\"2019-01-01T12:00:00.000Z\",\"group\":{\"membership_count\":10}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstanceGroupManagerActionsOptions listInstanceGroupManagerActionsOptions = new ListInstanceGroupManagerActionsOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + InstanceGroupManagerActionsPager pager = new InstanceGroupManagerActionsPager(vpcService, listInstanceGroupManagerActionsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listInstanceGroupManagerActions operation using the InstanceGroupManagerActionsPager.getAll() method + @Test + public void testListInstanceGroupManagerActionsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"actions\":[{\"auto_delete\":true,\"auto_delete_timeout\":24,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager-action\",\"resource_type\":\"instance_group_manager_action\",\"status\":\"active\",\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"action_type\":\"scheduled\",\"cron_spec\":\"*/5 1,2,3 * * *\",\"last_applied_at\":\"2019-01-01T12:00:00.000Z\",\"next_run_at\":\"2019-01-01T12:00:00.000Z\",\"group\":{\"membership_count\":10}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"actions\":[{\"auto_delete\":true,\"auto_delete_timeout\":24,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager-action\",\"resource_type\":\"instance_group_manager_action\",\"status\":\"active\",\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"action_type\":\"scheduled\",\"cron_spec\":\"*/5 1,2,3 * * *\",\"last_applied_at\":\"2019-01-01T12:00:00.000Z\",\"next_run_at\":\"2019-01-01T12:00:00.000Z\",\"group\":{\"membership_count\":10}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstanceGroupManagerActionsOptions listInstanceGroupManagerActionsOptions = new ListInstanceGroupManagerActionsOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .limit(Long.valueOf("10")) + .build(); + + InstanceGroupManagerActionsPager pager = new InstanceGroupManagerActionsPager(vpcService, listInstanceGroupManagerActionsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createInstanceGroupManagerAction operation with a valid options model parameter @Test public void testCreateInstanceGroupManagerActionWOptions() throws Throwable { @@ -7841,7 +8903,7 @@ public void testListInstanceGroupManagerPoliciesWOptions() throws Throwable { .instanceGroupId("testString") .instanceGroupManagerId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listInstanceGroupManagerPolicies() with a valid options model and verify the result @@ -7863,7 +8925,7 @@ public void testListInstanceGroupManagerPoliciesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listInstanceGroupManagerPolicies operation with and without retries enabled @@ -7883,37 +8945,103 @@ public void testListInstanceGroupManagerPoliciesNoOptions() throws Throwable { vpcService.listInstanceGroupManagerPolicies(null).execute(); } - // Test the createInstanceGroupManagerPolicy operation with a valid options model parameter + // Test the listInstanceGroupManagerPolicies operation using the InstanceGroupManagerPoliciesPager.getNext() method @Test - public void testCreateInstanceGroupManagerPolicyWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-instance-group-manager-policy\", \"updated_at\": \"2019-01-01T12:00:00.000Z\", \"metric_type\": \"cpu\", \"metric_value\": 11, \"policy_type\": \"target\"}"; - String createInstanceGroupManagerPolicyPath = "/instance_groups/testString/managers/testString/policies"; + public void testListInstanceGroupManagerPoliciesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager-policy\",\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"metric_type\":\"cpu\",\"metric_value\":11,\"policy_type\":\"target\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager-policy\",\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"metric_type\":\"cpu\",\"metric_value\":11,\"policy_type\":\"target\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype instanceGroupManagerPolicyPrototypeModel = new InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.Builder() - .name("my-instance-group-manager-policy") - .metricType("cpu") - .metricValue(Long.valueOf("26")) - .policyType("target") - .build(); + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Construct an instance of the CreateInstanceGroupManagerPolicyOptions model - CreateInstanceGroupManagerPolicyOptions createInstanceGroupManagerPolicyOptionsModel = new CreateInstanceGroupManagerPolicyOptions.Builder() + ListInstanceGroupManagerPoliciesOptions listInstanceGroupManagerPoliciesOptions = new ListInstanceGroupManagerPoliciesOptions.Builder() .instanceGroupId("testString") .instanceGroupManagerId("testString") - .instanceGroupManagerPolicyPrototype(instanceGroupManagerPolicyPrototypeModel) + .limit(Long.valueOf("10")) .build(); - // Invoke createInstanceGroupManagerPolicy() with a valid options model and verify the result - Response response = vpcService.createInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptionsModel).execute(); - assertNotNull(response); - InstanceGroupManagerPolicy responseObj = response.getResult(); - assertNotNull(responseObj); + List allResults = new ArrayList<>(); + InstanceGroupManagerPoliciesPager pager = new InstanceGroupManagerPoliciesPager(vpcService, listInstanceGroupManagerPoliciesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listInstanceGroupManagerPolicies operation using the InstanceGroupManagerPoliciesPager.getAll() method + @Test + public void testListInstanceGroupManagerPoliciesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager-policy\",\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"metric_type\":\"cpu\",\"metric_value\":11,\"policy_type\":\"target\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance-group-manager-policy\",\"updated_at\":\"2019-01-01T12:00:00.000Z\",\"metric_type\":\"cpu\",\"metric_value\":11,\"policy_type\":\"target\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstanceGroupManagerPoliciesOptions listInstanceGroupManagerPoliciesOptions = new ListInstanceGroupManagerPoliciesOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .limit(Long.valueOf("10")) + .build(); + + InstanceGroupManagerPoliciesPager pager = new InstanceGroupManagerPoliciesPager(vpcService, listInstanceGroupManagerPoliciesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createInstanceGroupManagerPolicy operation with a valid options model parameter + @Test + public void testCreateInstanceGroupManagerPolicyWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-instance-group-manager-policy\", \"updated_at\": \"2019-01-01T12:00:00.000Z\", \"metric_type\": \"cpu\", \"metric_value\": 11, \"policy_type\": \"target\"}"; + String createInstanceGroupManagerPolicyPath = "/instance_groups/testString/managers/testString/policies"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model + InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype instanceGroupManagerPolicyPrototypeModel = new InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.Builder() + .name("my-instance-group-manager-policy") + .metricType("cpu") + .metricValue(Long.valueOf("26")) + .policyType("target") + .build(); + + // Construct an instance of the CreateInstanceGroupManagerPolicyOptions model + CreateInstanceGroupManagerPolicyOptions createInstanceGroupManagerPolicyOptionsModel = new CreateInstanceGroupManagerPolicyOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .instanceGroupManagerPolicyPrototype(instanceGroupManagerPolicyPrototypeModel) + .build(); + + // Invoke createInstanceGroupManagerPolicy() with a valid options model and verify the result + Response response = vpcService.createInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptionsModel).execute(); + assertNotNull(response); + InstanceGroupManagerPolicy responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -8186,7 +9314,7 @@ public void testListInstanceGroupMembershipsWOptions() throws Throwable { ListInstanceGroupMembershipsOptions listInstanceGroupMembershipsOptionsModel = new ListInstanceGroupMembershipsOptions.Builder() .instanceGroupId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listInstanceGroupMemberships() with a valid options model and verify the result @@ -8208,7 +9336,7 @@ public void testListInstanceGroupMembershipsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listInstanceGroupMemberships operation with and without retries enabled @@ -8228,6 +9356,70 @@ public void testListInstanceGroupMembershipsNoOptions() throws Throwable { vpcService.listInstanceGroupMemberships(null).execute(); } + // Test the listInstanceGroupMemberships operation using the InstanceGroupMembershipsPager.getNext() method + @Test + public void testListInstanceGroupMembershipsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"memberships\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"delete_instance_on_membership_delete\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance\"},\"instance_template\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"name\":\"my-instance-template\"},\"name\":\"my-instance-group-membership\",\"pool_member\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"},\"status\":\"deleting\",\"updated_at\":\"2019-01-01T12:00:00.000Z\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"memberships\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"delete_instance_on_membership_delete\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance\"},\"instance_template\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"name\":\"my-instance-template\"},\"name\":\"my-instance-group-membership\",\"pool_member\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"},\"status\":\"deleting\",\"updated_at\":\"2019-01-01T12:00:00.000Z\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstanceGroupMembershipsOptions listInstanceGroupMembershipsOptions = new ListInstanceGroupMembershipsOptions.Builder() + .instanceGroupId("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + InstanceGroupMembershipsPager pager = new InstanceGroupMembershipsPager(vpcService, listInstanceGroupMembershipsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listInstanceGroupMemberships operation using the InstanceGroupMembershipsPager.getAll() method + @Test + public void testListInstanceGroupMembershipsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"memberships\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"delete_instance_on_membership_delete\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance\"},\"instance_template\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"name\":\"my-instance-template\"},\"name\":\"my-instance-group-membership\",\"pool_member\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"},\"status\":\"deleting\",\"updated_at\":\"2019-01-01T12:00:00.000Z\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"memberships\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"delete_instance_on_membership_delete\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance\"},\"instance_template\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"name\":\"my-instance-template\"},\"name\":\"my-instance-group-membership\",\"pool_member\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"},\"status\":\"deleting\",\"updated_at\":\"2019-01-01T12:00:00.000Z\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstanceGroupMembershipsOptions listInstanceGroupMembershipsOptions = new ListInstanceGroupMembershipsOptions.Builder() + .instanceGroupId("testString") + .limit(Long.valueOf("10")) + .build(); + + InstanceGroupMembershipsPager pager = new InstanceGroupMembershipsPager(vpcService, listInstanceGroupMembershipsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the deleteInstanceGroupMembership operation with a valid options model parameter @Test public void testDeleteInstanceGroupMembershipWOptions() throws Throwable { @@ -8410,7 +9602,7 @@ public void testListDedicatedHostGroupsWOptions() throws Throwable { // Construct an instance of the ListDedicatedHostGroupsOptions model ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptionsModel = new ListDedicatedHostGroupsOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .zoneName("testString") .name("testString") @@ -8435,7 +9627,7 @@ public void testListDedicatedHostGroupsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("zone.name"), "testString"); assertEquals(query.get("name"), "testString"); @@ -8451,6 +9643,74 @@ public void testListDedicatedHostGroupsWRetries() throws Throwable { testListDedicatedHostGroupsWOptions(); } + // Test the listDedicatedHostGroups operation using the DedicatedHostGroupsPager.getNext() method + @Test + public void testListDedicatedHostGroupsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"groups\":[{\"class\":\"mx2\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"dedicated_hosts\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host_group\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"groups\":[{\"class\":\"mx2\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"dedicated_hosts\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host_group\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions = new ListDedicatedHostGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .zoneName("testString") + .name("testString") + .build(); + + List allResults = new ArrayList<>(); + DedicatedHostGroupsPager pager = new DedicatedHostGroupsPager(vpcService, listDedicatedHostGroupsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listDedicatedHostGroups operation using the DedicatedHostGroupsPager.getAll() method + @Test + public void testListDedicatedHostGroupsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"groups\":[{\"class\":\"mx2\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"dedicated_hosts\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host_group\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"groups\":[{\"class\":\"mx2\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"dedicated_hosts\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host_group\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions = new ListDedicatedHostGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .zoneName("testString") + .name("testString") + .build(); + + DedicatedHostGroupsPager pager = new DedicatedHostGroupsPager(vpcService, listDedicatedHostGroupsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createDedicatedHostGroup operation with a valid options model parameter @Test public void testCreateDedicatedHostGroupWOptions() throws Throwable { @@ -8629,7 +9889,7 @@ public void testUpdateDedicatedHostGroupWOptions() throws Throwable { // Construct an instance of the DedicatedHostGroupPatch model DedicatedHostGroupPatch dedicatedHostGroupPatchModel = new DedicatedHostGroupPatch.Builder() - .name("my-host-group-modified") + .name("my-host-group-updated") .build(); Map dedicatedHostGroupPatchModelAsPatch = dedicatedHostGroupPatchModel.asPatch(); @@ -8690,7 +9950,7 @@ public void testListDedicatedHostProfilesWOptions() throws Throwable { // Construct an instance of the ListDedicatedHostProfilesOptions model ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptionsModel = new ListDedicatedHostProfilesOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listDedicatedHostProfiles() with a valid options model and verify the result @@ -8712,7 +9972,7 @@ public void testListDedicatedHostProfilesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listDedicatedHostProfiles operation with and without retries enabled @@ -8725,6 +9985,68 @@ public void testListDedicatedHostProfilesWRetries() throws Throwable { testListDedicatedHostProfilesWOptions(); } + // Test the listDedicatedHostProfiles operation using the DedicatedHostProfilesPager.getNext() method + @Test + public void testListDedicatedHostProfilesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"class\":\"mx2\",\"disks\":[{\"interface_type\":{\"type\":\"fixed\",\"value\":\"nvme\"},\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":3200},\"supported_instance_interface_types\":{\"type\":\"fixed\",\"value\":[\"nvme\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"mx2-host-152x1216\",\"socket_count\":{\"type\":\"fixed\",\"value\":2},\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"}],\"vcpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"vcpu_count\":{\"type\":\"fixed\",\"value\":16}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"class\":\"mx2\",\"disks\":[{\"interface_type\":{\"type\":\"fixed\",\"value\":\"nvme\"},\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":3200},\"supported_instance_interface_types\":{\"type\":\"fixed\",\"value\":[\"nvme\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"mx2-host-152x1216\",\"socket_count\":{\"type\":\"fixed\",\"value\":2},\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"}],\"vcpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"vcpu_count\":{\"type\":\"fixed\",\"value\":16}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptions = new ListDedicatedHostProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + DedicatedHostProfilesPager pager = new DedicatedHostProfilesPager(vpcService, listDedicatedHostProfilesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listDedicatedHostProfiles operation using the DedicatedHostProfilesPager.getAll() method + @Test + public void testListDedicatedHostProfilesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"class\":\"mx2\",\"disks\":[{\"interface_type\":{\"type\":\"fixed\",\"value\":\"nvme\"},\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":3200},\"supported_instance_interface_types\":{\"type\":\"fixed\",\"value\":[\"nvme\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"mx2-host-152x1216\",\"socket_count\":{\"type\":\"fixed\",\"value\":2},\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"}],\"vcpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"vcpu_count\":{\"type\":\"fixed\",\"value\":16}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"class\":\"mx2\",\"disks\":[{\"interface_type\":{\"type\":\"fixed\",\"value\":\"nvme\"},\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":3200},\"supported_instance_interface_types\":{\"type\":\"fixed\",\"value\":[\"nvme\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"mx2-host-152x1216\",\"socket_count\":{\"type\":\"fixed\",\"value\":2},\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"}],\"vcpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"vcpu_count\":{\"type\":\"fixed\",\"value\":16}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptions = new ListDedicatedHostProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + DedicatedHostProfilesPager pager = new DedicatedHostProfilesPager(vpcService, listDedicatedHostProfilesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the getDedicatedHostProfile operation with a valid options model parameter @Test public void testGetDedicatedHostProfileWOptions() throws Throwable { @@ -8793,7 +10115,7 @@ public void testListDedicatedHostsWOptions() throws Throwable { ListDedicatedHostsOptions listDedicatedHostsOptionsModel = new ListDedicatedHostsOptions.Builder() .dedicatedHostGroupId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .zoneName("testString") .name("testString") @@ -8819,7 +10141,7 @@ public void testListDedicatedHostsWOptions() throws Throwable { assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("dedicated_host_group.id"), "testString"); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("zone.name"), "testString"); assertEquals(query.get("name"), "testString"); @@ -8835,6 +10157,76 @@ public void testListDedicatedHostsWRetries() throws Throwable { testListDedicatedHostsWOptions(); } + // Test the listDedicatedHosts operation using the DedicatedHostsPager.getNext() method + @Test + public void testListDedicatedHostsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"dedicated_hosts\":[{\"available_memory\":128,\"available_vcpu\":{\"architecture\":\"amd64\",\"count\":4},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"available\":9,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"instance_disks\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\"}],\"interface_type\":\"nvme\",\"lifecycle_state\":\"stable\",\"name\":\"my-dedicated-host-disk\",\"provisionable\":false,\"resource_type\":\"dedicated_host_disk\",\"size\":4,\"supported_instance_interface_types\":[\"nvme\"]}],\"group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_placement_enabled\":true,\"instances\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance\"}],\"lifecycle_state\":\"stable\",\"memory\":128,\"name\":\"my-host\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"mx2-host-152x1216\"},\"provisionable\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host\",\"socket_count\":4,\"state\":\"available\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"}],\"vcpu\":{\"architecture\":\"amd64\",\"count\":4},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"dedicated_hosts\":[{\"available_memory\":128,\"available_vcpu\":{\"architecture\":\"amd64\",\"count\":4},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"available\":9,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"instance_disks\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\"}],\"interface_type\":\"nvme\",\"lifecycle_state\":\"stable\",\"name\":\"my-dedicated-host-disk\",\"provisionable\":false,\"resource_type\":\"dedicated_host_disk\",\"size\":4,\"supported_instance_interface_types\":[\"nvme\"]}],\"group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_placement_enabled\":true,\"instances\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance\"}],\"lifecycle_state\":\"stable\",\"memory\":128,\"name\":\"my-host\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"mx2-host-152x1216\"},\"provisionable\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host\",\"socket_count\":4,\"state\":\"available\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"}],\"vcpu\":{\"architecture\":\"amd64\",\"count\":4},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListDedicatedHostsOptions listDedicatedHostsOptions = new ListDedicatedHostsOptions.Builder() + .dedicatedHostGroupId("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .zoneName("testString") + .name("testString") + .build(); + + List allResults = new ArrayList<>(); + DedicatedHostsPager pager = new DedicatedHostsPager(vpcService, listDedicatedHostsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listDedicatedHosts operation using the DedicatedHostsPager.getAll() method + @Test + public void testListDedicatedHostsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"dedicated_hosts\":[{\"available_memory\":128,\"available_vcpu\":{\"architecture\":\"amd64\",\"count\":4},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"available\":9,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"instance_disks\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\"}],\"interface_type\":\"nvme\",\"lifecycle_state\":\"stable\",\"name\":\"my-dedicated-host-disk\",\"provisionable\":false,\"resource_type\":\"dedicated_host_disk\",\"size\":4,\"supported_instance_interface_types\":[\"nvme\"]}],\"group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_placement_enabled\":true,\"instances\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance\"}],\"lifecycle_state\":\"stable\",\"memory\":128,\"name\":\"my-host\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"mx2-host-152x1216\"},\"provisionable\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host\",\"socket_count\":4,\"state\":\"available\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"}],\"vcpu\":{\"architecture\":\"amd64\",\"count\":4},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"dedicated_hosts\":[{\"available_memory\":128,\"available_vcpu\":{\"architecture\":\"amd64\",\"count\":4},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"available\":9,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"instance_disks\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\"}],\"interface_type\":\"nvme\",\"lifecycle_state\":\"stable\",\"name\":\"my-dedicated-host-disk\",\"provisionable\":false,\"resource_type\":\"dedicated_host_disk\",\"size\":4,\"supported_instance_interface_types\":[\"nvme\"]}],\"group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_placement_enabled\":true,\"instances\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance\"}],\"lifecycle_state\":\"stable\",\"memory\":128,\"name\":\"my-host\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"mx2-host-152x1216\"},\"provisionable\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host\",\"socket_count\":4,\"state\":\"available\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\"}],\"vcpu\":{\"architecture\":\"amd64\",\"count\":4},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListDedicatedHostsOptions listDedicatedHostsOptions = new ListDedicatedHostsOptions.Builder() + .dedicatedHostGroupId("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .zoneName("testString") + .name("testString") + .build(); + + DedicatedHostsPager pager = new DedicatedHostsPager(vpcService, listDedicatedHostsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createDedicatedHost operation with a valid options model parameter @Test public void testCreateDedicatedHostWOptions() throws Throwable { @@ -9260,7 +10652,7 @@ public void testListBackupPoliciesWOptions() throws Throwable { // Construct an instance of the ListBackupPoliciesOptions model ListBackupPoliciesOptions listBackupPoliciesOptionsModel = new ListBackupPoliciesOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .name("testString") .tag("testString") @@ -9285,7 +10677,7 @@ public void testListBackupPoliciesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("name"), "testString"); assertEquals(query.get("tag"), "testString"); @@ -9301,6 +10693,74 @@ public void testListBackupPoliciesWRetries() throws Throwable { testListBackupPoliciesWOptions(); } + // Test the listBackupPolicies operation using the BackupPoliciesPager.getNext() method + @Test + public void testListBackupPoliciesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"backup_policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_resource_types\":[\"volume\"],\"match_user_tags\":[\"matchUserTags\"],\"name\":\"my-backup-policy\",\"plans\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"resource_type\":\"backup_policy_plan\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"backup_policy\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"backup_policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_resource_types\":[\"volume\"],\"match_user_tags\":[\"matchUserTags\"],\"name\":\"my-backup-policy\",\"plans\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"resource_type\":\"backup_policy_plan\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"backup_policy\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBackupPoliciesOptions listBackupPoliciesOptions = new ListBackupPoliciesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .tag("testString") + .build(); + + List allResults = new ArrayList<>(); + BackupPoliciesPager pager = new BackupPoliciesPager(vpcService, listBackupPoliciesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listBackupPolicies operation using the BackupPoliciesPager.getAll() method + @Test + public void testListBackupPoliciesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"backup_policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_resource_types\":[\"volume\"],\"match_user_tags\":[\"matchUserTags\"],\"name\":\"my-backup-policy\",\"plans\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"resource_type\":\"backup_policy_plan\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"backup_policy\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"backup_policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_resource_types\":[\"volume\"],\"match_user_tags\":[\"matchUserTags\"],\"name\":\"my-backup-policy\",\"plans\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"resource_type\":\"backup_policy_plan\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"backup_policy\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBackupPoliciesOptions listBackupPoliciesOptions = new ListBackupPoliciesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .tag("testString") + .build(); + + BackupPoliciesPager pager = new BackupPoliciesPager(vpcService, listBackupPoliciesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createBackupPolicy operation with a valid options model parameter @Test public void testCreateBackupPolicyWOptions() throws Throwable { @@ -9321,7 +10781,7 @@ public void testCreateBackupPolicyWOptions() throws Throwable { // Construct an instance of the BackupPolicyPlanPrototype model BackupPolicyPlanPrototype backupPolicyPlanPrototypeModel = new BackupPolicyPlanPrototype.Builder() .active(true) - .attachUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) .copyUserTags(true) .cronSpec("*/5 1,2,3 * * *") .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) @@ -9335,10 +10795,10 @@ public void testCreateBackupPolicyWOptions() throws Throwable { // Construct an instance of the CreateBackupPolicyOptions model CreateBackupPolicyOptions createBackupPolicyOptionsModel = new CreateBackupPolicyOptions.Builder() - .matchResourceTypes(new java.util.ArrayList(java.util.Arrays.asList("volume"))) - .matchUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-policy"))) + .matchResourceTypes(java.util.Arrays.asList("volume")) + .matchUserTags(java.util.Arrays.asList("my-daily-backup-policy")) .name("my-backup-policy") - .plans(new java.util.ArrayList(java.util.Arrays.asList(backupPolicyPlanPrototypeModel))) + .plans(java.util.Arrays.asList(backupPolicyPlanPrototypeModel)) .resourceGroup(resourceGroupIdentityModel) .build(); @@ -9449,7 +10909,7 @@ public void testCreateBackupPolicyPlanWOptions() throws Throwable { .backupPolicyId("testString") .cronSpec("*/5 1,2,3 * * *") .active(true) - .attachUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) .copyUserTags(true) .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) .name("my-policy-plan") @@ -9621,7 +11081,7 @@ public void testUpdateBackupPolicyPlanWOptions() throws Throwable { // Construct an instance of the BackupPolicyPlanPatch model BackupPolicyPlanPatch backupPolicyPlanPatchModel = new BackupPolicyPlanPatch.Builder() .active(true) - .attachUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) .copyUserTags(true) .cronSpec("*/5 1,2,3 * * *") .deletionTrigger(backupPolicyPlanDeletionTriggerPatchModel) @@ -9794,7 +11254,7 @@ public void testUpdateBackupPolicyWOptions() throws Throwable { // Construct an instance of the BackupPolicyPatch model BackupPolicyPatch backupPolicyPatchModel = new BackupPolicyPatch.Builder() - .matchUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-policy"))) + .matchUserTags(java.util.Arrays.asList("my-daily-backup-policy")) .name("my-backup-policy") .build(); Map backupPolicyPatchModelAsPatch = backupPolicyPatchModel.asPatch(); @@ -9857,7 +11317,7 @@ public void testListPlacementGroupsWOptions() throws Throwable { // Construct an instance of the ListPlacementGroupsOptions model ListPlacementGroupsOptions listPlacementGroupsOptionsModel = new ListPlacementGroupsOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listPlacementGroups() with a valid options model and verify the result @@ -9879,7 +11339,7 @@ public void testListPlacementGroupsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listPlacementGroups operation with and without retries enabled @@ -9892,6 +11352,68 @@ public void testListPlacementGroupsWRetries() throws Throwable { testListPlacementGroupsWOptions(); } + // Test the listPlacementGroups operation using the PlacementGroupsPager.getNext() method + @Test + public void testListPlacementGroupsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"placement_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"id\":\"r018-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"lifecycle_state\":\"stable\",\"name\":\"my-placement-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"placement_group\",\"strategy\":\"host_spread\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"placement_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"id\":\"r018-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"lifecycle_state\":\"stable\",\"name\":\"my-placement-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"placement_group\",\"strategy\":\"host_spread\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListPlacementGroupsOptions listPlacementGroupsOptions = new ListPlacementGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + PlacementGroupsPager pager = new PlacementGroupsPager(vpcService, listPlacementGroupsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listPlacementGroups operation using the PlacementGroupsPager.getAll() method + @Test + public void testListPlacementGroupsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"placement_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"id\":\"r018-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"lifecycle_state\":\"stable\",\"name\":\"my-placement-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"placement_group\",\"strategy\":\"host_spread\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"placement_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"id\":\"r018-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"lifecycle_state\":\"stable\",\"name\":\"my-placement-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"placement_group\",\"strategy\":\"host_spread\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListPlacementGroupsOptions listPlacementGroupsOptions = new ListPlacementGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + PlacementGroupsPager pager = new PlacementGroupsPager(vpcService, listPlacementGroupsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createPlacementGroup operation with a valid options model parameter @Test public void testCreatePlacementGroupWOptions() throws Throwable { @@ -10121,7 +11643,7 @@ public void testUpdatePlacementGroupNoOptions() throws Throwable { @Test public void testListBareMetalServerProfilesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"profiles\": [{\"bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"cpu_architecture\": {\"default\": \"amd64\", \"type\": \"fixed\", \"value\": \"amd64\"}, \"cpu_core_count\": {\"type\": \"fixed\", \"value\": 80}, \"cpu_socket_count\": {\"type\": \"fixed\", \"value\": 4}, \"disks\": [{\"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 100}, \"supported_interface_types\": {\"default\": \"nvme\", \"type\": \"enum\", \"values\": [\"nvme\"]}}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"bx2-metal-192x768\", \"os_architecture\": {\"default\": \"amd64\", \"type\": \"enum\", \"values\": [\"amd64\"]}, \"resource_type\": \"bare_metal_server_profile\", \"supported_trusted_platform_module_modes\": {\"type\": \"enum\", \"values\": [\"tpm_2\"]}}], \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"profiles\": [{\"bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"cpu_architecture\": {\"default\": \"amd64\", \"type\": \"fixed\", \"value\": \"amd64\"}, \"cpu_core_count\": {\"type\": \"fixed\", \"value\": 80}, \"cpu_socket_count\": {\"type\": \"fixed\", \"value\": 4}, \"disks\": [{\"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 100}, \"supported_interface_types\": {\"default\": \"fcp\", \"type\": \"enum\", \"values\": [\"fcp\"]}}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"bx2-metal-192x768\", \"os_architecture\": {\"default\": \"amd64\", \"type\": \"enum\", \"values\": [\"amd64\"]}, \"resource_type\": \"bare_metal_server_profile\", \"supported_trusted_platform_module_modes\": {\"type\": \"enum\", \"values\": [\"tpm_2\"]}}], \"total_count\": 132}"; String listBareMetalServerProfilesPath = "/bare_metal_server/profiles"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -10131,7 +11653,7 @@ public void testListBareMetalServerProfilesWOptions() throws Throwable { // Construct an instance of the ListBareMetalServerProfilesOptions model ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptionsModel = new ListBareMetalServerProfilesOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listBareMetalServerProfiles() with a valid options model and verify the result @@ -10153,7 +11675,7 @@ public void testListBareMetalServerProfilesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listBareMetalServerProfiles operation with and without retries enabled @@ -10166,11 +11688,73 @@ public void testListBareMetalServerProfilesWRetries() throws Throwable { testListBareMetalServerProfilesWOptions(); } + // Test the listBareMetalServerProfiles operation using the BareMetalServerProfilesPager.getNext() method + @Test + public void testListBareMetalServerProfilesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"bandwidth\":{\"type\":\"fixed\",\"value\":20000},\"cpu_architecture\":{\"default\":\"amd64\",\"type\":\"fixed\",\"value\":\"amd64\"},\"cpu_core_count\":{\"type\":\"fixed\",\"value\":80},\"cpu_socket_count\":{\"type\":\"fixed\",\"value\":4},\"disks\":[{\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":100},\"supported_interface_types\":{\"default\":\"fcp\",\"type\":\"enum\",\"values\":[\"fcp\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"bx2-metal-192x768\",\"os_architecture\":{\"default\":\"amd64\",\"type\":\"enum\",\"values\":[\"amd64\"]},\"resource_type\":\"bare_metal_server_profile\",\"supported_trusted_platform_module_modes\":{\"type\":\"enum\",\"values\":[\"tpm_2\"]}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"bandwidth\":{\"type\":\"fixed\",\"value\":20000},\"cpu_architecture\":{\"default\":\"amd64\",\"type\":\"fixed\",\"value\":\"amd64\"},\"cpu_core_count\":{\"type\":\"fixed\",\"value\":80},\"cpu_socket_count\":{\"type\":\"fixed\",\"value\":4},\"disks\":[{\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":100},\"supported_interface_types\":{\"default\":\"fcp\",\"type\":\"enum\",\"values\":[\"fcp\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"bx2-metal-192x768\",\"os_architecture\":{\"default\":\"amd64\",\"type\":\"enum\",\"values\":[\"amd64\"]},\"resource_type\":\"bare_metal_server_profile\",\"supported_trusted_platform_module_modes\":{\"type\":\"enum\",\"values\":[\"tpm_2\"]}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptions = new ListBareMetalServerProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + BareMetalServerProfilesPager pager = new BareMetalServerProfilesPager(vpcService, listBareMetalServerProfilesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listBareMetalServerProfiles operation using the BareMetalServerProfilesPager.getAll() method + @Test + public void testListBareMetalServerProfilesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"bandwidth\":{\"type\":\"fixed\",\"value\":20000},\"cpu_architecture\":{\"default\":\"amd64\",\"type\":\"fixed\",\"value\":\"amd64\"},\"cpu_core_count\":{\"type\":\"fixed\",\"value\":80},\"cpu_socket_count\":{\"type\":\"fixed\",\"value\":4},\"disks\":[{\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":100},\"supported_interface_types\":{\"default\":\"fcp\",\"type\":\"enum\",\"values\":[\"fcp\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"bx2-metal-192x768\",\"os_architecture\":{\"default\":\"amd64\",\"type\":\"enum\",\"values\":[\"amd64\"]},\"resource_type\":\"bare_metal_server_profile\",\"supported_trusted_platform_module_modes\":{\"type\":\"enum\",\"values\":[\"tpm_2\"]}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"bandwidth\":{\"type\":\"fixed\",\"value\":20000},\"cpu_architecture\":{\"default\":\"amd64\",\"type\":\"fixed\",\"value\":\"amd64\"},\"cpu_core_count\":{\"type\":\"fixed\",\"value\":80},\"cpu_socket_count\":{\"type\":\"fixed\",\"value\":4},\"disks\":[{\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":100},\"supported_interface_types\":{\"default\":\"fcp\",\"type\":\"enum\",\"values\":[\"fcp\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"bx2-metal-192x768\",\"os_architecture\":{\"default\":\"amd64\",\"type\":\"enum\",\"values\":[\"amd64\"]},\"resource_type\":\"bare_metal_server_profile\",\"supported_trusted_platform_module_modes\":{\"type\":\"enum\",\"values\":[\"tpm_2\"]}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptions = new ListBareMetalServerProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + BareMetalServerProfilesPager pager = new BareMetalServerProfilesPager(vpcService, listBareMetalServerProfilesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the getBareMetalServerProfile operation with a valid options model parameter @Test public void testGetBareMetalServerProfileWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"cpu_architecture\": {\"default\": \"amd64\", \"type\": \"fixed\", \"value\": \"amd64\"}, \"cpu_core_count\": {\"type\": \"fixed\", \"value\": 80}, \"cpu_socket_count\": {\"type\": \"fixed\", \"value\": 4}, \"disks\": [{\"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 100}, \"supported_interface_types\": {\"default\": \"nvme\", \"type\": \"enum\", \"values\": [\"nvme\"]}}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"bx2-metal-192x768\", \"os_architecture\": {\"default\": \"amd64\", \"type\": \"enum\", \"values\": [\"amd64\"]}, \"resource_type\": \"bare_metal_server_profile\", \"supported_trusted_platform_module_modes\": {\"type\": \"enum\", \"values\": [\"tpm_2\"]}}"; + String mockResponseBody = "{\"bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"cpu_architecture\": {\"default\": \"amd64\", \"type\": \"fixed\", \"value\": \"amd64\"}, \"cpu_core_count\": {\"type\": \"fixed\", \"value\": 80}, \"cpu_socket_count\": {\"type\": \"fixed\", \"value\": 4}, \"disks\": [{\"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 100}, \"supported_interface_types\": {\"default\": \"fcp\", \"type\": \"enum\", \"values\": [\"fcp\"]}}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"bx2-metal-192x768\", \"os_architecture\": {\"default\": \"amd64\", \"type\": \"enum\", \"values\": [\"amd64\"]}, \"resource_type\": \"bare_metal_server_profile\", \"supported_trusted_platform_module_modes\": {\"type\": \"enum\", \"values\": [\"tpm_2\"]}}"; String getBareMetalServerProfilePath = "/bare_metal_server/profiles/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -10223,7 +11807,7 @@ public void testGetBareMetalServerProfileNoOptions() throws Throwable { @Test public void testListBareMetalServersWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"bare_metal_servers\": [{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"memory\": 1536, \"name\": \"my-bare-metal-server\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"failed\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"tpm_2\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; + String mockResponseBody = "{\"bare_metal_servers\": [{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"memory\": 1536, \"name\": \"my-bare-metal-server\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"failed\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"tpm_2\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; String listBareMetalServersPath = "/bare_metal_servers"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -10233,7 +11817,7 @@ public void testListBareMetalServersWOptions() throws Throwable { // Construct an instance of the ListBareMetalServersOptions model ListBareMetalServersOptions listBareMetalServersOptionsModel = new ListBareMetalServersOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .name("testString") .vpcId("testString") @@ -10263,7 +11847,7 @@ public void testListBareMetalServersWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("name"), "testString"); assertEquals(query.get("vpc.id"), "testString"); @@ -10284,11 +11868,89 @@ public void testListBareMetalServersWRetries() throws Throwable { testListBareMetalServersWOptions(); } + // Test the listBareMetalServers operation using the BareMetalServersPager.getNext() method + @Test + public void testListBareMetalServersWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"bare_metal_servers\":[{\"bandwidth\":20000,\"boot_target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-bare-metal-disk\",\"resource_type\":\"bare_metal_server_disk\"},\"cpu\":{\"architecture\":\"amd64\",\"core_count\":80,\"socket_count\":4,\"threads_per_core\":2},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"fcp\",\"name\":\"my-bare-metal-disk\",\"resource_type\":\"bare_metal_server_disk\",\"size\":100}],\"enable_secure_boot\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":1536,\"name\":\"my-bare-metal-server\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"bare_metal_server\",\"status\":\"failed\",\"status_reasons\":[{\"code\":\"cannot_start_capacity\",\"message\":\"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.\",\"more_info\":\"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}],\"trusted_platform_module\":{\"enabled\":true,\"mode\":\"tpm_2\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"bare_metal_servers\":[{\"bandwidth\":20000,\"boot_target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-bare-metal-disk\",\"resource_type\":\"bare_metal_server_disk\"},\"cpu\":{\"architecture\":\"amd64\",\"core_count\":80,\"socket_count\":4,\"threads_per_core\":2},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"fcp\",\"name\":\"my-bare-metal-disk\",\"resource_type\":\"bare_metal_server_disk\",\"size\":100}],\"enable_secure_boot\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":1536,\"name\":\"my-bare-metal-server\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"bare_metal_server\",\"status\":\"failed\",\"status_reasons\":[{\"code\":\"cannot_start_capacity\",\"message\":\"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.\",\"more_info\":\"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}],\"trusted_platform_module\":{\"enabled\":true,\"mode\":\"tpm_2\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBareMetalServersOptions listBareMetalServersOptions = new ListBareMetalServersOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .networkInterfacesSubnetId("testString") + .networkInterfacesSubnetCrn("testString") + .networkInterfacesSubnetName("testString") + .build(); + + List allResults = new ArrayList<>(); + BareMetalServersPager pager = new BareMetalServersPager(vpcService, listBareMetalServersOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listBareMetalServers operation using the BareMetalServersPager.getAll() method + @Test + public void testListBareMetalServersWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"bare_metal_servers\":[{\"bandwidth\":20000,\"boot_target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-bare-metal-disk\",\"resource_type\":\"bare_metal_server_disk\"},\"cpu\":{\"architecture\":\"amd64\",\"core_count\":80,\"socket_count\":4,\"threads_per_core\":2},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"fcp\",\"name\":\"my-bare-metal-disk\",\"resource_type\":\"bare_metal_server_disk\",\"size\":100}],\"enable_secure_boot\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":1536,\"name\":\"my-bare-metal-server\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"bare_metal_server\",\"status\":\"failed\",\"status_reasons\":[{\"code\":\"cannot_start_capacity\",\"message\":\"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.\",\"more_info\":\"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}],\"trusted_platform_module\":{\"enabled\":true,\"mode\":\"tpm_2\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"bare_metal_servers\":[{\"bandwidth\":20000,\"boot_target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-bare-metal-disk\",\"resource_type\":\"bare_metal_server_disk\"},\"cpu\":{\"architecture\":\"amd64\",\"core_count\":80,\"socket_count\":4,\"threads_per_core\":2},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"fcp\",\"name\":\"my-bare-metal-disk\",\"resource_type\":\"bare_metal_server_disk\",\"size\":100}],\"enable_secure_boot\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":1536,\"name\":\"my-bare-metal-server\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"bare_metal_server\",\"status\":\"failed\",\"status_reasons\":[{\"code\":\"cannot_start_capacity\",\"message\":\"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.\",\"more_info\":\"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}],\"trusted_platform_module\":{\"enabled\":true,\"mode\":\"tpm_2\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBareMetalServersOptions listBareMetalServersOptions = new ListBareMetalServersOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .networkInterfacesSubnetId("testString") + .networkInterfacesSubnetCrn("testString") + .networkInterfacesSubnetName("testString") + .build(); + + BareMetalServersPager pager = new BareMetalServersPager(vpcService, listBareMetalServersOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createBareMetalServer operation with a valid options model parameter @Test public void testCreateBareMetalServerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"memory\": 1536, \"name\": \"my-bare-metal-server\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"failed\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"tpm_2\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String mockResponseBody = "{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"memory\": 1536, \"name\": \"my-bare-metal-server\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"failed\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"tpm_2\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; String createBareMetalServerPath = "/bare_metal_servers"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -10308,7 +11970,7 @@ public void testCreateBareMetalServerWOptions() throws Throwable { // Construct an instance of the BareMetalServerInitializationPrototype model BareMetalServerInitializationPrototype bareMetalServerInitializationPrototypeModel = new BareMetalServerInitializationPrototype.Builder() .image(imageIdentityModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) + .keys(java.util.Arrays.asList(keyIdentityModel)) .userData("testString") .build(); @@ -10332,12 +11994,12 @@ public void testCreateBareMetalServerWOptions() throws Throwable { // Construct an instance of the BareMetalServerPrimaryNetworkInterfacePrototype model BareMetalServerPrimaryNetworkInterfacePrototype bareMetalServerPrimaryNetworkInterfacePrototypeModel = new BareMetalServerPrimaryNetworkInterfacePrototype.Builder() .allowIpSpoofing(true) - .allowedVlans(new java.util.ArrayList(java.util.Arrays.asList(Long.valueOf("4")))) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) .enableInfrastructureNat(true) .interfaceType("pci") .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); @@ -10351,17 +12013,15 @@ public void testCreateBareMetalServerWOptions() throws Throwable { .name("us-south-1") .build(); - // Construct an instance of the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype model - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.Builder() + // Construct an instance of the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.Builder() .allowIpSpoofing(true) .enableInfrastructureNat(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) - .allowInterfaceToFloat(false) - .interfaceType("vlan") - .vlan(Long.valueOf("4")) + .interfaceType("hipersocket") .build(); // Construct an instance of the ResourceGroupIdentityById model @@ -10381,7 +12041,7 @@ public void testCreateBareMetalServerWOptions() throws Throwable { .profile(bareMetalServerProfileIdentityModel) .zone(zoneIdentityModel) .name("my-bare-metal-server") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(bareMetalServerNetworkInterfacePrototypeModel))) + .networkInterfaces(java.util.Arrays.asList(bareMetalServerNetworkInterfacePrototypeModel)) .resourceGroup(resourceGroupIdentityModel) .vpc(vpcIdentityModel) .build(); @@ -10482,7 +12142,7 @@ public void testCreateBareMetalServerConsoleAccessTokenNoOptions() throws Throwa @Test public void testListBareMetalServerDisksWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}]}"; + String mockResponseBody = "{\"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}]}"; String listBareMetalServerDisksPath = "/bare_metal_servers/testString/disks"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -10535,7 +12195,7 @@ public void testListBareMetalServerDisksNoOptions() throws Throwable { @Test public void testGetBareMetalServerDiskWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}"; String getBareMetalServerDiskPath = "/bare_metal_servers/testString/disks/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -10589,7 +12249,7 @@ public void testGetBareMetalServerDiskNoOptions() throws Throwable { @Test public void testUpdateBareMetalServerDiskWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}"; String updateBareMetalServerDiskPath = "/bare_metal_servers/testString/disks/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -10650,7 +12310,7 @@ public void testUpdateBareMetalServerDiskNoOptions() throws Throwable { @Test public void testListBareMetalServerNetworkInterfacesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20\"}, \"limit\": 20, \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\", \"id\": \"39300233-9995-4806-89a5-3c1b6eb88689\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"mac_address\": \"02:00:0a:00:23:94\", \"name\": \"my-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"allowed_vlans\": [4], \"interface_type\": \"pci\"}], \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20\"}, \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20\"}, \"limit\": 20, \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\", \"id\": \"39300233-9995-4806-89a5-3c1b6eb88689\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"mac_address\": \"02:00:0a:00:23:94\", \"name\": \"my-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"interface_type\": \"hipersocket\"}], \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20\"}, \"total_count\": 132}"; String listBareMetalServerNetworkInterfacesPath = "/bare_metal_servers/testString/network_interfaces"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -10661,7 +12321,7 @@ public void testListBareMetalServerNetworkInterfacesWOptions() throws Throwable ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptionsModel = new ListBareMetalServerNetworkInterfacesOptions.Builder() .bareMetalServerId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listBareMetalServerNetworkInterfaces() with a valid options model and verify the result @@ -10683,7 +12343,7 @@ public void testListBareMetalServerNetworkInterfacesWOptions() throws Throwable assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listBareMetalServerNetworkInterfaces operation with and without retries enabled @@ -10703,11 +12363,75 @@ public void testListBareMetalServerNetworkInterfacesNoOptions() throws Throwable vpcService.listBareMetalServerNetworkInterfaces(null).execute(); } + // Test the listBareMetalServerNetworkInterfaces operation using the BareMetalServerNetworkInterfacesPager.getNext() method + @Test + public void testListBareMetalServerNetworkInterfacesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"network_interfaces\":[{\"allow_ip_spoofing\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":true,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"name\":\"my-floating-ip\"}],\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"mac_address\":\"02:00:0a:00:23:94\",\"name\":\"my-network-interface\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"interface_type\":\"hipersocket\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"network_interfaces\":[{\"allow_ip_spoofing\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":true,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"name\":\"my-floating-ip\"}],\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"mac_address\":\"02:00:0a:00:23:94\",\"name\":\"my-network-interface\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"interface_type\":\"hipersocket\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptions = new ListBareMetalServerNetworkInterfacesOptions.Builder() + .bareMetalServerId("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + BareMetalServerNetworkInterfacesPager pager = new BareMetalServerNetworkInterfacesPager(vpcService, listBareMetalServerNetworkInterfacesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listBareMetalServerNetworkInterfaces operation using the BareMetalServerNetworkInterfacesPager.getAll() method + @Test + public void testListBareMetalServerNetworkInterfacesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"network_interfaces\":[{\"allow_ip_spoofing\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":true,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"name\":\"my-floating-ip\"}],\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"mac_address\":\"02:00:0a:00:23:94\",\"name\":\"my-network-interface\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"interface_type\":\"hipersocket\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"network_interfaces\":[{\"allow_ip_spoofing\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":true,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"name\":\"my-floating-ip\"}],\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"mac_address\":\"02:00:0a:00:23:94\",\"name\":\"my-network-interface\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"interface_type\":\"hipersocket\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptions = new ListBareMetalServerNetworkInterfacesOptions.Builder() + .bareMetalServerId("testString") + .limit(Long.valueOf("10")) + .build(); + + BareMetalServerNetworkInterfacesPager pager = new BareMetalServerNetworkInterfacesPager(vpcService, listBareMetalServerNetworkInterfacesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createBareMetalServerNetworkInterface operation with a valid options model parameter @Test public void testCreateBareMetalServerNetworkInterfaceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\", \"id\": \"39300233-9995-4806-89a5-3c1b6eb88689\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"mac_address\": \"02:00:0a:00:23:94\", \"name\": \"my-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"allowed_vlans\": [4], \"interface_type\": \"pci\"}"; + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\", \"id\": \"39300233-9995-4806-89a5-3c1b6eb88689\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"mac_address\": \"02:00:0a:00:23:94\", \"name\": \"my-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"interface_type\": \"hipersocket\"}"; String createBareMetalServerNetworkInterfacePath = "/bare_metal_servers/testString/network_interfaces"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -10731,17 +12455,15 @@ public void testCreateBareMetalServerNetworkInterfaceWOptions() throws Throwable .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") .build(); - // Construct an instance of the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype model - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.Builder() + // Construct an instance of the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.Builder() .allowIpSpoofing(true) .enableInfrastructureNat(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) - .allowInterfaceToFloat(false) - .interfaceType("vlan") - .vlan(Long.valueOf("4")) + .interfaceType("hipersocket") .build(); // Construct an instance of the CreateBareMetalServerNetworkInterfaceOptions model @@ -10844,7 +12566,7 @@ public void testDeleteBareMetalServerNetworkInterfaceNoOptions() throws Throwabl @Test public void testGetBareMetalServerNetworkInterfaceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\", \"id\": \"39300233-9995-4806-89a5-3c1b6eb88689\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"mac_address\": \"02:00:0a:00:23:94\", \"name\": \"my-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"allowed_vlans\": [4], \"interface_type\": \"pci\"}"; + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\", \"id\": \"39300233-9995-4806-89a5-3c1b6eb88689\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"mac_address\": \"02:00:0a:00:23:94\", \"name\": \"my-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"interface_type\": \"hipersocket\"}"; String getBareMetalServerNetworkInterfacePath = "/bare_metal_servers/testString/network_interfaces/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -10898,7 +12620,7 @@ public void testGetBareMetalServerNetworkInterfaceNoOptions() throws Throwable { @Test public void testUpdateBareMetalServerNetworkInterfaceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\", \"id\": \"39300233-9995-4806-89a5-3c1b6eb88689\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"mac_address\": \"02:00:0a:00:23:94\", \"name\": \"my-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"allowed_vlans\": [4], \"interface_type\": \"pci\"}"; + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\", \"id\": \"39300233-9995-4806-89a5-3c1b6eb88689\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"mac_address\": \"02:00:0a:00:23:94\", \"name\": \"my-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"interface_type\": \"hipersocket\"}"; String updateBareMetalServerNetworkInterfacePath = "/bare_metal_servers/testString/network_interfaces/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -10908,7 +12630,7 @@ public void testUpdateBareMetalServerNetworkInterfaceWOptions() throws Throwable // Construct an instance of the BareMetalServerNetworkInterfacePatch model BareMetalServerNetworkInterfacePatch bareMetalServerNetworkInterfacePatchModel = new BareMetalServerNetworkInterfacePatch.Builder() .allowIpSpoofing(true) - .allowedVlans(new java.util.ArrayList(java.util.Arrays.asList(Long.valueOf("4")))) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) .enableInfrastructureNat(true) .name("my-network-interface") .build(); @@ -11081,13 +12803,122 @@ public void testGetBareMetalServerNetworkInterfaceFloatingIpWOptions() throws Th GetBareMetalServerNetworkInterfaceFloatingIpOptions getBareMetalServerNetworkInterfaceFloatingIpOptionsModel = new GetBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() .bareMetalServerId("testString") .networkInterfaceId("testString") - .id("testString") + .id("testString") + .build(); + + // Invoke getBareMetalServerNetworkInterfaceFloatingIp() with a valid options model and verify the result + Response response = vpcService.getBareMetalServerNetworkInterfaceFloatingIp(getBareMetalServerNetworkInterfaceFloatingIpOptionsModel).execute(); + assertNotNull(response); + FloatingIP responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getBareMetalServerNetworkInterfaceFloatingIpPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the getBareMetalServerNetworkInterfaceFloatingIp operation with and without retries enabled + @Test + public void testGetBareMetalServerNetworkInterfaceFloatingIpWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testGetBareMetalServerNetworkInterfaceFloatingIpWOptions(); + + vpcService.disableRetries(); + testGetBareMetalServerNetworkInterfaceFloatingIpWOptions(); + } + + // Test the getBareMetalServerNetworkInterfaceFloatingIp operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetBareMetalServerNetworkInterfaceFloatingIpNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getBareMetalServerNetworkInterfaceFloatingIp(null).execute(); + } + + // Test the addBareMetalServerNetworkInterfaceFloatingIp operation with a valid options model parameter + @Test + public void testAddBareMetalServerNetworkInterfaceFloatingIpWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\", \"id\": \"39300233-9995-4806-89a5-3c1b6eb88689\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String addBareMetalServerNetworkInterfaceFloatingIpPath = "/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the AddBareMetalServerNetworkInterfaceFloatingIpOptions model + AddBareMetalServerNetworkInterfaceFloatingIpOptions addBareMetalServerNetworkInterfaceFloatingIpOptionsModel = new AddBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") + .id("testString") + .build(); + + // Invoke addBareMetalServerNetworkInterfaceFloatingIp() with a valid options model and verify the result + Response response = vpcService.addBareMetalServerNetworkInterfaceFloatingIp(addBareMetalServerNetworkInterfaceFloatingIpOptionsModel).execute(); + assertNotNull(response); + FloatingIP responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PUT"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, addBareMetalServerNetworkInterfaceFloatingIpPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the addBareMetalServerNetworkInterfaceFloatingIp operation with and without retries enabled + @Test + public void testAddBareMetalServerNetworkInterfaceFloatingIpWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testAddBareMetalServerNetworkInterfaceFloatingIpWOptions(); + + vpcService.disableRetries(); + testAddBareMetalServerNetworkInterfaceFloatingIpWOptions(); + } + + // Test the addBareMetalServerNetworkInterfaceFloatingIp operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testAddBareMetalServerNetworkInterfaceFloatingIpNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.addBareMetalServerNetworkInterfaceFloatingIp(null).execute(); + } + + // Test the listBareMetalServerNetworkInterfaceIps operation with a valid options model parameter + @Test + public void testListBareMetalServerNetworkInterfaceIpsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20\"}, \"ips\": [{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"user\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\", \"id\": \"d7cc5196-9864-48c4-82d8-3f30da41fcc5\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}], \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20\"}, \"total_count\": 132}"; + String listBareMetalServerNetworkInterfaceIpsPath = "/bare_metal_servers/testString/network_interfaces/testString/ips"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListBareMetalServerNetworkInterfaceIpsOptions model + ListBareMetalServerNetworkInterfaceIpsOptions listBareMetalServerNetworkInterfaceIpsOptionsModel = new ListBareMetalServerNetworkInterfaceIpsOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") .build(); - // Invoke getBareMetalServerNetworkInterfaceFloatingIp() with a valid options model and verify the result - Response response = vpcService.getBareMetalServerNetworkInterfaceFloatingIp(getBareMetalServerNetworkInterfaceFloatingIpOptionsModel).execute(); + // Invoke listBareMetalServerNetworkInterfaceIps() with a valid options model and verify the result + Response response = vpcService.listBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptionsModel).execute(); assertNotNull(response); - FloatingIP responseObj = response.getResult(); + ReservedIPCollectionNetworkInterfaceContext responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -11096,7 +12927,7 @@ public void testGetBareMetalServerNetworkInterfaceFloatingIpWOptions() throws Th assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getBareMetalServerNetworkInterfaceFloatingIpPath); + assertEquals(parsedPath, listBareMetalServerNetworkInterfaceIpsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); @@ -11104,54 +12935,54 @@ public void testGetBareMetalServerNetworkInterfaceFloatingIpWOptions() throws Th assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getBareMetalServerNetworkInterfaceFloatingIp operation with and without retries enabled + // Test the listBareMetalServerNetworkInterfaceIps operation with and without retries enabled @Test - public void testGetBareMetalServerNetworkInterfaceFloatingIpWRetries() throws Throwable { + public void testListBareMetalServerNetworkInterfaceIpsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetBareMetalServerNetworkInterfaceFloatingIpWOptions(); + testListBareMetalServerNetworkInterfaceIpsWOptions(); vpcService.disableRetries(); - testGetBareMetalServerNetworkInterfaceFloatingIpWOptions(); + testListBareMetalServerNetworkInterfaceIpsWOptions(); } - // Test the getBareMetalServerNetworkInterfaceFloatingIp operation with a null options model (negative test) + // Test the listBareMetalServerNetworkInterfaceIps operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetBareMetalServerNetworkInterfaceFloatingIpNoOptions() throws Throwable { + public void testListBareMetalServerNetworkInterfaceIpsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getBareMetalServerNetworkInterfaceFloatingIp(null).execute(); + vpcService.listBareMetalServerNetworkInterfaceIps(null).execute(); } - // Test the addBareMetalServerNetworkInterfaceFloatingIp operation with a valid options model parameter + // Test the getBareMetalServerNetworkInterfaceIp operation with a valid options model parameter @Test - public void testAddBareMetalServerNetworkInterfaceFloatingIpWOptions() throws Throwable { + public void testGetBareMetalServerNetworkInterfaceIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\", \"id\": \"39300233-9995-4806-89a5-3c1b6eb88689\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String addBareMetalServerNetworkInterfaceFloatingIpPath = "/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString"; + String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"user\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\", \"id\": \"d7cc5196-9864-48c4-82d8-3f30da41fcc5\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; + String getBareMetalServerNetworkInterfaceIpPath = "/bare_metal_servers/testString/network_interfaces/testString/ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the AddBareMetalServerNetworkInterfaceFloatingIpOptions model - AddBareMetalServerNetworkInterfaceFloatingIpOptions addBareMetalServerNetworkInterfaceFloatingIpOptionsModel = new AddBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() + // Construct an instance of the GetBareMetalServerNetworkInterfaceIpOptions model + GetBareMetalServerNetworkInterfaceIpOptions getBareMetalServerNetworkInterfaceIpOptionsModel = new GetBareMetalServerNetworkInterfaceIpOptions.Builder() .bareMetalServerId("testString") .networkInterfaceId("testString") .id("testString") .build(); - // Invoke addBareMetalServerNetworkInterfaceFloatingIp() with a valid options model and verify the result - Response response = vpcService.addBareMetalServerNetworkInterfaceFloatingIp(addBareMetalServerNetworkInterfaceFloatingIpOptionsModel).execute(); + // Invoke getBareMetalServerNetworkInterfaceIp() with a valid options model and verify the result + Response response = vpcService.getBareMetalServerNetworkInterfaceIp(getBareMetalServerNetworkInterfaceIpOptionsModel).execute(); assertNotNull(response); - FloatingIP responseObj = response.getResult(); + ReservedIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, addBareMetalServerNetworkInterfaceFloatingIpPath); + assertEquals(parsedPath, getBareMetalServerNetworkInterfaceIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); @@ -11159,21 +12990,21 @@ public void testAddBareMetalServerNetworkInterfaceFloatingIpWOptions() throws Th assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the addBareMetalServerNetworkInterfaceFloatingIp operation with and without retries enabled + // Test the getBareMetalServerNetworkInterfaceIp operation with and without retries enabled @Test - public void testAddBareMetalServerNetworkInterfaceFloatingIpWRetries() throws Throwable { + public void testGetBareMetalServerNetworkInterfaceIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testAddBareMetalServerNetworkInterfaceFloatingIpWOptions(); + testGetBareMetalServerNetworkInterfaceIpWOptions(); vpcService.disableRetries(); - testAddBareMetalServerNetworkInterfaceFloatingIpWOptions(); + testGetBareMetalServerNetworkInterfaceIpWOptions(); } - // Test the addBareMetalServerNetworkInterfaceFloatingIp operation with a null options model (negative test) + // Test the getBareMetalServerNetworkInterfaceIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testAddBareMetalServerNetworkInterfaceFloatingIpNoOptions() throws Throwable { + public void testGetBareMetalServerNetworkInterfaceIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.addBareMetalServerNetworkInterfaceFloatingIp(null).execute(); + vpcService.getBareMetalServerNetworkInterfaceIp(null).execute(); } // Test the deleteBareMetalServer operation with a valid options model parameter @@ -11232,7 +13063,7 @@ public void testDeleteBareMetalServerNoOptions() throws Throwable { @Test public void testGetBareMetalServerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"memory\": 1536, \"name\": \"my-bare-metal-server\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"failed\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"tpm_2\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String mockResponseBody = "{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"memory\": 1536, \"name\": \"my-bare-metal-server\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"failed\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"tpm_2\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; String getBareMetalServerPath = "/bare_metal_servers/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -11285,7 +13116,7 @@ public void testGetBareMetalServerNoOptions() throws Throwable { @Test public void testUpdateBareMetalServerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"memory\": 1536, \"name\": \"my-bare-metal-server\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"failed\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"tpm_2\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String mockResponseBody = "{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"memory\": 1536, \"name\": \"my-bare-metal-server\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"failed\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"tpm_2\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; String updateBareMetalServerPath = "/bare_metal_servers/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -11565,7 +13396,7 @@ public void testListVolumeProfilesWOptions() throws Throwable { // Construct an instance of the ListVolumeProfilesOptions model ListVolumeProfilesOptions listVolumeProfilesOptionsModel = new ListVolumeProfilesOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listVolumeProfiles() with a valid options model and verify the result @@ -11587,7 +13418,7 @@ public void testListVolumeProfilesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listVolumeProfiles operation with and without retries enabled @@ -11600,6 +13431,68 @@ public void testListVolumeProfilesWRetries() throws Throwable { testListVolumeProfilesWOptions(); } + // Test the listVolumeProfiles operation using the VolumeProfilesPager.getNext() method + @Test + public void testListVolumeProfilesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"tiered\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"tiered\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVolumeProfilesOptions listVolumeProfilesOptions = new ListVolumeProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + VolumeProfilesPager pager = new VolumeProfilesPager(vpcService, listVolumeProfilesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listVolumeProfiles operation using the VolumeProfilesPager.getAll() method + @Test + public void testListVolumeProfilesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"tiered\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"tiered\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVolumeProfilesOptions listVolumeProfilesOptions = new ListVolumeProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + VolumeProfilesPager pager = new VolumeProfilesPager(vpcService, listVolumeProfilesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the getVolumeProfile operation with a valid options model parameter @Test public void testGetVolumeProfileWOptions() throws Throwable { @@ -11667,7 +13560,7 @@ public void testListVolumesWOptions() throws Throwable { // Construct an instance of the ListVolumesOptions model ListVolumesOptions listVolumesOptionsModel = new ListVolumesOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .name("testString") .zoneName("testString") .build(); @@ -11691,7 +13584,7 @@ public void testListVolumesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("name"), "testString"); assertEquals(query.get("zone.name"), "testString"); } @@ -11706,6 +13599,72 @@ public void testListVolumesWRetries() throws Throwable { testListVolumesWOptions(); } + // Test the listVolumes operation using the VolumesPager.getNext() method + @Test + public void testListVolumesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"bandwidth\":1000,\"busy\":true,\"capacity\":1000,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"resource_type\":\"snapshot\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance\"},\"name\":\"my-volume-attachment\",\"type\":\"boot\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"bandwidth\":1000,\"busy\":true,\"capacity\":1000,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"resource_type\":\"snapshot\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance\"},\"name\":\"my-volume-attachment\",\"type\":\"boot\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVolumesOptions listVolumesOptions = new ListVolumesOptions.Builder() + .limit(Long.valueOf("10")) + .name("testString") + .zoneName("testString") + .build(); + + List allResults = new ArrayList<>(); + VolumesPager pager = new VolumesPager(vpcService, listVolumesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listVolumes operation using the VolumesPager.getAll() method + @Test + public void testListVolumesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"bandwidth\":1000,\"busy\":true,\"capacity\":1000,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"resource_type\":\"snapshot\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance\"},\"name\":\"my-volume-attachment\",\"type\":\"boot\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"bandwidth\":1000,\"busy\":true,\"capacity\":1000,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"resource_type\":\"snapshot\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-instance\"},\"name\":\"my-volume-attachment\",\"type\":\"boot\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVolumesOptions listVolumesOptions = new ListVolumesOptions.Builder() + .limit(Long.valueOf("10")) + .name("testString") + .zoneName("testString") + .build(); + + VolumesPager pager = new VolumesPager(vpcService, listVolumesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createVolume operation with a valid options model parameter @Test public void testCreateVolumeWOptions() throws Throwable { @@ -11743,7 +13702,7 @@ public void testCreateVolumeWOptions() throws Throwable { .name("my-volume") .profile(volumeProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .userTags(java.util.Arrays.asList("testString")) .zone(zoneIdentityModel) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -11919,7 +13878,7 @@ public void testUpdateVolumeWOptions() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .userTags(java.util.Arrays.asList("testString")) .build(); Map volumePatchModelAsPatch = volumePatchModel.asPatch(); @@ -12034,7 +13993,7 @@ public void testListSnapshotsWOptions() throws Throwable { // Construct an instance of the ListSnapshotsOptions model ListSnapshotsOptions listSnapshotsOptionsModel = new ListSnapshotsOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .tag("testString") .resourceGroupId("testString") .name("testString") @@ -12065,7 +14024,7 @@ public void testListSnapshotsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("tag"), "testString"); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("name"), "testString"); @@ -12087,6 +14046,86 @@ public void testListSnapshotsWRetries() throws Throwable { testListSnapshotsWOptions(); } + // Test the listSnapshots operation using the SnapshotsPager.getNext() method + @Test + public void testListSnapshotsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot\",\"service_tags\":[\"serviceTags\"],\"size\":1,\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"user_tags\":[\"userTags\"]}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot\",\"service_tags\":[\"serviceTags\"],\"size\":1,\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"user_tags\":[\"userTags\"]}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListSnapshotsOptions listSnapshotsOptions = new ListSnapshotsOptions.Builder() + .limit(Long.valueOf("10")) + .tag("testString") + .resourceGroupId("testString") + .name("testString") + .sourceVolumeId("testString") + .sourceVolumeCrn("testString") + .sourceImageId("testString") + .sourceImageCrn("testString") + .sort("name") + .backupPolicyPlanId("testString") + .build(); + + List allResults = new ArrayList<>(); + SnapshotsPager pager = new SnapshotsPager(vpcService, listSnapshotsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listSnapshots operation using the SnapshotsPager.getAll() method + @Test + public void testListSnapshotsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot\",\"service_tags\":[\"serviceTags\"],\"size\":1,\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"user_tags\":[\"userTags\"]}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot\",\"service_tags\":[\"serviceTags\"],\"size\":1,\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"user_tags\":[\"userTags\"]}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListSnapshotsOptions listSnapshotsOptions = new ListSnapshotsOptions.Builder() + .limit(Long.valueOf("10")) + .tag("testString") + .resourceGroupId("testString") + .name("testString") + .sourceVolumeId("testString") + .sourceVolumeCrn("testString") + .sourceImageId("testString") + .sourceImageCrn("testString") + .sort("name") + .backupPolicyPlanId("testString") + .build(); + + SnapshotsPager pager = new SnapshotsPager(vpcService, listSnapshotsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createSnapshot operation with a valid options model parameter @Test public void testCreateSnapshotWOptions() throws Throwable { @@ -12112,7 +14151,7 @@ public void testCreateSnapshotWOptions() throws Throwable { SnapshotPrototypeSnapshotBySourceVolume snapshotPrototypeModel = new SnapshotPrototypeSnapshotBySourceVolume.Builder() .name("my-snapshot") .resourceGroup(resourceGroupIdentityModel) - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .userTags(java.util.Arrays.asList("testString")) .sourceVolume(volumeIdentityModel) .build(); @@ -12278,7 +14317,7 @@ public void testUpdateSnapshotWOptions() throws Throwable { // Construct an instance of the SnapshotPatch model SnapshotPatch snapshotPatchModel = new SnapshotPatch.Builder() .name("my-snapshot") - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .userTags(java.util.Arrays.asList("testString")) .build(); Map snapshotPatchModelAsPatch = snapshotPatchModel.asPatch(); @@ -12544,7 +14583,7 @@ public void testListPublicGatewaysWOptions() throws Throwable { // Construct an instance of the ListPublicGatewaysOptions model ListPublicGatewaysOptions listPublicGatewaysOptionsModel = new ListPublicGatewaysOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .build(); @@ -12567,7 +14606,7 @@ public void testListPublicGatewaysWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); } @@ -12581,6 +14620,70 @@ public void testListPublicGatewaysWRetries() throws Throwable { testListPublicGatewaysWOptions(); } + // Test the listPublicGateways operation using the PublicGatewaysPager.getNext() method + @Test + public void testListPublicGatewaysWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"public_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"floating_ip\":{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"name\":\"my-floating-ip\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_gateway\",\"status\":\"available\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"public_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"floating_ip\":{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"name\":\"my-floating-ip\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_gateway\",\"status\":\"available\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListPublicGatewaysOptions listPublicGatewaysOptions = new ListPublicGatewaysOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); + + List allResults = new ArrayList<>(); + PublicGatewaysPager pager = new PublicGatewaysPager(vpcService, listPublicGatewaysOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listPublicGateways operation using the PublicGatewaysPager.getAll() method + @Test + public void testListPublicGatewaysWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"public_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"floating_ip\":{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"name\":\"my-floating-ip\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_gateway\",\"status\":\"available\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"public_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"floating_ip\":{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"name\":\"my-floating-ip\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_gateway\",\"status\":\"available\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListPublicGatewaysOptions listPublicGatewaysOptions = new ListPublicGatewaysOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); + + PublicGatewaysPager pager = new PublicGatewaysPager(vpcService, listPublicGatewaysOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createPublicGateway operation with a valid options model parameter @Test public void testCreatePublicGatewayWOptions() throws Throwable { @@ -12837,7 +14940,7 @@ public void testListFloatingIpsWOptions() throws Throwable { // Construct an instance of the ListFloatingIpsOptions model ListFloatingIpsOptions listFloatingIpsOptionsModel = new ListFloatingIpsOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .sort("name") .build(); @@ -12861,7 +14964,7 @@ public void testListFloatingIpsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("sort"), "name"); } @@ -12876,6 +14979,72 @@ public void testListFloatingIpsWRetries() throws Throwable { testListFloatingIpsWOptions(); } + // Test the listFloatingIps operation using the FloatingIpsPager.getNext() method + @Test + public void testListFloatingIpsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"name\":\"my-floating-ip\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"available\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"name\":\"my-floating-ip\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"available\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListFloatingIpsOptions listFloatingIpsOptions = new ListFloatingIpsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .build(); + + List allResults = new ArrayList<>(); + FloatingIpsPager pager = new FloatingIpsPager(vpcService, listFloatingIpsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listFloatingIps operation using the FloatingIpsPager.getAll() method + @Test + public void testListFloatingIpsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"name\":\"my-floating-ip\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"available\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"name\":\"my-floating-ip\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"available\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListFloatingIpsOptions listFloatingIpsOptions = new ListFloatingIpsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .build(); + + FloatingIpsPager pager = new FloatingIpsPager(vpcService, listFloatingIpsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createFloatingIp operation with a valid options model parameter @Test public void testCreateFloatingIpWOptions() throws Throwable { @@ -13121,7 +15290,7 @@ public void testUpdateFloatingIpNoOptions() throws Throwable { @Test public void testListNetworkAclsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20\"}, \"limit\": 20, \"network_acls\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-2\", \"source\": \"192.168.3.0/24\", \"code\": 0, \"protocol\": \"icmp\", \"type\": 8}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}], \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20\"}, \"limit\": 20, \"network_acls\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-1\", \"source\": \"192.168.3.0/24\", \"destination_port_max\": 22, \"destination_port_min\": 22, \"protocol\": \"udp\", \"source_port_max\": 65535, \"source_port_min\": 49152}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}], \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; String listNetworkAclsPath = "/network_acls"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -13131,7 +15300,7 @@ public void testListNetworkAclsWOptions() throws Throwable { // Construct an instance of the ListNetworkAclsOptions model ListNetworkAclsOptions listNetworkAclsOptionsModel = new ListNetworkAclsOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .build(); @@ -13154,7 +15323,7 @@ public void testListNetworkAclsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); } @@ -13168,11 +15337,75 @@ public void testListNetworkAclsWRetries() throws Throwable { testListNetworkAclsWOptions(); } + // Test the listNetworkAcls operation using the NetworkAclsPager.getNext() method + @Test + public void testListNetworkAclsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"network_acls\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-rule-1\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-rule-1\",\"source\":\"192.168.3.0/24\",\"destination_port_max\":22,\"destination_port_min\":22,\"protocol\":\"udp\",\"source_port_max\":65535,\"source_port_min\":49152}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"network_acls\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-rule-1\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-rule-1\",\"source\":\"192.168.3.0/24\",\"destination_port_max\":22,\"destination_port_min\":22,\"protocol\":\"udp\",\"source_port_max\":65535,\"source_port_min\":49152}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListNetworkAclsOptions listNetworkAclsOptions = new ListNetworkAclsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); + + List allResults = new ArrayList<>(); + NetworkAclsPager pager = new NetworkAclsPager(vpcService, listNetworkAclsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listNetworkAcls operation using the NetworkAclsPager.getAll() method + @Test + public void testListNetworkAclsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"network_acls\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-rule-1\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-rule-1\",\"source\":\"192.168.3.0/24\",\"destination_port_max\":22,\"destination_port_min\":22,\"protocol\":\"udp\",\"source_port_max\":65535,\"source_port_min\":49152}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"network_acls\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-rule-1\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-rule-1\",\"source\":\"192.168.3.0/24\",\"destination_port_max\":22,\"destination_port_min\":22,\"protocol\":\"udp\",\"source_port_max\":65535,\"source_port_min\":49152}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListNetworkAclsOptions listNetworkAclsOptions = new ListNetworkAclsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); + + NetworkAclsPager pager = new NetworkAclsPager(vpcService, listNetworkAclsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createNetworkAcl operation with a valid options model parameter @Test public void testCreateNetworkAclWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-2\", \"source\": \"192.168.3.0/24\", \"code\": 0, \"protocol\": \"icmp\", \"type\": 8}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-1\", \"source\": \"192.168.3.0/24\", \"destination_port_max\": 22, \"destination_port_min\": 22, \"protocol\": \"udp\", \"source_port_max\": 65535, \"source_port_min\": 49152}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; String createNetworkAclPath = "/network_acls"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -13189,8 +15422,8 @@ public void testCreateNetworkAclWOptions() throws Throwable { .id("f0aae929-7047-46d1-92e1-9102b07a7f6f") .build(); - // Construct an instance of the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP model - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP.Builder() + // Construct an instance of the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.Builder() .action("allow") .destination("192.168.3.2/32") .direction("inbound") @@ -13208,7 +15441,7 @@ public void testCreateNetworkAclWOptions() throws Throwable { .name("my-network-acl") .resourceGroup(resourceGroupIdentityModel) .vpc(vpcIdentityModel) - .rules(new java.util.ArrayList(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel))) + .rules(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel)) .build(); // Construct an instance of the CreateNetworkAclOptions model @@ -13302,7 +15535,7 @@ public void testDeleteNetworkAclNoOptions() throws Throwable { @Test public void testGetNetworkAclWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-2\", \"source\": \"192.168.3.0/24\", \"code\": 0, \"protocol\": \"icmp\", \"type\": 8}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-1\", \"source\": \"192.168.3.0/24\", \"destination_port_max\": 22, \"destination_port_min\": 22, \"protocol\": \"udp\", \"source_port_max\": 65535, \"source_port_min\": 49152}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; String getNetworkAclPath = "/network_acls/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -13355,7 +15588,7 @@ public void testGetNetworkAclNoOptions() throws Throwable { @Test public void testUpdateNetworkAclWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-2\", \"source\": \"192.168.3.0/24\", \"code\": 0, \"protocol\": \"icmp\", \"type\": 8}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-1\", \"source\": \"192.168.3.0/24\", \"destination_port_max\": 22, \"destination_port_min\": 22, \"protocol\": \"udp\", \"source_port_max\": 65535, \"source_port_min\": 49152}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; String updateNetworkAclPath = "/network_acls/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -13415,7 +15648,7 @@ public void testUpdateNetworkAclNoOptions() throws Throwable { @Test public void testListNetworkAclRulesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-2\", \"source\": \"192.168.3.0/24\", \"code\": 0, \"protocol\": \"icmp\", \"type\": 8}], \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-1\", \"source\": \"192.168.3.0/24\", \"destination_port_max\": 22, \"destination_port_min\": 22, \"protocol\": \"udp\", \"source_port_max\": 65535, \"source_port_min\": 49152}], \"total_count\": 132}"; String listNetworkAclRulesPath = "/network_acls/testString/rules"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -13426,7 +15659,7 @@ public void testListNetworkAclRulesWOptions() throws Throwable { ListNetworkAclRulesOptions listNetworkAclRulesOptionsModel = new ListNetworkAclRulesOptions.Builder() .networkAclId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .direction("inbound") .build(); @@ -13449,32 +15682,98 @@ public void testListNetworkAclRulesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("direction"), "inbound"); } - // Test the listNetworkAclRules operation with and without retries enabled + // Test the listNetworkAclRules operation with and without retries enabled + @Test + public void testListNetworkAclRulesWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListNetworkAclRulesWOptions(); + + vpcService.disableRetries(); + testListNetworkAclRulesWOptions(); + } + + // Test the listNetworkAclRules operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListNetworkAclRulesNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listNetworkAclRules(null).execute(); + } + + // Test the listNetworkAclRules operation using the NetworkAclRulesPager.getNext() method + @Test + public void testListNetworkAclRulesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-rule-1\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-rule-1\",\"source\":\"192.168.3.0/24\",\"destination_port_max\":22,\"destination_port_min\":22,\"protocol\":\"udp\",\"source_port_max\":65535,\"source_port_min\":49152}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-rule-1\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-rule-1\",\"source\":\"192.168.3.0/24\",\"destination_port_max\":22,\"destination_port_min\":22,\"protocol\":\"udp\",\"source_port_max\":65535,\"source_port_min\":49152}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListNetworkAclRulesOptions listNetworkAclRulesOptions = new ListNetworkAclRulesOptions.Builder() + .networkAclId("testString") + .limit(Long.valueOf("10")) + .direction("inbound") + .build(); + + List allResults = new ArrayList<>(); + NetworkAclRulesPager pager = new NetworkAclRulesPager(vpcService, listNetworkAclRulesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listNetworkAclRules operation using the NetworkAclRulesPager.getAll() method @Test - public void testListNetworkAclRulesWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testListNetworkAclRulesWOptions(); + public void testListNetworkAclRulesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-rule-1\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-rule-1\",\"source\":\"192.168.3.0/24\",\"destination_port_max\":22,\"destination_port_min\":22,\"protocol\":\"udp\",\"source_port_max\":65535,\"source_port_min\":49152}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-rule-1\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-rule-1\",\"source\":\"192.168.3.0/24\",\"destination_port_max\":22,\"destination_port_min\":22,\"protocol\":\"udp\",\"source_port_max\":65535,\"source_port_min\":49152}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - vpcService.disableRetries(); - testListNetworkAclRulesWOptions(); - } + ListNetworkAclRulesOptions listNetworkAclRulesOptions = new ListNetworkAclRulesOptions.Builder() + .networkAclId("testString") + .limit(Long.valueOf("10")) + .direction("inbound") + .build(); - // Test the listNetworkAclRules operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListNetworkAclRulesNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listNetworkAclRules(null).execute(); + NetworkAclRulesPager pager = new NetworkAclRulesPager(vpcService, listNetworkAclRulesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); } - + // Test the createNetworkAclRule operation with a valid options model parameter @Test public void testCreateNetworkAclRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-2\", \"source\": \"192.168.3.0/24\", \"code\": 0, \"protocol\": \"icmp\", \"type\": 8}"; + String mockResponseBody = "{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-1\", \"source\": \"192.168.3.0/24\", \"destination_port_max\": 22, \"destination_port_min\": 22, \"protocol\": \"udp\", \"source_port_max\": 65535, \"source_port_min\": 49152}"; String createNetworkAclRulePath = "/network_acls/testString/rules"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -13486,17 +15785,19 @@ public void testCreateNetworkAclRuleWOptions() throws Throwable { .id("8daca77a-4980-4d33-8f3e-7038797be8f9") .build(); - // Construct an instance of the NetworkACLRulePrototypeNetworkACLRuleProtocolICMP model - NetworkACLRulePrototypeNetworkACLRuleProtocolICMP networkAclRulePrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolICMP.Builder() + // Construct an instance of the NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model + NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype networkAclRulePrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.Builder() .action("allow") .before(networkAclRuleBeforePrototypeModel) .destination("192.168.3.2/32") .direction("inbound") .name("my-rule-2") .source("192.168.3.2/32") - .code(Long.valueOf("0")) - .protocol("icmp") - .type(Long.valueOf("8")) + .destinationPortMax(Long.valueOf("22")) + .destinationPortMin(Long.valueOf("22")) + .protocol("udp") + .sourcePortMax(Long.valueOf("65535")) + .sourcePortMin(Long.valueOf("49152")) .build(); // Construct an instance of the CreateNetworkAclRuleOptions model @@ -13599,7 +15900,7 @@ public void testDeleteNetworkAclRuleNoOptions() throws Throwable { @Test public void testGetNetworkAclRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-2\", \"source\": \"192.168.3.0/24\", \"code\": 0, \"protocol\": \"icmp\", \"type\": 8}"; + String mockResponseBody = "{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-1\", \"source\": \"192.168.3.0/24\", \"destination_port_max\": 22, \"destination_port_min\": 22, \"protocol\": \"udp\", \"source_port_max\": 65535, \"source_port_min\": 49152}"; String getNetworkAclRulePath = "/network_acls/testString/rules/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -13653,7 +15954,7 @@ public void testGetNetworkAclRuleNoOptions() throws Throwable { @Test public void testUpdateNetworkAclRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-2\", \"source\": \"192.168.3.0/24\", \"code\": 0, \"protocol\": \"icmp\", \"type\": 8}"; + String mockResponseBody = "{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-rule-1\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-rule-1\", \"source\": \"192.168.3.0/24\", \"destination_port_max\": 22, \"destination_port_min\": 22, \"protocol\": \"udp\", \"source_port_max\": 65535, \"source_port_min\": 49152}"; String updateNetworkAclRulePath = "/network_acls/testString/rules/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -13674,7 +15975,8 @@ public void testUpdateNetworkAclRuleWOptions() throws Throwable { .destinationPortMax(Long.valueOf("22")) .destinationPortMin(Long.valueOf("22")) .direction("inbound") - .name("my-rule-2") + .name("my-rule-1") + .protocol("tcp") .source("192.168.3.2/32") .sourcePortMax(Long.valueOf("65535")) .sourcePortMin(Long.valueOf("49152")) @@ -13740,7 +16042,7 @@ public void testListSecurityGroupsWOptions() throws Throwable { // Construct an instance of the ListSecurityGroupsOptions model ListSecurityGroupsOptions listSecurityGroupsOptionsModel = new ListSecurityGroupsOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .vpcId("testString") .vpcCrn("testString") @@ -13766,7 +16068,7 @@ public void testListSecurityGroupsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("vpc.id"), "testString"); assertEquals(query.get("vpc.crn"), "testString"); @@ -13783,6 +16085,76 @@ public void testListSecurityGroupsWRetries() throws Throwable { testListSecurityGroupsWOptions(); } + // Test the listSecurityGroups operation using the SecurityGroupsPager.getNext() method + @Test + public void testListSecurityGroupsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"security_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"id\":\"6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"ip_version\":\"ipv4\",\"remote\":{\"address\":\"192.168.3.4\"},\"protocol\":\"all\"}],\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"resource_type\":\"network_interface\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"security_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"id\":\"6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"ip_version\":\"ipv4\",\"remote\":{\"address\":\"192.168.3.4\"},\"protocol\":\"all\"}],\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"resource_type\":\"network_interface\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListSecurityGroupsOptions listSecurityGroupsOptions = new ListSecurityGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .build(); + + List allResults = new ArrayList<>(); + SecurityGroupsPager pager = new SecurityGroupsPager(vpcService, listSecurityGroupsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listSecurityGroups operation using the SecurityGroupsPager.getAll() method + @Test + public void testListSecurityGroupsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"security_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"id\":\"6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"ip_version\":\"ipv4\",\"remote\":{\"address\":\"192.168.3.4\"},\"protocol\":\"all\"}],\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"resource_type\":\"network_interface\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"security_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"id\":\"6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"ip_version\":\"ipv4\",\"remote\":{\"address\":\"192.168.3.4\"},\"protocol\":\"all\"}],\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"resource_type\":\"network_interface\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListSecurityGroupsOptions listSecurityGroupsOptions = new ListSecurityGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .build(); + + SecurityGroupsPager pager = new SecurityGroupsPager(vpcService, listSecurityGroupsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createSecurityGroup operation with a valid options model parameter @Test public void testCreateSecurityGroupWOptions() throws Throwable { @@ -13809,14 +16181,12 @@ public void testCreateSecurityGroupWOptions() throws Throwable { .address("192.168.3.4") .build(); - // Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model - SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.Builder() - .code(Long.valueOf("0")) + // Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder() .direction("inbound") .ipVersion("ipv4") - .protocol("icmp") + .protocol("all") .remote(securityGroupRuleRemotePrototypeModel) - .type(Long.valueOf("8")) .build(); // Construct an instance of the CreateSecurityGroupOptions model @@ -13824,7 +16194,7 @@ public void testCreateSecurityGroupWOptions() throws Throwable { .vpc(vpcIdentityModel) .name("my-security-group") .resourceGroup(resourceGroupIdentityModel) - .rules(new java.util.ArrayList(java.util.Arrays.asList(securityGroupRulePrototypeModel))) + .rules(java.util.Arrays.asList(securityGroupRulePrototypeModel)) .build(); // Invoke createSecurityGroup() with a valid options model and verify the result @@ -14098,14 +16468,12 @@ public void testCreateSecurityGroupRuleWOptions() throws Throwable { .address("192.168.3.4") .build(); - // Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model - SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.Builder() - .code(Long.valueOf("0")) + // Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder() .direction("inbound") .ipVersion("ipv4") - .protocol("icmp") + .protocol("all") .remote(securityGroupRuleRemotePrototypeModel) - .type(Long.valueOf("8")) .build(); // Construct an instance of the CreateSecurityGroupRuleOptions model @@ -14345,7 +16713,7 @@ public void testListSecurityGroupTargetsWOptions() throws Throwable { ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptionsModel = new ListSecurityGroupTargetsOptions.Builder() .securityGroupId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listSecurityGroupTargets() with a valid options model and verify the result @@ -14367,7 +16735,7 @@ public void testListSecurityGroupTargetsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listSecurityGroupTargets operation with and without retries enabled @@ -14387,6 +16755,70 @@ public void testListSecurityGroupTargetsNoOptions() throws Throwable { vpcService.listSecurityGroupTargets(null).execute(); } + // Test the listSecurityGroupTargets operation using the SecurityGroupTargetsPager.getNext() method + @Test + public void testListSecurityGroupTargetsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"resource_type\":\"network_interface\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"resource_type\":\"network_interface\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptions = new ListSecurityGroupTargetsOptions.Builder() + .securityGroupId("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + SecurityGroupTargetsPager pager = new SecurityGroupTargetsPager(vpcService, listSecurityGroupTargetsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listSecurityGroupTargets operation using the SecurityGroupTargetsPager.getAll() method + @Test + public void testListSecurityGroupTargetsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"resource_type\":\"network_interface\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"resource_type\":\"network_interface\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptions = new ListSecurityGroupTargetsOptions.Builder() + .securityGroupId("testString") + .limit(Long.valueOf("10")) + .build(); + + SecurityGroupTargetsPager pager = new SecurityGroupTargetsPager(vpcService, listSecurityGroupTargetsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the deleteSecurityGroupTargetBinding operation with a valid options model parameter @Test public void testDeleteSecurityGroupTargetBindingWOptions() throws Throwable { @@ -14562,7 +16994,7 @@ public void testListIkePoliciesWOptions() throws Throwable { // Construct an instance of the ListIkePoliciesOptions model ListIkePoliciesOptions listIkePoliciesOptionsModel = new ListIkePoliciesOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listIkePolicies() with a valid options model and verify the result @@ -14584,7 +17016,7 @@ public void testListIkePoliciesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listIkePolicies operation with and without retries enabled @@ -14597,6 +17029,68 @@ public void testListIkePoliciesWRetries() throws Throwable { testListIkePoliciesWOptions(); } + // Test the listIkePolicies operation using the IkePoliciesPager.getNext() method + @Test + public void testListIkePoliciesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"ike_policies\":[{\"authentication_algorithm\":\"md5\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dh_group\":14,\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"ike_version\":1,\"key_lifetime\":28800,\"name\":\"my-ike-policy\",\"negotiation_mode\":\"main\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ike_policy\"}],\"limit\":1}"; + String mockResponsePage2 = "{\"total_count\":2,\"ike_policies\":[{\"authentication_algorithm\":\"md5\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dh_group\":14,\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"ike_version\":1,\"key_lifetime\":28800,\"name\":\"my-ike-policy\",\"negotiation_mode\":\"main\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ike_policy\"}],\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListIkePoliciesOptions listIkePoliciesOptions = new ListIkePoliciesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + IkePoliciesPager pager = new IkePoliciesPager(vpcService, listIkePoliciesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listIkePolicies operation using the IkePoliciesPager.getAll() method + @Test + public void testListIkePoliciesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"ike_policies\":[{\"authentication_algorithm\":\"md5\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dh_group\":14,\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"ike_version\":1,\"key_lifetime\":28800,\"name\":\"my-ike-policy\",\"negotiation_mode\":\"main\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ike_policy\"}],\"limit\":1}"; + String mockResponsePage2 = "{\"total_count\":2,\"ike_policies\":[{\"authentication_algorithm\":\"md5\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dh_group\":14,\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"ike_version\":1,\"key_lifetime\":28800,\"name\":\"my-ike-policy\",\"negotiation_mode\":\"main\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ike_policy\"}],\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListIkePoliciesOptions listIkePoliciesOptions = new ListIkePoliciesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + IkePoliciesPager pager = new IkePoliciesPager(vpcService, listIkePoliciesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createIkePolicy operation with a valid options model parameter @Test public void testCreateIkePolicyWOptions() throws Throwable { @@ -14888,7 +17382,7 @@ public void testListIkePolicyConnectionsNoOptions() throws Throwable { @Test public void testListIpsecPoliciesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20\"}, \"ipsec_policies\": [{\"authentication_algorithm\": \"md5\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}], \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20\"}, \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20\"}, \"ipsec_policies\": [{\"authentication_algorithm\": \"disabled\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}], \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20\"}, \"total_count\": 132}"; String listIpsecPoliciesPath = "/ipsec_policies"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -14898,7 +17392,7 @@ public void testListIpsecPoliciesWOptions() throws Throwable { // Construct an instance of the ListIpsecPoliciesOptions model ListIpsecPoliciesOptions listIpsecPoliciesOptionsModel = new ListIpsecPoliciesOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listIpsecPolicies() with a valid options model and verify the result @@ -14920,7 +17414,7 @@ public void testListIpsecPoliciesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listIpsecPolicies operation with and without retries enabled @@ -14933,11 +17427,73 @@ public void testListIpsecPoliciesWRetries() throws Throwable { testListIpsecPoliciesWOptions(); } + // Test the listIpsecPolicies operation using the IpsecPoliciesPager.getNext() method + @Test + public void testListIpsecPoliciesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"ipsec_policies\":[{\"authentication_algorithm\":\"disabled\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"encapsulation_mode\":\"tunnel\",\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"key_lifetime\":3600,\"name\":\"my-ipsec-policy\",\"pfs\":\"disabled\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ipsec_policy\",\"transform_protocol\":\"esp\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"ipsec_policies\":[{\"authentication_algorithm\":\"disabled\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"encapsulation_mode\":\"tunnel\",\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"key_lifetime\":3600,\"name\":\"my-ipsec-policy\",\"pfs\":\"disabled\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ipsec_policy\",\"transform_protocol\":\"esp\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListIpsecPoliciesOptions listIpsecPoliciesOptions = new ListIpsecPoliciesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + IpsecPoliciesPager pager = new IpsecPoliciesPager(vpcService, listIpsecPoliciesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listIpsecPolicies operation using the IpsecPoliciesPager.getAll() method + @Test + public void testListIpsecPoliciesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"ipsec_policies\":[{\"authentication_algorithm\":\"disabled\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"encapsulation_mode\":\"tunnel\",\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"key_lifetime\":3600,\"name\":\"my-ipsec-policy\",\"pfs\":\"disabled\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ipsec_policy\",\"transform_protocol\":\"esp\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"ipsec_policies\":[{\"authentication_algorithm\":\"disabled\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"encapsulation_mode\":\"tunnel\",\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"key_lifetime\":3600,\"name\":\"my-ipsec-policy\",\"pfs\":\"disabled\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ipsec_policy\",\"transform_protocol\":\"esp\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListIpsecPoliciesOptions listIpsecPoliciesOptions = new ListIpsecPoliciesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + IpsecPoliciesPager pager = new IpsecPoliciesPager(vpcService, listIpsecPoliciesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createIpsecPolicy operation with a valid options model parameter @Test public void testCreateIpsecPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"authentication_algorithm\": \"md5\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}"; + String mockResponseBody = "{\"authentication_algorithm\": \"disabled\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}"; String createIpsecPolicyPath = "/ipsec_policies"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -14951,7 +17507,7 @@ public void testCreateIpsecPolicyWOptions() throws Throwable { // Construct an instance of the CreateIpsecPolicyOptions model CreateIpsecPolicyOptions createIpsecPolicyOptionsModel = new CreateIpsecPolicyOptions.Builder() - .authenticationAlgorithm("md5") + .authenticationAlgorithm("disabled") .encryptionAlgorithm("aes128") .pfs("disabled") .keyLifetime(Long.valueOf("3600")) @@ -15052,7 +17608,7 @@ public void testDeleteIpsecPolicyNoOptions() throws Throwable { @Test public void testGetIpsecPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"authentication_algorithm\": \"md5\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}"; + String mockResponseBody = "{\"authentication_algorithm\": \"disabled\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}"; String getIpsecPolicyPath = "/ipsec_policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -15105,7 +17661,7 @@ public void testGetIpsecPolicyNoOptions() throws Throwable { @Test public void testUpdateIpsecPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"authentication_algorithm\": \"md5\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}"; + String mockResponseBody = "{\"authentication_algorithm\": \"disabled\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}"; String updateIpsecPolicyPath = "/ipsec_policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -15114,7 +17670,7 @@ public void testUpdateIpsecPolicyWOptions() throws Throwable { // Construct an instance of the IPsecPolicyPatch model IPsecPolicyPatch iPsecPolicyPatchModel = new IPsecPolicyPatch.Builder() - .authenticationAlgorithm("md5") + .authenticationAlgorithm("disabled") .encryptionAlgorithm("aes128") .keyLifetime(Long.valueOf("3600")) .name("my-ipsec-policy") @@ -15222,7 +17778,7 @@ public void testListIpsecPolicyConnectionsNoOptions() throws Throwable { @Test public void testListVpnGatewaysWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20\"}, \"total_count\": 132, \"vpn_gateways\": [{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"private_ip\": {\"address\": \"192.168.3.4\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"mode\": \"route\"}]}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20\"}, \"total_count\": 132, \"vpn_gateways\": [{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"private_ip\": {\"address\": \"192.168.3.4\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"route\"}]}"; String listVpnGatewaysPath = "/vpn_gateways"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -15232,8 +17788,9 @@ public void testListVpnGatewaysWOptions() throws Throwable { // Construct an instance of the ListVpnGatewaysOptions model ListVpnGatewaysOptions listVpnGatewaysOptionsModel = new ListVpnGatewaysOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") + .sort("name") .mode("route") .build(); @@ -15256,8 +17813,9 @@ public void testListVpnGatewaysWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("sort"), "name"); assertEquals(query.get("mode"), "route"); } @@ -15271,11 +17829,79 @@ public void testListVpnGatewaysWRetries() throws Throwable { testListVpnGatewaysWOptions(); } + // Test the listVpnGateways operation using the VpnGatewaysPager.getNext() method + @Test + public void testListVpnGatewaysWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"vpn_gateways\":[{\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"members\":[{\"private_ip\":{\"address\":\"192.168.3.4\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\",\"status\":\"available\"}],\"name\":\"my-vpn-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_gateway\",\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"route\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"vpn_gateways\":[{\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"members\":[{\"private_ip\":{\"address\":\"192.168.3.4\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\",\"status\":\"available\"}],\"name\":\"my-vpn-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_gateway\",\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"route\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpnGatewaysOptions listVpnGatewaysOptions = new ListVpnGatewaysOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .mode("route") + .build(); + + List allResults = new ArrayList<>(); + VpnGatewaysPager pager = new VpnGatewaysPager(vpcService, listVpnGatewaysOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listVpnGateways operation using the VpnGatewaysPager.getAll() method + @Test + public void testListVpnGatewaysWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"vpn_gateways\":[{\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"members\":[{\"private_ip\":{\"address\":\"192.168.3.4\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\",\"status\":\"available\"}],\"name\":\"my-vpn-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_gateway\",\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"route\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"vpn_gateways\":[{\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"members\":[{\"private_ip\":{\"address\":\"192.168.3.4\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\",\"status\":\"available\"}],\"name\":\"my-vpn-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_gateway\",\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"route\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpnGatewaysOptions listVpnGatewaysOptions = new ListVpnGatewaysOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .mode("route") + .build(); + + VpnGatewaysPager pager = new VpnGatewaysPager(vpcService, listVpnGatewaysOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createVpnGateway operation with a valid options model parameter @Test public void testCreateVpnGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"private_ip\": {\"address\": \"192.168.3.4\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"mode\": \"route\"}"; + String mockResponseBody = "{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"private_ip\": {\"address\": \"192.168.3.4\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"route\"}"; String createVpnGatewayPath = "/vpn_gateways"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -15398,7 +18024,7 @@ public void testDeleteVpnGatewayNoOptions() throws Throwable { @Test public void testGetVpnGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"private_ip\": {\"address\": \"192.168.3.4\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"mode\": \"route\"}"; + String mockResponseBody = "{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"private_ip\": {\"address\": \"192.168.3.4\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"route\"}"; String getVpnGatewayPath = "/vpn_gateways/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -15451,7 +18077,7 @@ public void testGetVpnGatewayNoOptions() throws Throwable { @Test public void testUpdateVpnGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"private_ip\": {\"address\": \"192.168.3.4\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"mode\": \"route\"}"; + String mockResponseBody = "{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"private_ip\": {\"address\": \"192.168.3.4\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"route\"}"; String updateVpnGatewayPath = "/vpn_gateways/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -16290,7 +18916,7 @@ public void testListVpnServersWOptions() throws Throwable { ListVpnServersOptions listVpnServersOptionsModel = new ListVpnServersOptions.Builder() .name("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .sort("name") .build(); @@ -16315,7 +18941,7 @@ public void testListVpnServersWOptions() throws Throwable { assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("name"), "testString"); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("sort"), "name"); } @@ -16330,6 +18956,74 @@ public void testListVpnServersWRetries() throws Throwable { testListVpnServersWOptions(); } + // Test the listVpnServers operation using the VpnServersPager.getNext() method + @Test + public void testListVpnServersWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"vpn_servers\":[{\"certificate\":{\"crn\":\"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"},\"client_authentication\":[{\"method\":\"certificate\",\"identity_provider\":{\"provider_type\":\"iam\"}}],\"client_auto_delete\":true,\"client_auto_delete_timeout\":1,\"client_dns_server_ips\":[{\"address\":\"192.168.3.4\"}],\"client_idle_timeout\":600,\"client_ip_pool\":\"172.16.0.0/16\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"enable_split_tunneling\":true,\"health_state\":\"ok\",\"hostname\":\"a8506291.us-south.vpn-server.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-server\",\"port\":443,\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"protocol\":\"udp\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_server\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"vpn_servers\":[{\"certificate\":{\"crn\":\"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"},\"client_authentication\":[{\"method\":\"certificate\",\"identity_provider\":{\"provider_type\":\"iam\"}}],\"client_auto_delete\":true,\"client_auto_delete_timeout\":1,\"client_dns_server_ips\":[{\"address\":\"192.168.3.4\"}],\"client_idle_timeout\":600,\"client_ip_pool\":\"172.16.0.0/16\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"enable_split_tunneling\":true,\"health_state\":\"ok\",\"hostname\":\"a8506291.us-south.vpn-server.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-server\",\"port\":443,\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"protocol\":\"udp\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_server\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpnServersOptions listVpnServersOptions = new ListVpnServersOptions.Builder() + .name("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .build(); + + List allResults = new ArrayList<>(); + VpnServersPager pager = new VpnServersPager(vpcService, listVpnServersOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listVpnServers operation using the VpnServersPager.getAll() method + @Test + public void testListVpnServersWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"vpn_servers\":[{\"certificate\":{\"crn\":\"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"},\"client_authentication\":[{\"method\":\"certificate\",\"identity_provider\":{\"provider_type\":\"iam\"}}],\"client_auto_delete\":true,\"client_auto_delete_timeout\":1,\"client_dns_server_ips\":[{\"address\":\"192.168.3.4\"}],\"client_idle_timeout\":600,\"client_ip_pool\":\"172.16.0.0/16\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"enable_split_tunneling\":true,\"health_state\":\"ok\",\"hostname\":\"a8506291.us-south.vpn-server.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-server\",\"port\":443,\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"protocol\":\"udp\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_server\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"vpn_servers\":[{\"certificate\":{\"crn\":\"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"},\"client_authentication\":[{\"method\":\"certificate\",\"identity_provider\":{\"provider_type\":\"iam\"}}],\"client_auto_delete\":true,\"client_auto_delete_timeout\":1,\"client_dns_server_ips\":[{\"address\":\"192.168.3.4\"}],\"client_idle_timeout\":600,\"client_ip_pool\":\"172.16.0.0/16\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"enable_split_tunneling\":true,\"health_state\":\"ok\",\"hostname\":\"a8506291.us-south.vpn-server.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-server\",\"port\":443,\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"protocol\":\"udp\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_server\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpnServersOptions listVpnServersOptions = new ListVpnServersOptions.Builder() + .name("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .build(); + + VpnServersPager pager = new VpnServersPager(vpcService, listVpnServersOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createVpnServer operation with a valid options model parameter @Test public void testCreateVpnServerWOptions() throws Throwable { @@ -16380,17 +19074,17 @@ public void testCreateVpnServerWOptions() throws Throwable { // Construct an instance of the CreateVpnServerOptions model CreateVpnServerOptions createVpnServerOptionsModel = new CreateVpnServerOptions.Builder() .certificate(certificateInstanceIdentityModel) - .clientAuthentication(new java.util.ArrayList(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel))) + .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) .clientIpPool("172.16.0.0/16") - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) - .clientDnsServerIps(new java.util.ArrayList(java.util.Arrays.asList(ipModel))) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .clientDnsServerIps(java.util.Arrays.asList(ipModel)) .clientIdleTimeout(Long.valueOf("600")) .enableSplitTunneling(false) .name("my-vpn-server") .port(Long.valueOf("443")) .protocol("udp") .resourceGroup(resourceGroupIdentityModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); // Invoke createVpnServer() with a valid options model and verify the result @@ -16576,15 +19270,15 @@ public void testUpdateVpnServerWOptions() throws Throwable { // Construct an instance of the VPNServerPatch model VPNServerPatch vpnServerPatchModel = new VPNServerPatch.Builder() .certificate(certificateInstanceIdentityModel) - .clientAuthentication(new java.util.ArrayList(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel))) - .clientDnsServerIps(new java.util.ArrayList(java.util.Arrays.asList(ipModel))) + .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) + .clientDnsServerIps(java.util.Arrays.asList(ipModel)) .clientIdleTimeout(Long.valueOf("600")) .clientIpPool("172.16.0.0/16") .enableSplitTunneling(true) .name("my-vpn-server") .port(Long.valueOf("443")) .protocol("udp") - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) .build(); Map vpnServerPatchModelAsPatch = vpnServerPatchModel.asPatch(); @@ -16700,7 +19394,7 @@ public void testListVpnServerClientsWOptions() throws Throwable { ListVpnServerClientsOptions listVpnServerClientsOptionsModel = new ListVpnServerClientsOptions.Builder() .vpnServerId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .sort("created_at") .build(); @@ -16723,27 +19417,93 @@ public void testListVpnServerClientsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("sort"), "created_at"); } - // Test the listVpnServerClients operation with and without retries enabled - @Test - public void testListVpnServerClientsWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testListVpnServerClientsWOptions(); + // Test the listVpnServerClients operation with and without retries enabled + @Test + public void testListVpnServerClientsWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListVpnServerClientsWOptions(); + + vpcService.disableRetries(); + testListVpnServerClientsWOptions(); + } + + // Test the listVpnServerClients operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListVpnServerClientsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listVpnServerClients(null).execute(); + } + + // Test the listVpnServerClients operation using the VpnServerClientsPager.getNext() method + @Test + public void testListVpnServerClientsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"clients\":[{\"client_ip\":{\"address\":\"192.168.3.4\"},\"common_name\":\"commonName\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"disconnected_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"remote_ip\":{\"address\":\"192.168.3.4\"},\"remote_port\":22,\"resource_type\":\"vpn_server_client\",\"status\":\"connected\",\"username\":\"username\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"clients\":[{\"client_ip\":{\"address\":\"192.168.3.4\"},\"common_name\":\"commonName\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"disconnected_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"remote_ip\":{\"address\":\"192.168.3.4\"},\"remote_port\":22,\"resource_type\":\"vpn_server_client\",\"status\":\"connected\",\"username\":\"username\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpnServerClientsOptions listVpnServerClientsOptions = new ListVpnServerClientsOptions.Builder() + .vpnServerId("testString") + .limit(Long.valueOf("10")) + .sort("created_at") + .build(); - vpcService.disableRetries(); - testListVpnServerClientsWOptions(); + List allResults = new ArrayList<>(); + VpnServerClientsPager pager = new VpnServerClientsPager(vpcService, listVpnServerClientsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } + + // Test the listVpnServerClients operation using the VpnServerClientsPager.getAll() method + @Test + public void testListVpnServerClientsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"clients\":[{\"client_ip\":{\"address\":\"192.168.3.4\"},\"common_name\":\"commonName\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"disconnected_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"remote_ip\":{\"address\":\"192.168.3.4\"},\"remote_port\":22,\"resource_type\":\"vpn_server_client\",\"status\":\"connected\",\"username\":\"username\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"clients\":[{\"client_ip\":{\"address\":\"192.168.3.4\"},\"common_name\":\"commonName\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"disconnected_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"remote_ip\":{\"address\":\"192.168.3.4\"},\"remote_port\":22,\"resource_type\":\"vpn_server_client\",\"status\":\"connected\",\"username\":\"username\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Test the listVpnServerClients operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListVpnServerClientsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listVpnServerClients(null).execute(); - } + ListVpnServerClientsOptions listVpnServerClientsOptions = new ListVpnServerClientsOptions.Builder() + .vpnServerId("testString") + .limit(Long.valueOf("10")) + .sort("created_at") + .build(); + VpnServerClientsPager pager = new VpnServerClientsPager(vpcService, listVpnServerClientsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the deleteVpnServerClient operation with a valid options model parameter @Test public void testDeleteVpnServerClientWOptions() throws Throwable { @@ -16919,7 +19679,7 @@ public void testListVpnServerRoutesWOptions() throws Throwable { ListVpnServerRoutesOptions listVpnServerRoutesOptionsModel = new ListVpnServerRoutesOptions.Builder() .vpnServerId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .sort("name") .build(); @@ -16942,7 +19702,7 @@ public void testListVpnServerRoutesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("sort"), "name"); } @@ -16963,6 +19723,72 @@ public void testListVpnServerRoutesNoOptions() throws Throwable { vpcService.listVpnServerRoutes(null).execute(); } + // Test the listVpnServerRoutes operation using the VpnServerRoutesPager.getNext() method + @Test + public void testListVpnServerRoutesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"deliver\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-route-1\",\"resource_type\":\"vpn_server_route\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routes\":[{\"action\":\"deliver\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-route-1\",\"resource_type\":\"vpn_server_route\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpnServerRoutesOptions listVpnServerRoutesOptions = new ListVpnServerRoutesOptions.Builder() + .vpnServerId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); + + List allResults = new ArrayList<>(); + VpnServerRoutesPager pager = new VpnServerRoutesPager(vpcService, listVpnServerRoutesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listVpnServerRoutes operation using the VpnServerRoutesPager.getAll() method + @Test + public void testListVpnServerRoutesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"deliver\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-route-1\",\"resource_type\":\"vpn_server_route\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routes\":[{\"action\":\"deliver\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-route-1\",\"resource_type\":\"vpn_server_route\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpnServerRoutesOptions listVpnServerRoutesOptions = new ListVpnServerRoutesOptions.Builder() + .vpnServerId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); + + VpnServerRoutesPager pager = new VpnServerRoutesPager(vpcService, listVpnServerRoutesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createVpnServerRoute operation with a valid options model parameter @Test public void testCreateVpnServerRouteWOptions() throws Throwable { @@ -17201,7 +20027,7 @@ public void testListLoadBalancerProfilesWOptions() throws Throwable { // Construct an instance of the ListLoadBalancerProfilesOptions model ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptionsModel = new ListLoadBalancerProfilesOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listLoadBalancerProfiles() with a valid options model and verify the result @@ -17223,7 +20049,7 @@ public void testListLoadBalancerProfilesWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listLoadBalancerProfiles operation with and without retries enabled @@ -17236,6 +20062,68 @@ public void testListLoadBalancerProfilesWRetries() throws Throwable { testListLoadBalancerProfilesWOptions(); } + // Test the listLoadBalancerProfiles operation using the LoadBalancerProfilesPager.getNext() method + @Test + public void testListLoadBalancerProfilesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"network\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"network\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptions = new ListLoadBalancerProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + LoadBalancerProfilesPager pager = new LoadBalancerProfilesPager(vpcService, listLoadBalancerProfilesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listLoadBalancerProfiles operation using the LoadBalancerProfilesPager.getAll() method + @Test + public void testListLoadBalancerProfilesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"network\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"network\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptions = new ListLoadBalancerProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + LoadBalancerProfilesPager pager = new LoadBalancerProfilesPager(vpcService, listLoadBalancerProfilesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the getLoadBalancerProfile operation with a valid options model parameter @Test public void testGetLoadBalancerProfileWOptions() throws Throwable { @@ -17303,7 +20191,7 @@ public void testListLoadBalancersWOptions() throws Throwable { // Construct an instance of the ListLoadBalancersOptions model ListLoadBalancersOptions listLoadBalancersOptionsModel = new ListLoadBalancersOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .build(); // Invoke listLoadBalancers() with a valid options model and verify the result @@ -17325,7 +20213,7 @@ public void testListLoadBalancersWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } // Test the listLoadBalancers operation with and without retries enabled @@ -17338,6 +20226,68 @@ public void testListLoadBalancersWRetries() throws Throwable { testListLoadBalancersWOptions(); } + // Test the listLoadBalancers operation using the LoadBalancersPager.getNext() method + @Test + public void testListLoadBalancersWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"hostname\":\"my-load-balancer-123456-us-south-1.lb.bluemix.net\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"is_public\":true,\"listeners\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"}],\"logging\":{\"datapath\":{\"active\":true}},\"name\":\"my-load-balancer\",\"operating_status\":\"offline\",\"pools\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"}],\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"network\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"},\"provisioning_status\":\"active\",\"public_ips\":[{\"address\":\"192.168.3.4\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"load_balancer\",\"route_mode\":true,\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"hostname\":\"my-load-balancer-123456-us-south-1.lb.bluemix.net\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"is_public\":true,\"listeners\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"}],\"logging\":{\"datapath\":{\"active\":true}},\"name\":\"my-load-balancer\",\"operating_status\":\"offline\",\"pools\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"}],\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"network\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"},\"provisioning_status\":\"active\",\"public_ips\":[{\"address\":\"192.168.3.4\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"load_balancer\",\"route_mode\":true,\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListLoadBalancersOptions listLoadBalancersOptions = new ListLoadBalancersOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + LoadBalancersPager pager = new LoadBalancersPager(vpcService, listLoadBalancersOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listLoadBalancers operation using the LoadBalancersPager.getAll() method + @Test + public void testListLoadBalancersWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"hostname\":\"my-load-balancer-123456-us-south-1.lb.bluemix.net\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"is_public\":true,\"listeners\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"}],\"logging\":{\"datapath\":{\"active\":true}},\"name\":\"my-load-balancer\",\"operating_status\":\"offline\",\"pools\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"}],\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"network\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"},\"provisioning_status\":\"active\",\"public_ips\":[{\"address\":\"192.168.3.4\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"load_balancer\",\"route_mode\":true,\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"hostname\":\"my-load-balancer-123456-us-south-1.lb.bluemix.net\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"is_public\":true,\"listeners\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"}],\"logging\":{\"datapath\":{\"active\":true}},\"name\":\"my-load-balancer\",\"operating_status\":\"offline\",\"pools\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"}],\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"network\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"},\"provisioning_status\":\"active\",\"public_ips\":[{\"address\":\"192.168.3.4\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"load_balancer\",\"route_mode\":true,\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListLoadBalancersOptions listLoadBalancersOptions = new ListLoadBalancersOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + LoadBalancersPager pager = new LoadBalancersPager(vpcService, listLoadBalancersOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createLoadBalancer operation with a valid options model parameter @Test public void testCreateLoadBalancerWOptions() throws Throwable { @@ -17354,16 +20304,35 @@ public void testCreateLoadBalancerWOptions() throws Throwable { .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") .build(); + // Construct an instance of the CertificateInstanceIdentityByCRN model + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") + .build(); + // Construct an instance of the LoadBalancerPoolIdentityByName model LoadBalancerPoolIdentityByName loadBalancerPoolIdentityByNameModel = new LoadBalancerPoolIdentityByName.Builder() .name("my-load-balancer-pool") .build(); + // Construct an instance of the LoadBalancerListenerIdentityById model + LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() + .id("70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + + // Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model + LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototypeModel = new LoadBalancerListenerHTTPSRedirectPrototype.Builder() + .httpStatusCode(Long.valueOf("301")) + .listener(loadBalancerListenerIdentityModel) + .uri("/example?doc=get") + .build(); + // Construct an instance of the LoadBalancerListenerPrototypeLoadBalancerContext model LoadBalancerListenerPrototypeLoadBalancerContext loadBalancerListenerPrototypeLoadBalancerContextModel = new LoadBalancerListenerPrototypeLoadBalancerContext.Builder() .acceptProxyProtocol(true) + .certificateInstance(certificateInstanceIdentityModel) .connectionLimit(Long.valueOf("2000")) .defaultPool(loadBalancerPoolIdentityByNameModel) + .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) .port(Long.valueOf("443")) .portMax(Long.valueOf("499")) .portMin(Long.valueOf("443")) @@ -17412,7 +20381,7 @@ public void testCreateLoadBalancerWOptions() throws Throwable { LoadBalancerPoolPrototype loadBalancerPoolPrototypeModel = new LoadBalancerPoolPrototype.Builder() .algorithm("least_connections") .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) - .members(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))) + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) .name("my-load-balancer-pool") .protocol("http") .proxyProtocol("disabled") @@ -17437,15 +20406,15 @@ public void testCreateLoadBalancerWOptions() throws Throwable { // Construct an instance of the CreateLoadBalancerOptions model CreateLoadBalancerOptions createLoadBalancerOptionsModel = new CreateLoadBalancerOptions.Builder() .isPublic(true) - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) - .listeners(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPrototypeLoadBalancerContextModel))) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .listeners(java.util.Arrays.asList(loadBalancerListenerPrototypeLoadBalancerContextModel)) .logging(loadBalancerLoggingModel) .name("my-load-balancer") - .pools(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolPrototypeModel))) + .pools(java.util.Arrays.asList(loadBalancerPoolPrototypeModel)) .profile(loadBalancerProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) .routeMode(true) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); // Invoke createLoadBalancer() with a valid options model and verify the result @@ -17492,12 +20461,13 @@ public void testDeleteLoadBalancerWOptions() throws Throwable { String mockResponseBody = ""; String deleteLoadBalancerPath = "/load_balancers/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(202) .setBody(mockResponseBody)); // Construct an instance of the DeleteLoadBalancerOptions model DeleteLoadBalancerOptions deleteLoadBalancerOptionsModel = new DeleteLoadBalancerOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke deleteLoadBalancer() with a valid options model and verify the result @@ -17611,10 +20581,16 @@ public void testUpdateLoadBalancerWOptions() throws Throwable { .datapath(loadBalancerLoggingDatapathModel) .build(); + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + // Construct an instance of the LoadBalancerPatch model LoadBalancerPatch loadBalancerPatchModel = new LoadBalancerPatch.Builder() .logging(loadBalancerLoggingModel) .name("my-load-balancer") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) .build(); Map loadBalancerPatchModelAsPatch = loadBalancerPatchModel.asPatch(); @@ -17622,6 +20598,7 @@ public void testUpdateLoadBalancerWOptions() throws Throwable { UpdateLoadBalancerOptions updateLoadBalancerOptionsModel = new UpdateLoadBalancerOptions.Builder() .id("testString") .loadBalancerPatch(loadBalancerPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke updateLoadBalancer() with a valid options model and verify the result @@ -17818,7 +20795,7 @@ public void testCreateLoadBalancerListenerWOptions() throws Throwable { .action("forward") .name("my-policy") .priority(Long.valueOf("5")) - .rules(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel))) + .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) .target(loadBalancerListenerPolicyTargetPrototypeModel) .build(); @@ -17831,7 +20808,7 @@ public void testCreateLoadBalancerListenerWOptions() throws Throwable { .connectionLimit(Long.valueOf("2000")) .defaultPool(loadBalancerPoolIdentityModel) .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) - .policies(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyPrototypeModel))) + .policies(java.util.Arrays.asList(loadBalancerListenerPolicyPrototypeModel)) .port(Long.valueOf("443")) .portMax(Long.valueOf("499")) .portMin(Long.valueOf("443")) @@ -17881,7 +20858,7 @@ public void testDeleteLoadBalancerListenerWOptions() throws Throwable { String mockResponseBody = ""; String deleteLoadBalancerListenerPath = "/load_balancers/testString/listeners/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(202) .setBody(mockResponseBody)); // Construct an instance of the DeleteLoadBalancerListenerOptions model @@ -18157,7 +21134,7 @@ public void testCreateLoadBalancerListenerPolicyWOptions() throws Throwable { .action("forward") .priority(Long.valueOf("5")) .name("my-policy") - .rules(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel))) + .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) .target(loadBalancerListenerPolicyTargetPrototypeModel) .build(); @@ -18205,7 +21182,7 @@ public void testDeleteLoadBalancerListenerPolicyWOptions() throws Throwable { String mockResponseBody = ""; String deleteLoadBalancerListenerPolicyPath = "/load_balancers/testString/listeners/testString/policies/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(202) .setBody(mockResponseBody)); // Construct an instance of the DeleteLoadBalancerListenerPolicyOptions model @@ -18497,7 +21474,7 @@ public void testDeleteLoadBalancerListenerPolicyRuleWOptions() throws Throwable String mockResponseBody = ""; String deleteLoadBalancerListenerPolicyRulePath = "/load_balancers/testString/listeners/testString/policies/testString/rules/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(202) .setBody(mockResponseBody)); // Construct an instance of the DeleteLoadBalancerListenerPolicyRuleOptions model @@ -18765,7 +21742,7 @@ public void testCreateLoadBalancerPoolWOptions() throws Throwable { .algorithm("least_connections") .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) .protocol("http") - .members(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))) + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) .name("my-load-balancer-pool") .proxyProtocol("disabled") .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) @@ -18815,7 +21792,7 @@ public void testDeleteLoadBalancerPoolWOptions() throws Throwable { String mockResponseBody = ""; String deleteLoadBalancerPoolPath = "/load_balancers/testString/pools/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(202) .setBody(mockResponseBody)); // Construct an instance of the DeleteLoadBalancerPoolOptions model @@ -19140,7 +22117,7 @@ public void testReplaceLoadBalancerPoolMembersWOptions() throws Throwable { ReplaceLoadBalancerPoolMembersOptions replaceLoadBalancerPoolMembersOptionsModel = new ReplaceLoadBalancerPoolMembersOptions.Builder() .loadBalancerId("testString") .poolId("testString") - .members(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))) + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) .build(); // Invoke replaceLoadBalancerPoolMembers() with a valid options model and verify the result @@ -19187,7 +22164,7 @@ public void testDeleteLoadBalancerPoolMemberWOptions() throws Throwable { String mockResponseBody = ""; String deleteLoadBalancerPoolMemberPath = "/load_balancers/testString/pools/testString/members/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(202) .setBody(mockResponseBody)); // Construct an instance of the DeleteLoadBalancerPoolMemberOptions model @@ -19373,7 +22350,7 @@ public void testListEndpointGatewaysWOptions() throws Throwable { ListEndpointGatewaysOptions listEndpointGatewaysOptionsModel = new ListEndpointGatewaysOptions.Builder() .name("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .build(); @@ -19397,7 +22374,7 @@ public void testListEndpointGatewaysWOptions() throws Throwable { assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("name"), "testString"); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); } @@ -19411,6 +22388,72 @@ public void testListEndpointGatewaysWRetries() throws Throwable { testListEndpointGatewaysWOptions(); } + // Test the listEndpointGateways operation using the EndpointGatewaysPager.getNext() method + @Test + public void testListEndpointGatewaysWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"endpoint_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-endpoint-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"endpoint_gateway\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"service_endpoint\":\"my-cloudant-instance.appdomain.cloud\",\"service_endpoints\":[\"my-cloudant-instance.appdomain.cloud\"],\"target\":{\"crn\":\"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::\",\"resource_type\":\"provider_cloud_service\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"endpoint_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-endpoint-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"endpoint_gateway\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"service_endpoint\":\"my-cloudant-instance.appdomain.cloud\",\"service_endpoints\":[\"my-cloudant-instance.appdomain.cloud\"],\"target\":{\"crn\":\"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::\",\"resource_type\":\"provider_cloud_service\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListEndpointGatewaysOptions listEndpointGatewaysOptions = new ListEndpointGatewaysOptions.Builder() + .name("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); + + List allResults = new ArrayList<>(); + EndpointGatewaysPager pager = new EndpointGatewaysPager(vpcService, listEndpointGatewaysOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listEndpointGateways operation using the EndpointGatewaysPager.getAll() method + @Test + public void testListEndpointGatewaysWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"endpoint_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-endpoint-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"endpoint_gateway\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"service_endpoint\":\"my-cloudant-instance.appdomain.cloud\",\"service_endpoints\":[\"my-cloudant-instance.appdomain.cloud\"],\"target\":{\"crn\":\"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::\",\"resource_type\":\"provider_cloud_service\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"endpoint_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-endpoint-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"endpoint_gateway\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"service_endpoint\":\"my-cloudant-instance.appdomain.cloud\",\"service_endpoints\":[\"my-cloudant-instance.appdomain.cloud\"],\"target\":{\"crn\":\"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::\",\"resource_type\":\"provider_cloud_service\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListEndpointGatewaysOptions listEndpointGatewaysOptions = new ListEndpointGatewaysOptions.Builder() + .name("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); + + EndpointGatewaysPager pager = new EndpointGatewaysPager(vpcService, listEndpointGatewaysOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createEndpointGateway operation with a valid options model parameter @Test public void testCreateEndpointGatewayWOptions() throws Throwable { @@ -19422,10 +22465,10 @@ public void testCreateEndpointGatewayWOptions() throws Throwable { .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN model - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN endpointGatewayTargetPrototypeModel = new EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.Builder() + // Construct an instance of the EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName model + EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName endpointGatewayTargetPrototypeModel = new EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.Builder() .resourceType("provider_infrastructure_service") - .crn("crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::") + .name("ibm-ntp-server") .build(); // Construct an instance of the VPCIdentityById model @@ -19452,10 +22495,10 @@ public void testCreateEndpointGatewayWOptions() throws Throwable { CreateEndpointGatewayOptions createEndpointGatewayOptionsModel = new CreateEndpointGatewayOptions.Builder() .target(endpointGatewayTargetPrototypeModel) .vpc(vpcIdentityModel) - .ips(new java.util.ArrayList(java.util.Arrays.asList(endpointGatewayReservedIpModel))) + .ips(java.util.Arrays.asList(endpointGatewayReservedIpModel)) .name("testString") .resourceGroup(resourceGroupIdentityModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); // Invoke createEndpointGateway() with a valid options model and verify the result @@ -19510,7 +22553,7 @@ public void testListEndpointGatewayIpsWOptions() throws Throwable { ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptionsModel = new ListEndpointGatewayIpsOptions.Builder() .endpointGatewayId("testString") .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .sort("name") .build(); @@ -19533,7 +22576,7 @@ public void testListEndpointGatewayIpsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("sort"), "name"); } @@ -19554,6 +22597,72 @@ public void testListEndpointGatewayIpsNoOptions() throws Throwable { vpcService.listEndpointGatewayIps(null).execute(); } + // Test the listEndpointGatewayIps operation using the EndpointGatewayIpsPager.getNext() method + @Test + public void testListEndpointGatewayIpsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptions = new ListEndpointGatewayIpsOptions.Builder() + .endpointGatewayId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); + + List allResults = new ArrayList<>(); + EndpointGatewayIpsPager pager = new EndpointGatewayIpsPager(vpcService, listEndpointGatewayIpsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listEndpointGatewayIps operation using the EndpointGatewayIpsPager.getAll() method + @Test + public void testListEndpointGatewayIpsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"id\":\"d7cc5196-9864-48c4-82d8-3f30da41fcc5\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptions = new ListEndpointGatewayIpsOptions.Builder() + .endpointGatewayId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); + + EndpointGatewayIpsPager pager = new EndpointGatewayIpsPager(vpcService, listEndpointGatewayIpsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the removeEndpointGatewayIp operation with a valid options model parameter @Test public void testRemoveEndpointGatewayIpWOptions() throws Throwable { @@ -19894,7 +23003,7 @@ public void testListFlowLogCollectorsWOptions() throws Throwable { // Construct an instance of the ListFlowLogCollectorsOptions model ListFlowLogCollectorsOptions listFlowLogCollectorsOptionsModel = new ListFlowLogCollectorsOptions.Builder() .start("testString") - .limit(Long.valueOf("1")) + .limit(Long.valueOf("10")) .resourceGroupId("testString") .name("testString") .vpcId("testString") @@ -19923,7 +23032,7 @@ public void testListFlowLogCollectorsWOptions() throws Throwable { assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1")); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("name"), "testString"); assertEquals(query.get("vpc.id"), "testString"); @@ -19943,6 +23052,82 @@ public void testListFlowLogCollectorsWRetries() throws Throwable { testListFlowLogCollectorsWOptions(); } + // Test the listFlowLogCollectors operation using the FlowLogCollectorsPager.getNext() method + @Test + public void testListFlowLogCollectorsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"flow_log_collectors\":[{\"active\":true,\"auto_delete\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"lifecycle_state\":\"stable\",\"name\":\"my-flow-log-collector\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"storage_bucket\":{\"name\":\"bucket-27200-lwx4cfvcue\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"resource_type\":\"network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"flow_log_collectors\":[{\"active\":true,\"auto_delete\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"lifecycle_state\":\"stable\",\"name\":\"my-flow-log-collector\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"storage_bucket\":{\"name\":\"bucket-27200-lwx4cfvcue\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"resource_type\":\"network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListFlowLogCollectorsOptions listFlowLogCollectorsOptions = new ListFlowLogCollectorsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .targetId("testString") + .targetResourceType("instance") + .build(); + + List allResults = new ArrayList<>(); + FlowLogCollectorsPager pager = new FlowLogCollectorsPager(vpcService, listFlowLogCollectorsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listFlowLogCollectors operation using the FlowLogCollectorsPager.getAll() method + @Test + public void testListFlowLogCollectorsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"flow_log_collectors\":[{\"active\":true,\"auto_delete\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"lifecycle_state\":\"stable\",\"name\":\"my-flow-log-collector\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"storage_bucket\":{\"name\":\"bucket-27200-lwx4cfvcue\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"resource_type\":\"network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"flow_log_collectors\":[{\"active\":true,\"auto_delete\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689\",\"id\":\"39300233-9995-4806-89a5-3c1b6eb88689\",\"lifecycle_state\":\"stable\",\"name\":\"my-flow-log-collector\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"storage_bucket\":{\"name\":\"bucket-27200-lwx4cfvcue\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-network-interface\",\"resource_type\":\"network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListFlowLogCollectorsOptions listFlowLogCollectorsOptions = new ListFlowLogCollectorsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("testString") + .vpcId("testString") + .vpcCrn("testString") + .vpcName("testString") + .targetId("testString") + .targetResourceType("instance") + .build(); + + FlowLogCollectorsPager pager = new FlowLogCollectorsPager(vpcService, listFlowLogCollectorsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + // Test the createFlowLogCollector operation with a valid options model parameter @Test public void testCreateFlowLogCollectorWOptions() throws Throwable { diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionTest.java index 12c8d14339..6de226c635 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionTest.java @@ -24,8 +24,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPatchTest.java index 1625179aac..3164a438f2 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPatchTest.java @@ -17,8 +17,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -35,10 +33,10 @@ public class BackupPolicyPatchTest { @Test public void testBackupPolicyPatch() throws Throwable { BackupPolicyPatch backupPolicyPatchModel = new BackupPolicyPatch.Builder() - .matchUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-policy"))) + .matchUserTags(java.util.Arrays.asList("my-daily-backup-policy")) .name("my-backup-policy") .build(); - assertEquals(backupPolicyPatchModel.matchUserTags(), new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-policy"))); + assertEquals(backupPolicyPatchModel.matchUserTags(), java.util.Arrays.asList("my-daily-backup-policy")); assertEquals(backupPolicyPatchModel.name(), "my-backup-policy"); String json = TestUtilities.serialize(backupPolicyPatchModel); @@ -50,7 +48,7 @@ public void testBackupPolicyPatch() throws Throwable { @Test public void testBackupPolicyPatchAsPatch() throws Throwable { BackupPolicyPatch backupPolicyPatchModel = new BackupPolicyPatch.Builder() - .matchUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-policy"))) + .matchUserTags(java.util.Arrays.asList("my-daily-backup-policy")) .name("my-backup-policy") .build(); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanCollectionTest.java index 386c218f84..83c65496f1 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanCollectionTest.java @@ -20,8 +20,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatchTest.java index 446b4c6c72..6de6303dca 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatchTest.java @@ -18,8 +18,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -44,14 +42,14 @@ public void testBackupPolicyPlanPatch() throws Throwable { BackupPolicyPlanPatch backupPolicyPlanPatchModel = new BackupPolicyPlanPatch.Builder() .active(true) - .attachUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) .copyUserTags(true) .cronSpec("*/5 1,2,3 * * *") .deletionTrigger(backupPolicyPlanDeletionTriggerPatchModel) .name("my-policy-plan") .build(); assertEquals(backupPolicyPlanPatchModel.active(), Boolean.valueOf(true)); - assertEquals(backupPolicyPlanPatchModel.attachUserTags(), new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))); + assertEquals(backupPolicyPlanPatchModel.attachUserTags(), java.util.Arrays.asList("my-daily-backup-plan")); assertEquals(backupPolicyPlanPatchModel.copyUserTags(), Boolean.valueOf(true)); assertEquals(backupPolicyPlanPatchModel.cronSpec(), "*/5 1,2,3 * * *"); assertEquals(backupPolicyPlanPatchModel.deletionTrigger(), backupPolicyPlanDeletionTriggerPatchModel); @@ -76,7 +74,7 @@ public void testBackupPolicyPlanPatchAsPatch() throws Throwable { BackupPolicyPlanPatch backupPolicyPlanPatchModel = new BackupPolicyPlanPatch.Builder() .active(true) - .attachUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) .copyUserTags(true) .cronSpec("*/5 1,2,3 * * *") .deletionTrigger(backupPolicyPlanDeletionTriggerPatchModel) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototypeTest.java index 2352ac0178..bf6b94d7a7 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototypeTest.java @@ -18,8 +18,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -43,14 +41,14 @@ public void testBackupPolicyPlanPrototype() throws Throwable { BackupPolicyPlanPrototype backupPolicyPlanPrototypeModel = new BackupPolicyPlanPrototype.Builder() .active(true) - .attachUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) .copyUserTags(true) .cronSpec("*/5 1,2,3 * * *") .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) .name("my-policy-plan") .build(); assertEquals(backupPolicyPlanPrototypeModel.active(), Boolean.valueOf(true)); - assertEquals(backupPolicyPlanPrototypeModel.attachUserTags(), new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))); + assertEquals(backupPolicyPlanPrototypeModel.attachUserTags(), java.util.Arrays.asList("my-daily-backup-plan")); assertEquals(backupPolicyPlanPrototypeModel.copyUserTags(), Boolean.valueOf(true)); assertEquals(backupPolicyPlanPrototypeModel.cronSpec(), "*/5 1,2,3 * * *"); assertEquals(backupPolicyPlanPrototypeModel.deletionTrigger(), backupPolicyPlanDeletionTriggerPrototypeModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionTest.java index 92e41c30dc..780dc1d958 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionTest.java @@ -38,8 +38,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototypeTest.java index e75a8f63c0..f853d881a5 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototypeTest.java @@ -19,8 +19,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -47,11 +45,11 @@ public void testBareMetalServerInitializationPrototype() throws Throwable { BareMetalServerInitializationPrototype bareMetalServerInitializationPrototypeModel = new BareMetalServerInitializationPrototype.Builder() .image(imageIdentityModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) + .keys(java.util.Arrays.asList(keyIdentityModel)) .userData("testString") .build(); assertEquals(bareMetalServerInitializationPrototypeModel.image(), imageIdentityModel); - assertEquals(bareMetalServerInitializationPrototypeModel.keys(), new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))); + assertEquals(bareMetalServerInitializationPrototypeModel.keys(), java.util.Arrays.asList(keyIdentityModel)); assertEquals(bareMetalServerInitializationPrototypeModel.userData(), "testString"); String json = TestUtilities.serialize(bareMetalServerInitializationPrototypeModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByHiperSocketTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByHiperSocketTest.java new file mode 100644 index 0000000000..79bd4f9a9a --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceByHiperSocketTest.java @@ -0,0 +1,60 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceByHiperSocket; +import com.ibm.cloud.is.vpc.v1.model.FloatingIPReference; +import com.ibm.cloud.is.vpc.v1.model.FloatingIPReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.ReservedIPReference; +import com.ibm.cloud.is.vpc.v1.model.ReservedIPReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupReference; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SubnetReference; +import com.ibm.cloud.is.vpc.v1.model.SubnetReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the BareMetalServerNetworkInterfaceByHiperSocket model. + */ +public class BareMetalServerNetworkInterfaceByHiperSocketTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testBareMetalServerNetworkInterfaceByHiperSocket() throws Throwable { + BareMetalServerNetworkInterfaceByHiperSocket bareMetalServerNetworkInterfaceByHiperSocketModel = new BareMetalServerNetworkInterfaceByHiperSocket(); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.isAllowIpSpoofing()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getCreatedAt()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.isEnableInfrastructureNat()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getFloatingIps()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getHref()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getId()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getMacAddress()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getName()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getPortSpeed()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getPrimaryIp()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getResourceType()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getSecurityGroups()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getStatus()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getSubnet()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getType()); + assertNull(bareMetalServerNetworkInterfaceByHiperSocketModel.getInterfaceType()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollectionTest.java index 345d8c4ef4..e7d87f1cf0 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfaceCollectionTest.java @@ -13,7 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; -import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceByPCI; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceByHiperSocket; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceCollection; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceCollectionNext; @@ -29,8 +29,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePatchTest.java index accf0f79d1..f57d250e71 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePatchTest.java @@ -17,8 +17,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -36,12 +34,12 @@ public class BareMetalServerNetworkInterfacePatchTest { public void testBareMetalServerNetworkInterfacePatch() throws Throwable { BareMetalServerNetworkInterfacePatch bareMetalServerNetworkInterfacePatchModel = new BareMetalServerNetworkInterfacePatch.Builder() .allowIpSpoofing(true) - .allowedVlans(new java.util.ArrayList(java.util.Arrays.asList(Long.valueOf("4")))) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) .enableInfrastructureNat(true) .name("my-network-interface") .build(); assertEquals(bareMetalServerNetworkInterfacePatchModel.allowIpSpoofing(), Boolean.valueOf(true)); - assertEquals(bareMetalServerNetworkInterfacePatchModel.allowedVlans(), new java.util.ArrayList(java.util.Arrays.asList(Long.valueOf("4")))); + assertEquals(bareMetalServerNetworkInterfacePatchModel.allowedVlans(), java.util.Arrays.asList(Long.valueOf("4"))); assertEquals(bareMetalServerNetworkInterfacePatchModel.enableInfrastructureNat(), Boolean.valueOf(true)); assertEquals(bareMetalServerNetworkInterfacePatchModel.name(), "my-network-interface"); @@ -57,7 +55,7 @@ public void testBareMetalServerNetworkInterfacePatch() throws Throwable { public void testBareMetalServerNetworkInterfacePatchAsPatch() throws Throwable { BareMetalServerNetworkInterfacePatch bareMetalServerNetworkInterfacePatchModel = new BareMetalServerNetworkInterfacePatch.Builder() .allowIpSpoofing(true) - .allowedVlans(new java.util.ArrayList(java.util.Arrays.asList(Long.valueOf("4")))) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) .enableInfrastructureNat(true) .name("my-network-interface") .build(); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeTest.java new file mode 100644 index 0000000000..873a311c03 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeTest.java @@ -0,0 +1,90 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model. + */ +public class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype() throws Throwable { + NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + assertEquals(networkInterfaceIpPrototypeModel.address(), "10.0.0.5"); + assertEquals(networkInterfaceIpPrototypeModel.autoDelete(), Boolean.valueOf(false)); + assertEquals(networkInterfaceIpPrototypeModel.name(), "my-reserved-ip"); + + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + assertEquals(securityGroupIdentityModel.id(), "be5df5ca-12a0-494b-907e-aa6ec2bfa271"); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + assertEquals(subnetIdentityModel.id(), "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"); + + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.Builder() + .allowIpSpoofing(true) + .enableInfrastructureNat(true) + .name("my-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .interfaceType("hipersocket") + .build(); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModel.enableInfrastructureNat(), Boolean.valueOf(true)); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModel.name(), "my-network-interface"); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModel.subnet(), subnetIdentityModel); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModel.interfaceType(), "hipersocket"); + + String json = TestUtilities.serialize(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModel); + + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModelNew = TestUtilities.deserialize(json, BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.class); + assertTrue(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModelNew instanceof BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModelNew.allowIpSpoofing(), Boolean.valueOf(true)); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModelNew.enableInfrastructureNat(), Boolean.valueOf(true)); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModelNew.name(), "my-network-interface"); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModelNew.primaryIp().toString(), networkInterfaceIpPrototypeModel.toString()); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModelNew.subnet().toString(), subnetIdentityModel.toString()); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeModelNew.interfaceType(), "hipersocket"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeError() throws Throwable { + new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototypeTest.java index cb08728914..2ffb4d1fd6 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototypeTest.java @@ -20,8 +20,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -60,18 +58,18 @@ public void testBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkIn .enableInfrastructureNat(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) - .allowedVlans(new java.util.ArrayList(java.util.Arrays.asList(Long.valueOf("4")))) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) .interfaceType("pci") .build(); assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeModel.enableInfrastructureNat(), Boolean.valueOf(true)); assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeModel.name(), "my-network-interface"); assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeModel.subnet(), subnetIdentityModel); - assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeModel.allowedVlans(), new java.util.ArrayList(java.util.Arrays.asList(Long.valueOf("4")))); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeModel.allowedVlans(), java.util.Arrays.asList(Long.valueOf("4"))); assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeModel.interfaceType(), "pci"); String json = TestUtilities.serialize(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototypeTest.java index 28421dea08..bbd50f0d5c 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototypeTest.java @@ -20,8 +20,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -60,7 +58,7 @@ public void testBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkIn .enableInfrastructureNat(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .allowInterfaceToFloat(false) .interfaceType("vlan") @@ -70,7 +68,7 @@ public void testBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkIn assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototypeModel.enableInfrastructureNat(), Boolean.valueOf(true)); assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototypeModel.name(), "my-network-interface"); assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototypeModel.subnet(), subnetIdentityModel); assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototypeModel.allowInterfaceToFloat(), Boolean.valueOf(false)); assertEquals(bareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototypeModel.interfaceType(), "vlan"); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeTest.java index fbe766fa9d..32287f1876 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerNetworkInterfacePrototypeTest.java @@ -20,8 +20,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrimaryNetworkInterfacePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrimaryNetworkInterfacePrototypeTest.java index 3140e7d5b3..b0cca31736 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrimaryNetworkInterfacePrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrimaryNetworkInterfacePrototypeTest.java @@ -20,8 +20,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -57,21 +55,21 @@ public void testBareMetalServerPrimaryNetworkInterfacePrototype() throws Throwab BareMetalServerPrimaryNetworkInterfacePrototype bareMetalServerPrimaryNetworkInterfacePrototypeModel = new BareMetalServerPrimaryNetworkInterfacePrototype.Builder() .allowIpSpoofing(true) - .allowedVlans(new java.util.ArrayList(java.util.Arrays.asList(Long.valueOf("4")))) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) .enableInfrastructureNat(true) .interfaceType("pci") .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); - assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.allowedVlans(), new java.util.ArrayList(java.util.Arrays.asList(Long.valueOf("4")))); + assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.allowedVlans(), java.util.Arrays.asList(Long.valueOf("4"))); assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.enableInfrastructureNat(), Boolean.valueOf(true)); assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.interfaceType(), "pci"); assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.name(), "my-network-interface"); assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.subnet(), subnetIdentityModel); String json = TestUtilities.serialize(bareMetalServerPrimaryNetworkInterfacePrototypeModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollectionTest.java index 22632f8492..a55f1ed20c 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileCollectionTest.java @@ -31,8 +31,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskTest.java index 4df61b9e55..ef24c8b09e 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileDiskTest.java @@ -20,8 +20,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileTest.java index 9d9fb087a3..3405f469a7 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerProfileTest.java @@ -28,8 +28,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingIdentityCatalogOfferingByCRNTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingIdentityCatalogOfferingByCRNTest.java new file mode 100644 index 0000000000..60daa0dd2f --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingIdentityCatalogOfferingByCRNTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingIdentityCatalogOfferingByCRN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the CatalogOfferingIdentityCatalogOfferingByCRN model. + */ +public class CatalogOfferingIdentityCatalogOfferingByCRNTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCatalogOfferingIdentityCatalogOfferingByCRN() throws Throwable { + CatalogOfferingIdentityCatalogOfferingByCRN catalogOfferingIdentityCatalogOfferingByCrnModel = new CatalogOfferingIdentityCatalogOfferingByCRN.Builder() + .crn("crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442") + .build(); + assertEquals(catalogOfferingIdentityCatalogOfferingByCrnModel.crn(), "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442"); + + String json = TestUtilities.serialize(catalogOfferingIdentityCatalogOfferingByCrnModel); + + CatalogOfferingIdentityCatalogOfferingByCRN catalogOfferingIdentityCatalogOfferingByCrnModelNew = TestUtilities.deserialize(json, CatalogOfferingIdentityCatalogOfferingByCRN.class); + assertTrue(catalogOfferingIdentityCatalogOfferingByCrnModelNew instanceof CatalogOfferingIdentityCatalogOfferingByCRN); + assertEquals(catalogOfferingIdentityCatalogOfferingByCrnModelNew.crn(), "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCatalogOfferingIdentityCatalogOfferingByCRNError() throws Throwable { + new CatalogOfferingIdentityCatalogOfferingByCRN.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingIdentityTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingIdentityTest.java new file mode 100644 index 0000000000..72c2be9cf5 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingIdentityTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingIdentity; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the CatalogOfferingIdentity model. + */ +public class CatalogOfferingIdentityTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testCatalogOfferingIdentity() throws Throwable { + CatalogOfferingIdentity catalogOfferingIdentityModel = new CatalogOfferingIdentity(); + assertNotNull(catalogOfferingIdentityModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionIdentityCatalogOfferingVersionByCRNTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionIdentityCatalogOfferingVersionByCRNTest.java new file mode 100644 index 0000000000..eaf1f7088d --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionIdentityCatalogOfferingVersionByCRNTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN model. + */ +public class CatalogOfferingVersionIdentityCatalogOfferingVersionByCRNTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN() throws Throwable { + CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN catalogOfferingVersionIdentityCatalogOfferingVersionByCrnModel = new CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.Builder() + .crn("crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d") + .build(); + assertEquals(catalogOfferingVersionIdentityCatalogOfferingVersionByCrnModel.crn(), "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"); + + String json = TestUtilities.serialize(catalogOfferingVersionIdentityCatalogOfferingVersionByCrnModel); + + CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN catalogOfferingVersionIdentityCatalogOfferingVersionByCrnModelNew = TestUtilities.deserialize(json, CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.class); + assertTrue(catalogOfferingVersionIdentityCatalogOfferingVersionByCrnModelNew instanceof CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN); + assertEquals(catalogOfferingVersionIdentityCatalogOfferingVersionByCrnModelNew.crn(), "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCatalogOfferingVersionIdentityCatalogOfferingVersionByCRNError() throws Throwable { + new CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionIdentityTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionIdentityTest.java new file mode 100644 index 0000000000..d0a38f1b19 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionIdentityTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionIdentity; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the CatalogOfferingVersionIdentity model. + */ +public class CatalogOfferingVersionIdentityTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testCatalogOfferingVersionIdentity() throws Throwable { + CatalogOfferingVersionIdentity catalogOfferingVersionIdentityModel = new CatalogOfferingVersionIdentity(); + assertNotNull(catalogOfferingVersionIdentityModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionReferenceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionReferenceTest.java new file mode 100644 index 0000000000..3676b3f577 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CatalogOfferingVersionReferenceTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionReference; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the CatalogOfferingVersionReference model. + */ +public class CatalogOfferingVersionReferenceTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCatalogOfferingVersionReference() throws Throwable { + CatalogOfferingVersionReference catalogOfferingVersionReferenceModel = new CatalogOfferingVersionReference(); + assertNull(catalogOfferingVersionReferenceModel.getCrn()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyOptionsTest.java index c7ba121440..f3cca74ec1 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyOptionsTest.java @@ -20,8 +20,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -45,14 +43,14 @@ public void testCreateBackupPolicyOptions() throws Throwable { BackupPolicyPlanPrototype backupPolicyPlanPrototypeModel = new BackupPolicyPlanPrototype.Builder() .active(true) - .attachUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) .copyUserTags(true) .cronSpec("*/5 1,2,3 * * *") .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) .name("my-policy-plan") .build(); assertEquals(backupPolicyPlanPrototypeModel.active(), Boolean.valueOf(true)); - assertEquals(backupPolicyPlanPrototypeModel.attachUserTags(), new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))); + assertEquals(backupPolicyPlanPrototypeModel.attachUserTags(), java.util.Arrays.asList("my-daily-backup-plan")); assertEquals(backupPolicyPlanPrototypeModel.copyUserTags(), Boolean.valueOf(true)); assertEquals(backupPolicyPlanPrototypeModel.cronSpec(), "*/5 1,2,3 * * *"); assertEquals(backupPolicyPlanPrototypeModel.deletionTrigger(), backupPolicyPlanDeletionTriggerPrototypeModel); @@ -64,16 +62,16 @@ public void testCreateBackupPolicyOptions() throws Throwable { assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); CreateBackupPolicyOptions createBackupPolicyOptionsModel = new CreateBackupPolicyOptions.Builder() - .matchResourceTypes(new java.util.ArrayList(java.util.Arrays.asList("volume"))) - .matchUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-policy"))) + .matchResourceTypes(java.util.Arrays.asList("volume")) + .matchUserTags(java.util.Arrays.asList("my-daily-backup-policy")) .name("my-backup-policy") - .plans(new java.util.ArrayList(java.util.Arrays.asList(backupPolicyPlanPrototypeModel))) + .plans(java.util.Arrays.asList(backupPolicyPlanPrototypeModel)) .resourceGroup(resourceGroupIdentityModel) .build(); - assertEquals(createBackupPolicyOptionsModel.matchResourceTypes(), new java.util.ArrayList(java.util.Arrays.asList("volume"))); - assertEquals(createBackupPolicyOptionsModel.matchUserTags(), new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-policy"))); + assertEquals(createBackupPolicyOptionsModel.matchResourceTypes(), java.util.Arrays.asList("volume")); + assertEquals(createBackupPolicyOptionsModel.matchUserTags(), java.util.Arrays.asList("my-daily-backup-policy")); assertEquals(createBackupPolicyOptionsModel.name(), "my-backup-policy"); - assertEquals(createBackupPolicyOptionsModel.plans(), new java.util.ArrayList(java.util.Arrays.asList(backupPolicyPlanPrototypeModel))); + assertEquals(createBackupPolicyOptionsModel.plans(), java.util.Arrays.asList(backupPolicyPlanPrototypeModel)); assertEquals(createBackupPolicyOptionsModel.resourceGroup(), resourceGroupIdentityModel); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptionsTest.java index eb6e7f360e..a0e88c8906 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptionsTest.java @@ -18,8 +18,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -45,7 +43,7 @@ public void testCreateBackupPolicyPlanOptions() throws Throwable { .backupPolicyId("testString") .cronSpec("*/5 1,2,3 * * *") .active(true) - .attachUserTags(new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) .copyUserTags(true) .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) .name("my-policy-plan") @@ -53,7 +51,7 @@ public void testCreateBackupPolicyPlanOptions() throws Throwable { assertEquals(createBackupPolicyPlanOptionsModel.backupPolicyId(), "testString"); assertEquals(createBackupPolicyPlanOptionsModel.cronSpec(), "*/5 1,2,3 * * *"); assertEquals(createBackupPolicyPlanOptionsModel.active(), Boolean.valueOf(true)); - assertEquals(createBackupPolicyPlanOptionsModel.attachUserTags(), new java.util.ArrayList(java.util.Arrays.asList("my-daily-backup-plan"))); + assertEquals(createBackupPolicyPlanOptionsModel.attachUserTags(), java.util.Arrays.asList("my-daily-backup-plan")); assertEquals(createBackupPolicyPlanOptionsModel.copyUserTags(), Boolean.valueOf(true)); assertEquals(createBackupPolicyPlanOptionsModel.deletionTrigger(), backupPolicyPlanDeletionTriggerPrototypeModel); assertEquals(createBackupPolicyPlanOptionsModel.name(), "my-policy-plan"); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerNetworkInterfaceOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerNetworkInterfaceOptionsTest.java index 31c110eb00..b366acc74d 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerNetworkInterfaceOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerNetworkInterfaceOptionsTest.java @@ -13,7 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; -import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype; import com.ibm.cloud.is.vpc.v1.model.CreateBareMetalServerNetworkInterfaceOptions; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; @@ -21,8 +21,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -56,26 +54,22 @@ public void testCreateBareMetalServerNetworkInterfaceOptions() throws Throwable .build(); assertEquals(subnetIdentityModel.id(), "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"); - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.Builder() + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.Builder() .allowIpSpoofing(true) .enableInfrastructureNat(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) - .allowInterfaceToFloat(false) - .interfaceType("vlan") - .vlan(Long.valueOf("4")) + .interfaceType("hipersocket") .build(); assertEquals(bareMetalServerNetworkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); assertEquals(bareMetalServerNetworkInterfacePrototypeModel.enableInfrastructureNat(), Boolean.valueOf(true)); assertEquals(bareMetalServerNetworkInterfacePrototypeModel.name(), "my-network-interface"); assertEquals(bareMetalServerNetworkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(bareMetalServerNetworkInterfacePrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(bareMetalServerNetworkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(bareMetalServerNetworkInterfacePrototypeModel.subnet(), subnetIdentityModel); - assertEquals(bareMetalServerNetworkInterfacePrototypeModel.allowInterfaceToFloat(), Boolean.valueOf(false)); - assertEquals(bareMetalServerNetworkInterfacePrototypeModel.interfaceType(), "vlan"); - assertEquals(bareMetalServerNetworkInterfacePrototypeModel.vlan(), Long.valueOf("4")); + assertEquals(bareMetalServerNetworkInterfacePrototypeModel.interfaceType(), "hipersocket"); CreateBareMetalServerNetworkInterfaceOptions createBareMetalServerNetworkInterfaceOptionsModel = new CreateBareMetalServerNetworkInterfaceOptions.Builder() .bareMetalServerId("testString") diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerOptionsTest.java index cba5c617a3..6b74072f10 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerOptionsTest.java @@ -14,7 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationPrototype; -import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerPrimaryNetworkInterfacePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.CreateBareMetalServerOptions; @@ -29,8 +29,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -57,11 +55,11 @@ public void testCreateBareMetalServerOptions() throws Throwable { BareMetalServerInitializationPrototype bareMetalServerInitializationPrototypeModel = new BareMetalServerInitializationPrototype.Builder() .image(imageIdentityModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) + .keys(java.util.Arrays.asList(keyIdentityModel)) .userData("testString") .build(); assertEquals(bareMetalServerInitializationPrototypeModel.image(), imageIdentityModel); - assertEquals(bareMetalServerInitializationPrototypeModel.keys(), new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))); + assertEquals(bareMetalServerInitializationPrototypeModel.keys(), java.util.Arrays.asList(keyIdentityModel)); assertEquals(bareMetalServerInitializationPrototypeModel.userData(), "testString"); NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() @@ -85,21 +83,21 @@ public void testCreateBareMetalServerOptions() throws Throwable { BareMetalServerPrimaryNetworkInterfacePrototype bareMetalServerPrimaryNetworkInterfacePrototypeModel = new BareMetalServerPrimaryNetworkInterfacePrototype.Builder() .allowIpSpoofing(true) - .allowedVlans(new java.util.ArrayList(java.util.Arrays.asList(Long.valueOf("4")))) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) .enableInfrastructureNat(true) .interfaceType("pci") .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); - assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.allowedVlans(), new java.util.ArrayList(java.util.Arrays.asList(Long.valueOf("4")))); + assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.allowedVlans(), java.util.Arrays.asList(Long.valueOf("4"))); assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.enableInfrastructureNat(), Boolean.valueOf(true)); assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.interfaceType(), "pci"); assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.name(), "my-network-interface"); assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(bareMetalServerPrimaryNetworkInterfacePrototypeModel.subnet(), subnetIdentityModel); BareMetalServerProfileIdentityByName bareMetalServerProfileIdentityModel = new BareMetalServerProfileIdentityByName.Builder() @@ -112,26 +110,22 @@ public void testCreateBareMetalServerOptions() throws Throwable { .build(); assertEquals(zoneIdentityModel.name(), "us-south-1"); - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.Builder() + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.Builder() .allowIpSpoofing(true) .enableInfrastructureNat(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) - .allowInterfaceToFloat(false) - .interfaceType("vlan") - .vlan(Long.valueOf("4")) + .interfaceType("hipersocket") .build(); assertEquals(bareMetalServerNetworkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); assertEquals(bareMetalServerNetworkInterfacePrototypeModel.enableInfrastructureNat(), Boolean.valueOf(true)); assertEquals(bareMetalServerNetworkInterfacePrototypeModel.name(), "my-network-interface"); assertEquals(bareMetalServerNetworkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(bareMetalServerNetworkInterfacePrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(bareMetalServerNetworkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(bareMetalServerNetworkInterfacePrototypeModel.subnet(), subnetIdentityModel); - assertEquals(bareMetalServerNetworkInterfacePrototypeModel.allowInterfaceToFloat(), Boolean.valueOf(false)); - assertEquals(bareMetalServerNetworkInterfacePrototypeModel.interfaceType(), "vlan"); - assertEquals(bareMetalServerNetworkInterfacePrototypeModel.vlan(), Long.valueOf("4")); + assertEquals(bareMetalServerNetworkInterfacePrototypeModel.interfaceType(), "hipersocket"); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") @@ -149,7 +143,7 @@ public void testCreateBareMetalServerOptions() throws Throwable { .profile(bareMetalServerProfileIdentityModel) .zone(zoneIdentityModel) .name("my-bare-metal-server") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(bareMetalServerNetworkInterfacePrototypeModel))) + .networkInterfaces(java.util.Arrays.asList(bareMetalServerNetworkInterfacePrototypeModel)) .resourceGroup(resourceGroupIdentityModel) .vpc(vpcIdentityModel) .build(); @@ -158,7 +152,7 @@ public void testCreateBareMetalServerOptions() throws Throwable { assertEquals(createBareMetalServerOptionsModel.profile(), bareMetalServerProfileIdentityModel); assertEquals(createBareMetalServerOptionsModel.zone(), zoneIdentityModel); assertEquals(createBareMetalServerOptionsModel.name(), "my-bare-metal-server"); - assertEquals(createBareMetalServerOptionsModel.networkInterfaces(), new java.util.ArrayList(java.util.Arrays.asList(bareMetalServerNetworkInterfacePrototypeModel))); + assertEquals(createBareMetalServerOptionsModel.networkInterfaces(), java.util.Arrays.asList(bareMetalServerNetworkInterfacePrototypeModel)); assertEquals(createBareMetalServerOptionsModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(createBareMetalServerOptionsModel.vpc(), vpcIdentityModel); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptionsTest.java index b4d420a7cd..a971df733b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptionsTest.java @@ -22,8 +22,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -68,17 +66,17 @@ public void testCreateEndpointGatewayOptions() throws Throwable { CreateEndpointGatewayOptions createEndpointGatewayOptionsModel = new CreateEndpointGatewayOptions.Builder() .target(endpointGatewayTargetPrototypeModel) .vpc(vpcIdentityModel) - .ips(new java.util.ArrayList(java.util.Arrays.asList(endpointGatewayReservedIpModel))) + .ips(java.util.Arrays.asList(endpointGatewayReservedIpModel)) .name("my-endpoint-gateway") .resourceGroup(resourceGroupIdentityModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); assertEquals(createEndpointGatewayOptionsModel.target(), endpointGatewayTargetPrototypeModel); assertEquals(createEndpointGatewayOptionsModel.vpc(), vpcIdentityModel); - assertEquals(createEndpointGatewayOptionsModel.ips(), new java.util.ArrayList(java.util.Arrays.asList(endpointGatewayReservedIpModel))); + assertEquals(createEndpointGatewayOptionsModel.ips(), java.util.Arrays.asList(endpointGatewayReservedIpModel)); assertEquals(createEndpointGatewayOptionsModel.name(), "my-endpoint-gateway"); assertEquals(createEndpointGatewayOptionsModel.resourceGroup(), resourceGroupIdentityModel); - assertEquals(createEndpointGatewayOptionsModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(createEndpointGatewayOptionsModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupOptionsTest.java index 3c3c2f41dc..1bb6effe5b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupOptionsTest.java @@ -22,8 +22,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -65,7 +63,7 @@ public void testCreateInstanceGroupOptions() throws Throwable { CreateInstanceGroupOptions createInstanceGroupOptionsModel = new CreateInstanceGroupOptions.Builder() .instanceTemplate(instanceTemplateIdentityModel) - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) .applicationPort(Long.valueOf("22")) .loadBalancer(loadBalancerIdentityModel) .loadBalancerPool(loadBalancerPoolIdentityModel) @@ -74,7 +72,7 @@ public void testCreateInstanceGroupOptions() throws Throwable { .resourceGroup(resourceGroupIdentityModel) .build(); assertEquals(createInstanceGroupOptionsModel.instanceTemplate(), instanceTemplateIdentityModel); - assertEquals(createInstanceGroupOptionsModel.subnets(), new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))); + assertEquals(createInstanceGroupOptionsModel.subnets(), java.util.Arrays.asList(subnetIdentityModel)); assertEquals(createInstanceGroupOptionsModel.applicationPort(), Long.valueOf("22")); assertEquals(createInstanceGroupOptionsModel.loadBalancer(), loadBalancerIdentityModel); assertEquals(createInstanceGroupOptionsModel.loadBalancerPool(), loadBalancerPoolIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceNetworkInterfaceOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceNetworkInterfaceOptionsTest.java index a73b77a554..3ca8d08263 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceNetworkInterfaceOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceNetworkInterfaceOptionsTest.java @@ -20,8 +20,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -61,14 +59,14 @@ public void testCreateInstanceNetworkInterfaceOptions() throws Throwable { .allowIpSpoofing(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); assertEquals(createInstanceNetworkInterfaceOptionsModel.instanceId(), "testString"); assertEquals(createInstanceNetworkInterfaceOptionsModel.subnet(), subnetIdentityModel); assertEquals(createInstanceNetworkInterfaceOptionsModel.allowIpSpoofing(), Boolean.valueOf(true)); assertEquals(createInstanceNetworkInterfaceOptionsModel.name(), "my-network-interface"); assertEquals(createInstanceNetworkInterfaceOptionsModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(createInstanceNetworkInterfaceOptionsModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(createInstanceNetworkInterfaceOptionsModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceOptionsTest.java index a7f8b83394..115798e534 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceOptionsTest.java @@ -39,8 +39,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -105,13 +103,13 @@ public void testCreateInstanceOptions() throws Throwable { .allowIpSpoofing(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); assertEquals(networkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); assertEquals(networkInterfacePrototypeModel.name(), "my-network-interface"); assertEquals(networkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(networkInterfacePrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(networkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(networkInterfacePrototypeModel.subnet(), subnetIdentityModel); InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() @@ -164,12 +162,14 @@ public void testCreateInstanceOptions() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("250")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() .deleteVolumeOnInstanceDelete(true) @@ -193,16 +193,16 @@ public void testCreateInstanceOptions() throws Throwable { InstancePrototypeInstanceByImage instancePrototypeModel = new InstancePrototypeInstanceByImage.Builder() .availabilityPolicy(instanceAvailabilityPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) + .keys(java.util.Arrays.asList(keyIdentityModel)) .metadataService(instanceMetadataServicePrototypeModel) .name("my-instance") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))) + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) .placementTarget(instancePlacementTargetPrototypeModel) .profile(instanceProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") - .volumeAttachments(new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))) + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .image(imageIdentityModel) @@ -211,16 +211,16 @@ public void testCreateInstanceOptions() throws Throwable { .build(); assertEquals(instancePrototypeModel.availabilityPolicy(), instanceAvailabilityPrototypeModel); assertEquals(instancePrototypeModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); - assertEquals(instancePrototypeModel.keys(), new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))); + assertEquals(instancePrototypeModel.keys(), java.util.Arrays.asList(keyIdentityModel)); assertEquals(instancePrototypeModel.metadataService(), instanceMetadataServicePrototypeModel); assertEquals(instancePrototypeModel.name(), "my-instance"); - assertEquals(instancePrototypeModel.networkInterfaces(), new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))); + assertEquals(instancePrototypeModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); assertEquals(instancePrototypeModel.placementTarget(), instancePlacementTargetPrototypeModel); assertEquals(instancePrototypeModel.profile(), instanceProfileIdentityModel); assertEquals(instancePrototypeModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeModel.userData(), "testString"); - assertEquals(instancePrototypeModel.volumeAttachments(), new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))); + assertEquals(instancePrototypeModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)); assertEquals(instancePrototypeModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instancePrototypeModel.image(), imageIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceTemplateOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceTemplateOptionsTest.java index c55a2b642c..83d4570a9b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceTemplateOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceTemplateOptionsTest.java @@ -39,8 +39,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -105,13 +103,13 @@ public void testCreateInstanceTemplateOptions() throws Throwable { .allowIpSpoofing(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); assertEquals(networkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); assertEquals(networkInterfacePrototypeModel.name(), "my-network-interface"); assertEquals(networkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(networkInterfacePrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(networkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(networkInterfacePrototypeModel.subnet(), subnetIdentityModel); InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() @@ -164,12 +162,14 @@ public void testCreateInstanceTemplateOptions() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("250")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() .deleteVolumeOnInstanceDelete(true) @@ -193,16 +193,16 @@ public void testCreateInstanceTemplateOptions() throws Throwable { InstanceTemplatePrototypeInstanceByImage instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceByImage.Builder() .availabilityPolicy(instanceAvailabilityPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) + .keys(java.util.Arrays.asList(keyIdentityModel)) .metadataService(instanceMetadataServicePrototypeModel) .name("my-instance") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))) + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) .placementTarget(instancePlacementTargetPrototypeModel) .profile(instanceProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") - .volumeAttachments(new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))) + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .image(imageIdentityModel) @@ -211,16 +211,16 @@ public void testCreateInstanceTemplateOptions() throws Throwable { .build(); assertEquals(instanceTemplatePrototypeModel.availabilityPolicy(), instanceAvailabilityPrototypeModel); assertEquals(instanceTemplatePrototypeModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); - assertEquals(instanceTemplatePrototypeModel.keys(), new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))); + assertEquals(instanceTemplatePrototypeModel.keys(), java.util.Arrays.asList(keyIdentityModel)); assertEquals(instanceTemplatePrototypeModel.metadataService(), instanceMetadataServicePrototypeModel); assertEquals(instanceTemplatePrototypeModel.name(), "my-instance"); - assertEquals(instanceTemplatePrototypeModel.networkInterfaces(), new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))); + assertEquals(instanceTemplatePrototypeModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); assertEquals(instanceTemplatePrototypeModel.placementTarget(), instancePlacementTargetPrototypeModel); assertEquals(instanceTemplatePrototypeModel.profile(), instanceProfileIdentityModel); assertEquals(instanceTemplatePrototypeModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instanceTemplatePrototypeModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeModel.userData(), "testString"); - assertEquals(instanceTemplatePrototypeModel.volumeAttachments(), new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))); + assertEquals(instanceTemplatePrototypeModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)); assertEquals(instanceTemplatePrototypeModel.vpc(), vpcIdentityModel); assertEquals(instanceTemplatePrototypeModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instanceTemplatePrototypeModel.image(), imageIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateIpsecPolicyOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateIpsecPolicyOptionsTest.java index c0fff71bcd..01542c3dbd 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateIpsecPolicyOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateIpsecPolicyOptionsTest.java @@ -38,14 +38,14 @@ public void testCreateIpsecPolicyOptions() throws Throwable { assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); CreateIpsecPolicyOptions createIpsecPolicyOptionsModel = new CreateIpsecPolicyOptions.Builder() - .authenticationAlgorithm("md5") + .authenticationAlgorithm("disabled") .encryptionAlgorithm("aes128") .pfs("disabled") .keyLifetime(Long.valueOf("3600")) .name("my-ipsec-policy") .resourceGroup(resourceGroupIdentityModel) .build(); - assertEquals(createIpsecPolicyOptionsModel.authenticationAlgorithm(), "md5"); + assertEquals(createIpsecPolicyOptionsModel.authenticationAlgorithm(), "disabled"); assertEquals(createIpsecPolicyOptionsModel.encryptionAlgorithm(), "aes128"); assertEquals(createIpsecPolicyOptionsModel.pfs(), "disabled"); assertEquals(createIpsecPolicyOptionsModel.keyLifetime(), Long.valueOf("3600")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerOptionsTest.java index 169f4c7259..1dee1e3180 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerOptionsTest.java @@ -24,8 +24,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -84,13 +82,13 @@ public void testCreateLoadBalancerListenerOptions() throws Throwable { .action("forward") .name("my-policy") .priority(Long.valueOf("5")) - .rules(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel))) + .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) .target(loadBalancerListenerPolicyTargetPrototypeModel) .build(); assertEquals(loadBalancerListenerPolicyPrototypeModel.action(), "forward"); assertEquals(loadBalancerListenerPolicyPrototypeModel.name(), "my-policy"); assertEquals(loadBalancerListenerPolicyPrototypeModel.priority(), Long.valueOf("5")); - assertEquals(loadBalancerListenerPolicyPrototypeModel.rules(), new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel))); + assertEquals(loadBalancerListenerPolicyPrototypeModel.rules(), java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)); assertEquals(loadBalancerListenerPolicyPrototypeModel.target(), loadBalancerListenerPolicyTargetPrototypeModel); CreateLoadBalancerListenerOptions createLoadBalancerListenerOptionsModel = new CreateLoadBalancerListenerOptions.Builder() @@ -101,7 +99,7 @@ public void testCreateLoadBalancerListenerOptions() throws Throwable { .connectionLimit(Long.valueOf("2000")) .defaultPool(loadBalancerPoolIdentityModel) .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) - .policies(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyPrototypeModel))) + .policies(java.util.Arrays.asList(loadBalancerListenerPolicyPrototypeModel)) .port(Long.valueOf("443")) .portMax(Long.valueOf("499")) .portMin(Long.valueOf("443")) @@ -113,7 +111,7 @@ public void testCreateLoadBalancerListenerOptions() throws Throwable { assertEquals(createLoadBalancerListenerOptionsModel.connectionLimit(), Long.valueOf("2000")); assertEquals(createLoadBalancerListenerOptionsModel.defaultPool(), loadBalancerPoolIdentityModel); assertEquals(createLoadBalancerListenerOptionsModel.httpsRedirect(), loadBalancerListenerHttpsRedirectPrototypeModel); - assertEquals(createLoadBalancerListenerOptionsModel.policies(), new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyPrototypeModel))); + assertEquals(createLoadBalancerListenerOptionsModel.policies(), java.util.Arrays.asList(loadBalancerListenerPolicyPrototypeModel)); assertEquals(createLoadBalancerListenerOptionsModel.port(), Long.valueOf("443")); assertEquals(createLoadBalancerListenerOptionsModel.portMax(), Long.valueOf("499")); assertEquals(createLoadBalancerListenerOptionsModel.portMin(), Long.valueOf("443")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerPolicyOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerPolicyOptionsTest.java index ba04f0e7ad..a45c64c6d1 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerPolicyOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerListenerPolicyOptionsTest.java @@ -19,8 +19,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -57,7 +55,7 @@ public void testCreateLoadBalancerListenerPolicyOptions() throws Throwable { .action("forward") .priority(Long.valueOf("5")) .name("my-policy") - .rules(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel))) + .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) .target(loadBalancerListenerPolicyTargetPrototypeModel) .build(); assertEquals(createLoadBalancerListenerPolicyOptionsModel.loadBalancerId(), "testString"); @@ -65,7 +63,7 @@ public void testCreateLoadBalancerListenerPolicyOptions() throws Throwable { assertEquals(createLoadBalancerListenerPolicyOptionsModel.action(), "forward"); assertEquals(createLoadBalancerListenerPolicyOptionsModel.priority(), Long.valueOf("5")); assertEquals(createLoadBalancerListenerPolicyOptionsModel.name(), "my-policy"); - assertEquals(createLoadBalancerListenerPolicyOptionsModel.rules(), new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel))); + assertEquals(createLoadBalancerListenerPolicyOptionsModel.rules(), java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)); assertEquals(createLoadBalancerListenerPolicyOptionsModel.target(), loadBalancerListenerPolicyTargetPrototypeModel); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerOptionsTest.java index 8643968638..356ae6cb58 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerOptionsTest.java @@ -13,7 +13,10 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.CreateLoadBalancerOptions; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerListenerHTTPSRedirectPrototype; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerListenerIdentityById; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerListenerPrototypeLoadBalancerContext; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerLogging; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerLoggingDatapath; @@ -30,8 +33,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -51,23 +52,46 @@ public void testCreateLoadBalancerOptions() throws Throwable { .build(); assertEquals(subnetIdentityModel.id(), "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"); + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") + .build(); + assertEquals(certificateInstanceIdentityModel.crn(), "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"); + LoadBalancerPoolIdentityByName loadBalancerPoolIdentityByNameModel = new LoadBalancerPoolIdentityByName.Builder() .name("my-load-balancer-pool") .build(); assertEquals(loadBalancerPoolIdentityByNameModel.name(), "my-load-balancer-pool"); + LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() + .id("70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + assertEquals(loadBalancerListenerIdentityModel.id(), "70294e14-4e61-11e8-bcf4-0242ac110004"); + + LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototypeModel = new LoadBalancerListenerHTTPSRedirectPrototype.Builder() + .httpStatusCode(Long.valueOf("301")) + .listener(loadBalancerListenerIdentityModel) + .uri("/example?doc=get") + .build(); + assertEquals(loadBalancerListenerHttpsRedirectPrototypeModel.httpStatusCode(), Long.valueOf("301")); + assertEquals(loadBalancerListenerHttpsRedirectPrototypeModel.listener(), loadBalancerListenerIdentityModel); + assertEquals(loadBalancerListenerHttpsRedirectPrototypeModel.uri(), "/example?doc=get"); + LoadBalancerListenerPrototypeLoadBalancerContext loadBalancerListenerPrototypeLoadBalancerContextModel = new LoadBalancerListenerPrototypeLoadBalancerContext.Builder() .acceptProxyProtocol(true) + .certificateInstance(certificateInstanceIdentityModel) .connectionLimit(Long.valueOf("2000")) .defaultPool(loadBalancerPoolIdentityByNameModel) + .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) .port(Long.valueOf("443")) .portMax(Long.valueOf("499")) .portMin(Long.valueOf("443")) .protocol("http") .build(); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.acceptProxyProtocol(), Boolean.valueOf(true)); + assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.certificateInstance(), certificateInstanceIdentityModel); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.connectionLimit(), Long.valueOf("2000")); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.defaultPool(), loadBalancerPoolIdentityByNameModel); + assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.httpsRedirect(), loadBalancerListenerHttpsRedirectPrototypeModel); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.port(), Long.valueOf("443")); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.portMax(), Long.valueOf("499")); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.portMin(), Long.valueOf("443")); @@ -122,7 +146,7 @@ public void testCreateLoadBalancerOptions() throws Throwable { LoadBalancerPoolPrototype loadBalancerPoolPrototypeModel = new LoadBalancerPoolPrototype.Builder() .algorithm("least_connections") .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) - .members(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))) + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) .name("my-load-balancer-pool") .protocol("http") .proxyProtocol("disabled") @@ -130,7 +154,7 @@ public void testCreateLoadBalancerOptions() throws Throwable { .build(); assertEquals(loadBalancerPoolPrototypeModel.algorithm(), "least_connections"); assertEquals(loadBalancerPoolPrototypeModel.healthMonitor(), loadBalancerPoolHealthMonitorPrototypeModel); - assertEquals(loadBalancerPoolPrototypeModel.members(), new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))); + assertEquals(loadBalancerPoolPrototypeModel.members(), java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)); assertEquals(loadBalancerPoolPrototypeModel.name(), "my-load-balancer-pool"); assertEquals(loadBalancerPoolPrototypeModel.protocol(), "http"); assertEquals(loadBalancerPoolPrototypeModel.proxyProtocol(), "disabled"); @@ -153,26 +177,26 @@ public void testCreateLoadBalancerOptions() throws Throwable { CreateLoadBalancerOptions createLoadBalancerOptionsModel = new CreateLoadBalancerOptions.Builder() .isPublic(true) - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) - .listeners(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPrototypeLoadBalancerContextModel))) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .listeners(java.util.Arrays.asList(loadBalancerListenerPrototypeLoadBalancerContextModel)) .logging(loadBalancerLoggingModel) .name("my-load-balancer") - .pools(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolPrototypeModel))) + .pools(java.util.Arrays.asList(loadBalancerPoolPrototypeModel)) .profile(loadBalancerProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) .routeMode(true) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); assertEquals(createLoadBalancerOptionsModel.isPublic(), Boolean.valueOf(true)); - assertEquals(createLoadBalancerOptionsModel.subnets(), new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))); - assertEquals(createLoadBalancerOptionsModel.listeners(), new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPrototypeLoadBalancerContextModel))); + assertEquals(createLoadBalancerOptionsModel.subnets(), java.util.Arrays.asList(subnetIdentityModel)); + assertEquals(createLoadBalancerOptionsModel.listeners(), java.util.Arrays.asList(loadBalancerListenerPrototypeLoadBalancerContextModel)); assertEquals(createLoadBalancerOptionsModel.logging(), loadBalancerLoggingModel); assertEquals(createLoadBalancerOptionsModel.name(), "my-load-balancer"); - assertEquals(createLoadBalancerOptionsModel.pools(), new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolPrototypeModel))); + assertEquals(createLoadBalancerOptionsModel.pools(), java.util.Arrays.asList(loadBalancerPoolPrototypeModel)); assertEquals(createLoadBalancerOptionsModel.profile(), loadBalancerProfileIdentityModel); assertEquals(createLoadBalancerOptionsModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(createLoadBalancerOptionsModel.routeMode(), Boolean.valueOf(true)); - assertEquals(createLoadBalancerOptionsModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(createLoadBalancerOptionsModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerPoolOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerPoolOptionsTest.java index 4d2ce6c57c..4f34c634e7 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerPoolOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateLoadBalancerPoolOptionsTest.java @@ -21,8 +21,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -78,7 +76,7 @@ public void testCreateLoadBalancerPoolOptions() throws Throwable { .algorithm("least_connections") .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) .protocol("http") - .members(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))) + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) .name("my-load-balancer-pool") .proxyProtocol("disabled") .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) @@ -87,7 +85,7 @@ public void testCreateLoadBalancerPoolOptions() throws Throwable { assertEquals(createLoadBalancerPoolOptionsModel.algorithm(), "least_connections"); assertEquals(createLoadBalancerPoolOptionsModel.healthMonitor(), loadBalancerPoolHealthMonitorPrototypeModel); assertEquals(createLoadBalancerPoolOptionsModel.protocol(), "http"); - assertEquals(createLoadBalancerPoolOptionsModel.members(), new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))); + assertEquals(createLoadBalancerPoolOptionsModel.members(), java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)); assertEquals(createLoadBalancerPoolOptionsModel.name(), "my-load-balancer-pool"); assertEquals(createLoadBalancerPoolOptionsModel.proxyProtocol(), "disabled"); assertEquals(createLoadBalancerPoolOptionsModel.sessionPersistence(), loadBalancerPoolSessionPersistencePrototypeModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclOptionsTest.java index 70d2309e67..35a7ab0f18 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclOptionsTest.java @@ -15,14 +15,12 @@ import com.ibm.cloud.is.vpc.v1.model.CreateNetworkAclOptions; import com.ibm.cloud.is.vpc.v1.model.NetworkACLPrototypeNetworkACLByRules; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -47,7 +45,7 @@ public void testCreateNetworkAclOptions() throws Throwable { .build(); assertEquals(vpcIdentityModel.id(), "cf7cd5a-2f30-4336-a495-6addc820cd61"); - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP.Builder() + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.Builder() .action("allow") .destination("192.168.3.2/32") .direction("inbound") @@ -74,12 +72,12 @@ public void testCreateNetworkAclOptions() throws Throwable { .name("my-network-acl") .resourceGroup(resourceGroupIdentityModel) .vpc(vpcIdentityModel) - .rules(new java.util.ArrayList(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel))) + .rules(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel)) .build(); assertEquals(networkAclPrototypeModel.name(), "my-network-acl"); assertEquals(networkAclPrototypeModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(networkAclPrototypeModel.vpc(), vpcIdentityModel); - assertEquals(networkAclPrototypeModel.rules(), new java.util.ArrayList(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel))); + assertEquals(networkAclPrototypeModel.rules(), java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel)); CreateNetworkAclOptions createNetworkAclOptionsModel = new CreateNetworkAclOptions.Builder() .networkAclPrototype(networkAclPrototypeModel) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclRuleOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclRuleOptionsTest.java index 1ee81ca86a..882b5c3177 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclRuleOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclRuleOptionsTest.java @@ -15,7 +15,7 @@ import com.ibm.cloud.is.vpc.v1.model.CreateNetworkAclRuleOptions; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolICMP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -38,16 +38,18 @@ public void testCreateNetworkAclRuleOptions() throws Throwable { .build(); assertEquals(networkAclRuleBeforePrototypeModel.id(), "8daca77a-4980-4d33-8f3e-7038797be8f9"); - NetworkACLRulePrototypeNetworkACLRuleProtocolICMP networkAclRulePrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolICMP.Builder() + NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype networkAclRulePrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.Builder() .action("allow") .before(networkAclRuleBeforePrototypeModel) .destination("192.168.3.2/32") .direction("inbound") .name("my-rule-2") .source("192.168.3.2/32") - .code(Long.valueOf("0")) - .protocol("icmp") - .type(Long.valueOf("8")) + .destinationPortMax(Long.valueOf("22")) + .destinationPortMin(Long.valueOf("22")) + .protocol("udp") + .sourcePortMax(Long.valueOf("65535")) + .sourcePortMin(Long.valueOf("49152")) .build(); assertEquals(networkAclRulePrototypeModel.action(), "allow"); assertEquals(networkAclRulePrototypeModel.before(), networkAclRuleBeforePrototypeModel); @@ -55,9 +57,11 @@ public void testCreateNetworkAclRuleOptions() throws Throwable { assertEquals(networkAclRulePrototypeModel.direction(), "inbound"); assertEquals(networkAclRulePrototypeModel.name(), "my-rule-2"); assertEquals(networkAclRulePrototypeModel.source(), "192.168.3.2/32"); - assertEquals(networkAclRulePrototypeModel.code(), Long.valueOf("0")); - assertEquals(networkAclRulePrototypeModel.protocol(), "icmp"); - assertEquals(networkAclRulePrototypeModel.type(), Long.valueOf("8")); + assertEquals(networkAclRulePrototypeModel.destinationPortMax(), Long.valueOf("22")); + assertEquals(networkAclRulePrototypeModel.destinationPortMin(), Long.valueOf("22")); + assertEquals(networkAclRulePrototypeModel.protocol(), "udp"); + assertEquals(networkAclRulePrototypeModel.sourcePortMax(), Long.valueOf("65535")); + assertEquals(networkAclRulePrototypeModel.sourcePortMin(), Long.valueOf("49152")); CreateNetworkAclRuleOptions createNetworkAclRuleOptionsModel = new CreateNetworkAclRuleOptions.Builder() .networkAclId("testString") diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupOptionsTest.java index 28e508af08..cdbf3b4218 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupOptionsTest.java @@ -15,14 +15,12 @@ import com.ibm.cloud.is.vpc.v1.model.CreateSecurityGroupOptions; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; -import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemotePrototypeIP; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -52,31 +50,27 @@ public void testCreateSecurityGroupOptions() throws Throwable { .build(); assertEquals(securityGroupRuleRemotePrototypeModel.address(), "192.168.3.4"); - SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.Builder() - .code(Long.valueOf("0")) + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder() .direction("inbound") .ipVersion("ipv4") - .protocol("icmp") + .protocol("all") .remote(securityGroupRuleRemotePrototypeModel) - .type(Long.valueOf("8")) .build(); - assertEquals(securityGroupRulePrototypeModel.code(), Long.valueOf("0")); assertEquals(securityGroupRulePrototypeModel.direction(), "inbound"); assertEquals(securityGroupRulePrototypeModel.ipVersion(), "ipv4"); - assertEquals(securityGroupRulePrototypeModel.protocol(), "icmp"); + assertEquals(securityGroupRulePrototypeModel.protocol(), "all"); assertEquals(securityGroupRulePrototypeModel.remote(), securityGroupRuleRemotePrototypeModel); - assertEquals(securityGroupRulePrototypeModel.type(), Long.valueOf("8")); CreateSecurityGroupOptions createSecurityGroupOptionsModel = new CreateSecurityGroupOptions.Builder() .vpc(vpcIdentityModel) .name("my-security-group") .resourceGroup(resourceGroupIdentityModel) - .rules(new java.util.ArrayList(java.util.Arrays.asList(securityGroupRulePrototypeModel))) + .rules(java.util.Arrays.asList(securityGroupRulePrototypeModel)) .build(); assertEquals(createSecurityGroupOptionsModel.vpc(), vpcIdentityModel); assertEquals(createSecurityGroupOptionsModel.name(), "my-security-group"); assertEquals(createSecurityGroupOptionsModel.resourceGroup(), resourceGroupIdentityModel); - assertEquals(createSecurityGroupOptionsModel.rules(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupRulePrototypeModel))); + assertEquals(createSecurityGroupOptionsModel.rules(), java.util.Arrays.asList(securityGroupRulePrototypeModel)); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupRuleOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupRuleOptionsTest.java index cc226ca8e1..37f35121a5 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupRuleOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupRuleOptionsTest.java @@ -14,7 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.CreateSecurityGroupRuleOptions; -import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemotePrototypeIP; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -38,20 +38,16 @@ public void testCreateSecurityGroupRuleOptions() throws Throwable { .build(); assertEquals(securityGroupRuleRemotePrototypeModel.address(), "192.168.3.4"); - SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.Builder() - .code(Long.valueOf("0")) + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder() .direction("inbound") .ipVersion("ipv4") - .protocol("icmp") + .protocol("all") .remote(securityGroupRuleRemotePrototypeModel) - .type(Long.valueOf("8")) .build(); - assertEquals(securityGroupRulePrototypeModel.code(), Long.valueOf("0")); assertEquals(securityGroupRulePrototypeModel.direction(), "inbound"); assertEquals(securityGroupRulePrototypeModel.ipVersion(), "ipv4"); - assertEquals(securityGroupRulePrototypeModel.protocol(), "icmp"); + assertEquals(securityGroupRulePrototypeModel.protocol(), "all"); assertEquals(securityGroupRulePrototypeModel.remote(), securityGroupRuleRemotePrototypeModel); - assertEquals(securityGroupRulePrototypeModel.type(), Long.valueOf("8")); CreateSecurityGroupRuleOptions createSecurityGroupRuleOptionsModel = new CreateSecurityGroupRuleOptions.Builder() .securityGroupId("testString") diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotOptionsTest.java index 2b635cf260..d7ae31d351 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotOptionsTest.java @@ -20,8 +20,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -49,12 +47,12 @@ public void testCreateSnapshotOptions() throws Throwable { SnapshotPrototypeSnapshotBySourceVolume snapshotPrototypeModel = new SnapshotPrototypeSnapshotBySourceVolume.Builder() .name("my-snapshot") .resourceGroup(resourceGroupIdentityModel) - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .userTags(java.util.Arrays.asList("testString")) .sourceVolume(volumeIdentityModel) .build(); assertEquals(snapshotPrototypeModel.name(), "my-snapshot"); assertEquals(snapshotPrototypeModel.resourceGroup(), resourceGroupIdentityModel); - assertEquals(snapshotPrototypeModel.userTags(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(snapshotPrototypeModel.userTags(), java.util.Arrays.asList("testString")); assertEquals(snapshotPrototypeModel.sourceVolume(), volumeIdentityModel); CreateSnapshotOptions createSnapshotOptionsModel = new CreateSnapshotOptions.Builder() diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVolumeOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVolumeOptionsTest.java index c9b86e5dbf..fb3ca9787d 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVolumeOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVolumeOptionsTest.java @@ -22,8 +22,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -63,7 +61,7 @@ public void testCreateVolumeOptions() throws Throwable { .name("my-volume") .profile(volumeProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .userTags(java.util.Arrays.asList("testString")) .zone(zoneIdentityModel) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -72,7 +70,7 @@ public void testCreateVolumeOptions() throws Throwable { assertEquals(volumePrototypeModel.name(), "my-volume"); assertEquals(volumePrototypeModel.profile(), volumeProfileIdentityModel); assertEquals(volumePrototypeModel.resourceGroup(), resourceGroupIdentityModel); - assertEquals(volumePrototypeModel.userTags(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(volumePrototypeModel.userTags(), java.util.Arrays.asList("testString")); assertEquals(volumePrototypeModel.zone(), zoneIdentityModel); assertEquals(volumePrototypeModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeModel.encryptionKey(), encryptionKeyIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRoutingTableOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRoutingTableOptionsTest.java index 046a5e4bc5..63e7c31bce 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRoutingTableOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRoutingTableOptionsTest.java @@ -21,8 +21,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -67,20 +65,20 @@ public void testCreateVpcRoutingTableOptions() throws Throwable { CreateVpcRoutingTableOptions createVpcRoutingTableOptionsModel = new CreateVpcRoutingTableOptions.Builder() .vpcId("testString") - .acceptRoutesFrom(new java.util.ArrayList(java.util.Arrays.asList(resourceFilterModel))) + .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) .name("my-routing-table-2") .routeDirectLinkIngress(false) .routeTransitGatewayIngress(false) .routeVpcZoneIngress(false) - .routes(new java.util.ArrayList(java.util.Arrays.asList(routePrototypeModel))) + .routes(java.util.Arrays.asList(routePrototypeModel)) .build(); assertEquals(createVpcRoutingTableOptionsModel.vpcId(), "testString"); - assertEquals(createVpcRoutingTableOptionsModel.acceptRoutesFrom(), new java.util.ArrayList(java.util.Arrays.asList(resourceFilterModel))); + assertEquals(createVpcRoutingTableOptionsModel.acceptRoutesFrom(), java.util.Arrays.asList(resourceFilterModel)); assertEquals(createVpcRoutingTableOptionsModel.name(), "my-routing-table-2"); assertEquals(createVpcRoutingTableOptionsModel.routeDirectLinkIngress(), Boolean.valueOf(false)); assertEquals(createVpcRoutingTableOptionsModel.routeTransitGatewayIngress(), Boolean.valueOf(false)); assertEquals(createVpcRoutingTableOptionsModel.routeVpcZoneIngress(), Boolean.valueOf(false)); - assertEquals(createVpcRoutingTableOptionsModel.routes(), new java.util.ArrayList(java.util.Arrays.asList(routePrototypeModel))); + assertEquals(createVpcRoutingTableOptionsModel.routes(), java.util.Arrays.asList(routePrototypeModel)); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnServerOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnServerOptionsTest.java index 50ba94dcb8..072b5cb492 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnServerOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnServerOptionsTest.java @@ -24,8 +24,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -79,30 +77,30 @@ public void testCreateVpnServerOptions() throws Throwable { CreateVpnServerOptions createVpnServerOptionsModel = new CreateVpnServerOptions.Builder() .certificate(certificateInstanceIdentityModel) - .clientAuthentication(new java.util.ArrayList(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel))) + .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) .clientIpPool("172.16.0.0/16") - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) - .clientDnsServerIps(new java.util.ArrayList(java.util.Arrays.asList(ipModel))) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .clientDnsServerIps(java.util.Arrays.asList(ipModel)) .clientIdleTimeout(Long.valueOf("600")) .enableSplitTunneling(false) .name("my-vpn-server") .port(Long.valueOf("443")) .protocol("udp") .resourceGroup(resourceGroupIdentityModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); assertEquals(createVpnServerOptionsModel.certificate(), certificateInstanceIdentityModel); - assertEquals(createVpnServerOptionsModel.clientAuthentication(), new java.util.ArrayList(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel))); + assertEquals(createVpnServerOptionsModel.clientAuthentication(), java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)); assertEquals(createVpnServerOptionsModel.clientIpPool(), "172.16.0.0/16"); - assertEquals(createVpnServerOptionsModel.subnets(), new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))); - assertEquals(createVpnServerOptionsModel.clientDnsServerIps(), new java.util.ArrayList(java.util.Arrays.asList(ipModel))); + assertEquals(createVpnServerOptionsModel.subnets(), java.util.Arrays.asList(subnetIdentityModel)); + assertEquals(createVpnServerOptionsModel.clientDnsServerIps(), java.util.Arrays.asList(ipModel)); assertEquals(createVpnServerOptionsModel.clientIdleTimeout(), Long.valueOf("600")); assertEquals(createVpnServerOptionsModel.enableSplitTunneling(), Boolean.valueOf(false)); assertEquals(createVpnServerOptionsModel.name(), "my-vpn-server"); assertEquals(createVpnServerOptionsModel.port(), Long.valueOf("443")); assertEquals(createVpnServerOptionsModel.protocol(), "udp"); assertEquals(createVpnServerOptionsModel.resourceGroup(), resourceGroupIdentityModel); - assertEquals(createVpnServerOptionsModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(createVpnServerOptionsModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollectionTest.java index 48aeea0ece..be0f7812d3 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostCollectionTest.java @@ -33,8 +33,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDiskCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDiskCollectionTest.java index 58240a8f81..2bdbbd6c93 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDiskCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostDiskCollectionTest.java @@ -21,8 +21,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollectionTest.java index ec50ab78dd..b6944b6148 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostGroupCollectionTest.java @@ -26,8 +26,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollectionTest.java index 336b475bbe..305d6caefd 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileCollectionTest.java @@ -30,8 +30,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskTest.java index b2d208d293..df25057a58 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileDiskTest.java @@ -21,8 +21,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileTest.java index ac99f3f57f..ae943560b6 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostProfileTest.java @@ -27,8 +27,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostTest.java index 11fe1f256e..3d9ec38e37 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DedicatedHostTest.java @@ -30,8 +30,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DefaultNetworkACLTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DefaultNetworkACLTest.java index 4711ac25c3..349d80804e 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DefaultNetworkACLTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DefaultNetworkACLTest.java @@ -14,7 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.DefaultNetworkACL; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolICMP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerOptionsTest.java index 7e8161a7d0..2be61ad256 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteLoadBalancerOptionsTest.java @@ -33,8 +33,10 @@ public class DeleteLoadBalancerOptionsTest { public void testDeleteLoadBalancerOptions() throws Throwable { DeleteLoadBalancerOptions deleteLoadBalancerOptionsModel = new DeleteLoadBalancerOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); assertEquals(deleteLoadBalancerOptionsModel.id(), "testString"); + assertEquals(deleteLoadBalancerOptionsModel.ifMatch(), "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\""); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollectionTest.java index 9cb43861f3..69476a95f9 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayCollectionTest.java @@ -29,8 +29,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollectionTest.java index e166ea6051..fee7b94a37 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyCollectionTest.java @@ -24,8 +24,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollectionTest.java index 428317c9ff..800f95b877 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyCollectionTest.java @@ -24,8 +24,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyPatchTest.java index 7c01282a36..c9b3651893 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyPatchTest.java @@ -33,13 +33,13 @@ public class IPsecPolicyPatchTest { @Test public void testIPsecPolicyPatch() throws Throwable { IPsecPolicyPatch iPsecPolicyPatchModel = new IPsecPolicyPatch.Builder() - .authenticationAlgorithm("md5") + .authenticationAlgorithm("disabled") .encryptionAlgorithm("aes128") .keyLifetime(Long.valueOf("3600")) .name("my-ipsec-policy") .pfs("disabled") .build(); - assertEquals(iPsecPolicyPatchModel.authenticationAlgorithm(), "md5"); + assertEquals(iPsecPolicyPatchModel.authenticationAlgorithm(), "disabled"); assertEquals(iPsecPolicyPatchModel.encryptionAlgorithm(), "aes128"); assertEquals(iPsecPolicyPatchModel.keyLifetime(), Long.valueOf("3600")); assertEquals(iPsecPolicyPatchModel.name(), "my-ipsec-policy"); @@ -49,7 +49,7 @@ public void testIPsecPolicyPatch() throws Throwable { IPsecPolicyPatch iPsecPolicyPatchModelNew = TestUtilities.deserialize(json, IPsecPolicyPatch.class); assertTrue(iPsecPolicyPatchModelNew instanceof IPsecPolicyPatch); - assertEquals(iPsecPolicyPatchModelNew.authenticationAlgorithm(), "md5"); + assertEquals(iPsecPolicyPatchModelNew.authenticationAlgorithm(), "disabled"); assertEquals(iPsecPolicyPatchModelNew.encryptionAlgorithm(), "aes128"); assertEquals(iPsecPolicyPatchModelNew.keyLifetime(), Long.valueOf("3600")); assertEquals(iPsecPolicyPatchModelNew.name(), "my-ipsec-policy"); @@ -58,7 +58,7 @@ public void testIPsecPolicyPatch() throws Throwable { @Test public void testIPsecPolicyPatchAsPatch() throws Throwable { IPsecPolicyPatch iPsecPolicyPatchModel = new IPsecPolicyPatch.Builder() - .authenticationAlgorithm("md5") + .authenticationAlgorithm("disabled") .encryptionAlgorithm("aes128") .keyLifetime(Long.valueOf("3600")) .name("my-ipsec-policy") @@ -67,7 +67,7 @@ public void testIPsecPolicyPatchAsPatch() throws Throwable { Map mergePatch = iPsecPolicyPatchModel.asPatch(); - assertEquals(mergePatch.get("authentication_algorithm"), "md5"); + assertEquals(mergePatch.get("authentication_algorithm"), "disabled"); assertEquals(mergePatch.get("encryption_algorithm"), "aes128"); assertTrue(mergePatch.containsKey("key_lifetime")); assertEquals(mergePatch.get("name"), "my-ipsec-policy"); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageCatalogOfferingTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageCatalogOfferingTest.java new file mode 100644 index 0000000000..5920e5de3b --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageCatalogOfferingTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionReference; +import com.ibm.cloud.is.vpc.v1.model.ImageCatalogOffering; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ImageCatalogOffering model. + */ +public class ImageCatalogOfferingTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testImageCatalogOffering() throws Throwable { + ImageCatalogOffering imageCatalogOfferingModel = new ImageCatalogOffering(); + assertNull(imageCatalogOfferingModel.isManaged()); + assertNull(imageCatalogOfferingModel.getVersion()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionTest.java index 4b06eadd70..262816b2a9 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionTest.java @@ -13,8 +13,10 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionReference; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyReference; import com.ibm.cloud.is.vpc.v1.model.Image; +import com.ibm.cloud.is.vpc.v1.model.ImageCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.ImageCollection; import com.ibm.cloud.is.vpc.v1.model.ImageCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.ImageCollectionNext; @@ -29,8 +31,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageTest.java index 13fb356238..fd0c2de71c 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageTest.java @@ -13,8 +13,10 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionReference; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyReference; import com.ibm.cloud.is.vpc.v1.model.Image; +import com.ibm.cloud.is.vpc.v1.model.ImageCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.ImageFile; import com.ibm.cloud.is.vpc.v1.model.ImageFileChecksums; import com.ibm.cloud.is.vpc.v1.model.ImageStatusReason; @@ -40,6 +42,7 @@ public class ImageTest { @Test public void testImage() throws Throwable { Image imageModel = new Image(); + assertNull(imageModel.getCatalogOffering()); assertNull(imageModel.getCreatedAt()); assertNull(imageModel.getCrn()); assertNull(imageModel.getEncryption()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeCatalogOfferingByOfferingTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeCatalogOfferingByOfferingTest.java new file mode 100644 index 0000000000..6eed2e0096 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeCatalogOfferingByOfferingTest.java @@ -0,0 +1,57 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingIdentityCatalogOfferingByCRN; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototypeCatalogOfferingByOffering; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceCatalogOfferingPrototypeCatalogOfferingByOffering model. + */ +public class InstanceCatalogOfferingPrototypeCatalogOfferingByOfferingTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceCatalogOfferingPrototypeCatalogOfferingByOffering() throws Throwable { + CatalogOfferingIdentityCatalogOfferingByCRN catalogOfferingIdentityModel = new CatalogOfferingIdentityCatalogOfferingByCRN.Builder() + .crn("crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442") + .build(); + assertEquals(catalogOfferingIdentityModel.crn(), "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442"); + + InstanceCatalogOfferingPrototypeCatalogOfferingByOffering instanceCatalogOfferingPrototypeCatalogOfferingByOfferingModel = new InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.Builder() + .offering(catalogOfferingIdentityModel) + .build(); + assertEquals(instanceCatalogOfferingPrototypeCatalogOfferingByOfferingModel.offering(), catalogOfferingIdentityModel); + + String json = TestUtilities.serialize(instanceCatalogOfferingPrototypeCatalogOfferingByOfferingModel); + + InstanceCatalogOfferingPrototypeCatalogOfferingByOffering instanceCatalogOfferingPrototypeCatalogOfferingByOfferingModelNew = TestUtilities.deserialize(json, InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.class); + assertTrue(instanceCatalogOfferingPrototypeCatalogOfferingByOfferingModelNew instanceof InstanceCatalogOfferingPrototypeCatalogOfferingByOffering); + assertEquals(instanceCatalogOfferingPrototypeCatalogOfferingByOfferingModelNew.offering().toString(), catalogOfferingIdentityModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testInstanceCatalogOfferingPrototypeCatalogOfferingByOfferingError() throws Throwable { + new InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeCatalogOfferingByVersionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeCatalogOfferingByVersionTest.java new file mode 100644 index 0000000000..573b55a4bb --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeCatalogOfferingByVersionTest.java @@ -0,0 +1,57 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototypeCatalogOfferingByVersion; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceCatalogOfferingPrototypeCatalogOfferingByVersion model. + */ +public class InstanceCatalogOfferingPrototypeCatalogOfferingByVersionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceCatalogOfferingPrototypeCatalogOfferingByVersion() throws Throwable { + CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN catalogOfferingVersionIdentityModel = new CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.Builder() + .crn("crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d") + .build(); + assertEquals(catalogOfferingVersionIdentityModel.crn(), "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"); + + InstanceCatalogOfferingPrototypeCatalogOfferingByVersion instanceCatalogOfferingPrototypeCatalogOfferingByVersionModel = new InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.Builder() + .version(catalogOfferingVersionIdentityModel) + .build(); + assertEquals(instanceCatalogOfferingPrototypeCatalogOfferingByVersionModel.version(), catalogOfferingVersionIdentityModel); + + String json = TestUtilities.serialize(instanceCatalogOfferingPrototypeCatalogOfferingByVersionModel); + + InstanceCatalogOfferingPrototypeCatalogOfferingByVersion instanceCatalogOfferingPrototypeCatalogOfferingByVersionModelNew = TestUtilities.deserialize(json, InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.class); + assertTrue(instanceCatalogOfferingPrototypeCatalogOfferingByVersionModelNew instanceof InstanceCatalogOfferingPrototypeCatalogOfferingByVersion); + assertEquals(instanceCatalogOfferingPrototypeCatalogOfferingByVersionModelNew.version().toString(), catalogOfferingVersionIdentityModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testInstanceCatalogOfferingPrototypeCatalogOfferingByVersionError() throws Throwable { + new InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeTest.java new file mode 100644 index 0000000000..2d46be3413 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingPrototypeTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingIdentityCatalogOfferingByCRN; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceCatalogOfferingPrototype model. + */ +public class InstanceCatalogOfferingPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testInstanceCatalogOfferingPrototype() throws Throwable { + InstanceCatalogOfferingPrototype instanceCatalogOfferingPrototypeModel = new InstanceCatalogOfferingPrototype(); + assertNotNull(instanceCatalogOfferingPrototypeModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingTest.java new file mode 100644 index 0000000000..cd54d6e907 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCatalogOfferingTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionReference; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOffering; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceCatalogOffering model. + */ +public class InstanceCatalogOfferingTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceCatalogOffering() throws Throwable { + InstanceCatalogOffering instanceCatalogOfferingModel = new InstanceCatalogOffering(); + assertNull(instanceCatalogOfferingModel.getVersion()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionTest.java index 5297adc8c9..01a3e01e99 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionTest.java @@ -13,6 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionReference; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostGroupReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostReference; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostReferenceDeleted; @@ -20,6 +21,7 @@ import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.Instance; import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPolicy; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.InstanceCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.InstanceCollectionNext; @@ -30,6 +32,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileReference; import com.ibm.cloud.is.vpc.v1.model.InstanceStatusReason; import com.ibm.cloud.is.vpc.v1.model.InstanceVCPU; +import com.ibm.cloud.is.vpc.v1.model.LifecycleReason; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceInstanceContextReference; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceInstanceContextReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ReservedIPReference; @@ -49,8 +52,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollectionTest.java index fa516e5dfc..9488029543 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupCollectionTest.java @@ -32,8 +32,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollectionTest.java index 7de2b799a0..2f5f6a0cf0 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerCollectionTest.java @@ -23,8 +23,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupPatchTest.java index 33d13dd14d..01171b3309 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupPatchTest.java @@ -21,8 +21,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -65,7 +63,7 @@ public void testInstanceGroupPatch() throws Throwable { .loadBalancerPool(loadBalancerPoolIdentityModel) .membershipCount(Long.valueOf("10")) .name("my-instance-group") - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) .build(); assertEquals(instanceGroupPatchModel.applicationPort(), Long.valueOf("22")); assertEquals(instanceGroupPatchModel.instanceTemplate(), instanceTemplateIdentityModel); @@ -73,7 +71,7 @@ public void testInstanceGroupPatch() throws Throwable { assertEquals(instanceGroupPatchModel.loadBalancerPool(), loadBalancerPoolIdentityModel); assertEquals(instanceGroupPatchModel.membershipCount(), Long.valueOf("10")); assertEquals(instanceGroupPatchModel.name(), "my-instance-group"); - assertEquals(instanceGroupPatchModel.subnets(), new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))); + assertEquals(instanceGroupPatchModel.subnets(), java.util.Arrays.asList(subnetIdentityModel)); String json = TestUtilities.serialize(instanceGroupPatchModel); @@ -111,7 +109,7 @@ public void testInstanceGroupPatchAsPatch() throws Throwable { .loadBalancerPool(loadBalancerPoolIdentityModel) .membershipCount(Long.valueOf("10")) .name("my-instance-group") - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) .build(); Map mergePatch = instanceGroupPatchModel.asPatch(); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollectionTest.java index 782b585902..8a3aa28b82 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollectionTest.java @@ -33,8 +33,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskTest.java index cb8322f0f3..a9d263960c 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileDiskTest.java @@ -20,8 +20,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileTest.java index 5734a415e6..2b8ed2d4f1 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileTest.java @@ -32,8 +32,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingTest.java new file mode 100644 index 0000000000..453be631b0 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingTest.java @@ -0,0 +1,260 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingIdentityCatalogOfferingByCRN; +import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototypeCatalogOfferingByOffering; +import com.ibm.cloud.is.vpc.v1.model.InstanceDefaultTrustedProfilePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; +import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByCatalogOffering; +import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; +import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; +import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; +import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; +import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityTrustedProfileById; +import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; +import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeInstanceByImageContext; +import com.ibm.cloud.is.vpc.v1.model.ZoneIdentityByName; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstancePrototypeInstanceByCatalogOffering model. + */ +public class InstancePrototypeInstanceByCatalogOfferingTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstancePrototypeInstanceByCatalogOffering() throws Throwable { + InstanceAvailabilityPrototype instanceAvailabilityPrototypeModel = new InstanceAvailabilityPrototype.Builder() + .hostFailure("restart") + .build(); + assertEquals(instanceAvailabilityPrototypeModel.hostFailure(), "restart"); + + TrustedProfileIdentityTrustedProfileById trustedProfileIdentityModel = new TrustedProfileIdentityTrustedProfileById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + assertEquals(trustedProfileIdentityModel.id(), "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"); + + InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototypeModel = new InstanceDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + assertEquals(instanceDefaultTrustedProfilePrototypeModel.autoLink(), Boolean.valueOf(false)); + assertEquals(instanceDefaultTrustedProfilePrototypeModel.target(), trustedProfileIdentityModel); + + KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() + .id("a6b1a881-2ce8-41a3-80fc-36316a73f803") + .build(); + assertEquals(keyIdentityModel.id(), "a6b1a881-2ce8-41a3-80fc-36316a73f803"); + + InstanceMetadataServicePrototype instanceMetadataServicePrototypeModel = new InstanceMetadataServicePrototype.Builder() + .enabled(false) + .build(); + assertEquals(instanceMetadataServicePrototypeModel.enabled(), Boolean.valueOf(false)); + + NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + assertEquals(networkInterfaceIpPrototypeModel.address(), "10.0.0.5"); + assertEquals(networkInterfaceIpPrototypeModel.autoDelete(), Boolean.valueOf(false)); + assertEquals(networkInterfaceIpPrototypeModel.name(), "my-reserved-ip"); + + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + assertEquals(securityGroupIdentityModel.id(), "be5df5ca-12a0-494b-907e-aa6ec2bfa271"); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + assertEquals(subnetIdentityModel.id(), "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"); + + NetworkInterfacePrototype networkInterfacePrototypeModel = new NetworkInterfacePrototype.Builder() + .allowIpSpoofing(true) + .name("my-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); + assertEquals(networkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); + assertEquals(networkInterfacePrototypeModel.name(), "my-network-interface"); + assertEquals(networkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); + assertEquals(networkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); + assertEquals(networkInterfacePrototypeModel.subnet(), subnetIdentityModel); + + InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() + .id("1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); + assertEquals(instancePlacementTargetPrototypeModel.id(), "1e09281b-f177-46fb-baf1-bc152b2e391a"); + + InstanceProfileIdentityByName instanceProfileIdentityModel = new InstanceProfileIdentityByName.Builder() + .name("cx2-16x32") + .build(); + assertEquals(instanceProfileIdentityModel.name(), "cx2-16x32"); + + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + + VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById volumeAttachmentVolumePrototypeInstanceContextModel = new VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.Builder() + .id("1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .build(); + assertEquals(volumeAttachmentVolumePrototypeInstanceContextModel.id(), "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"); + + VolumeAttachmentPrototypeInstanceContext volumeAttachmentPrototypeInstanceContextModel = new VolumeAttachmentPrototypeInstanceContext.Builder() + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumeAttachmentVolumePrototypeInstanceContextModel) + .build(); + assertEquals(volumeAttachmentPrototypeInstanceContextModel.deleteVolumeOnInstanceDelete(), Boolean.valueOf(true)); + assertEquals(volumeAttachmentPrototypeInstanceContextModel.name(), "my-volume-attachment"); + assertEquals(volumeAttachmentPrototypeInstanceContextModel.volume(), volumeAttachmentVolumePrototypeInstanceContextModel); + + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + assertEquals(vpcIdentityModel.id(), "4727d842-f94f-4a2d-824a-9bc9b02c523b"); + + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + assertEquals(encryptionKeyIdentityModel.crn(), "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"); + + VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() + .name("general-purpose") + .build(); + assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); + + VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .capacity(Long.valueOf("250")) + .encryptionKey(encryptionKeyIdentityModel) + .iops(Long.valueOf("10000")) + .name("my-volume") + .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) + .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("250")); + assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); + assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); + assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); + + VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumePrototypeInstanceByImageContextModel) + .build(); + assertEquals(volumeAttachmentPrototypeInstanceByImageContextModel.deleteVolumeOnInstanceDelete(), Boolean.valueOf(true)); + assertEquals(volumeAttachmentPrototypeInstanceByImageContextModel.name(), "my-volume-attachment"); + assertEquals(volumeAttachmentPrototypeInstanceByImageContextModel.volume(), volumePrototypeInstanceByImageContextModel); + + CatalogOfferingIdentityCatalogOfferingByCRN catalogOfferingIdentityModel = new CatalogOfferingIdentityCatalogOfferingByCRN.Builder() + .crn("crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442") + .build(); + assertEquals(catalogOfferingIdentityModel.crn(), "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442"); + + InstanceCatalogOfferingPrototypeCatalogOfferingByOffering instanceCatalogOfferingPrototypeModel = new InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.Builder() + .offering(catalogOfferingIdentityModel) + .build(); + assertEquals(instanceCatalogOfferingPrototypeModel.offering(), catalogOfferingIdentityModel); + + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + assertEquals(zoneIdentityModel.name(), "us-south-1"); + + InstancePrototypeInstanceByCatalogOffering instancePrototypeInstanceByCatalogOfferingModel = new InstancePrototypeInstanceByCatalogOffering.Builder() + .availabilityPolicy(instanceAvailabilityPrototypeModel) + .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .metadataService(instanceMetadataServicePrototypeModel) + .name("my-instance") + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) + .placementTarget(instancePlacementTargetPrototypeModel) + .profile(instanceProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .totalVolumeBandwidth(Long.valueOf("500")) + .userData("testString") + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) + .vpc(vpcIdentityModel) + .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) + .catalogOffering(instanceCatalogOfferingPrototypeModel) + .primaryNetworkInterface(networkInterfacePrototypeModel) + .zone(zoneIdentityModel) + .build(); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.availabilityPolicy(), instanceAvailabilityPrototypeModel); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.keys(), java.util.Arrays.asList(keyIdentityModel)); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.metadataService(), instanceMetadataServicePrototypeModel); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.name(), "my-instance"); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.placementTarget(), instancePlacementTargetPrototypeModel); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.profile(), instanceProfileIdentityModel); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.resourceGroup(), resourceGroupIdentityModel); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.userData(), "testString"); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.vpc(), vpcIdentityModel); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.primaryNetworkInterface(), networkInterfacePrototypeModel); + assertEquals(instancePrototypeInstanceByCatalogOfferingModel.zone(), zoneIdentityModel); + + String json = TestUtilities.serialize(instancePrototypeInstanceByCatalogOfferingModel); + + InstancePrototypeInstanceByCatalogOffering instancePrototypeInstanceByCatalogOfferingModelNew = TestUtilities.deserialize(json, InstancePrototypeInstanceByCatalogOffering.class); + assertTrue(instancePrototypeInstanceByCatalogOfferingModelNew instanceof InstancePrototypeInstanceByCatalogOffering); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.availabilityPolicy().toString(), instanceAvailabilityPrototypeModel.toString()); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.defaultTrustedProfile().toString(), instanceDefaultTrustedProfilePrototypeModel.toString()); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.metadataService().toString(), instanceMetadataServicePrototypeModel.toString()); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.name(), "my-instance"); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.placementTarget().toString(), instancePlacementTargetPrototypeModel.toString()); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.profile().toString(), instanceProfileIdentityModel.toString()); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.userData(), "testString"); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.vpc().toString(), vpcIdentityModel.toString()); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.primaryNetworkInterface().toString(), networkInterfacePrototypeModel.toString()); + assertEquals(instancePrototypeInstanceByCatalogOfferingModelNew.zone().toString(), zoneIdentityModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testInstancePrototypeInstanceByCatalogOfferingError() throws Throwable { + new InstancePrototypeInstanceByCatalogOffering.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageTest.java index bfcf9cdf3c..5eea67da1e 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageTest.java @@ -38,8 +38,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -104,13 +102,13 @@ public void testInstancePrototypeInstanceByImage() throws Throwable { .allowIpSpoofing(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); assertEquals(networkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); assertEquals(networkInterfacePrototypeModel.name(), "my-network-interface"); assertEquals(networkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(networkInterfacePrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(networkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(networkInterfacePrototypeModel.subnet(), subnetIdentityModel); InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() @@ -163,12 +161,14 @@ public void testInstancePrototypeInstanceByImage() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("250")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() .deleteVolumeOnInstanceDelete(true) @@ -192,16 +192,16 @@ public void testInstancePrototypeInstanceByImage() throws Throwable { InstancePrototypeInstanceByImage instancePrototypeInstanceByImageModel = new InstancePrototypeInstanceByImage.Builder() .availabilityPolicy(instanceAvailabilityPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) + .keys(java.util.Arrays.asList(keyIdentityModel)) .metadataService(instanceMetadataServicePrototypeModel) .name("my-instance") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))) + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) .placementTarget(instancePlacementTargetPrototypeModel) .profile(instanceProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") - .volumeAttachments(new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))) + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .image(imageIdentityModel) @@ -210,16 +210,16 @@ public void testInstancePrototypeInstanceByImage() throws Throwable { .build(); assertEquals(instancePrototypeInstanceByImageModel.availabilityPolicy(), instanceAvailabilityPrototypeModel); assertEquals(instancePrototypeInstanceByImageModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); - assertEquals(instancePrototypeInstanceByImageModel.keys(), new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))); + assertEquals(instancePrototypeInstanceByImageModel.keys(), java.util.Arrays.asList(keyIdentityModel)); assertEquals(instancePrototypeInstanceByImageModel.metadataService(), instanceMetadataServicePrototypeModel); assertEquals(instancePrototypeInstanceByImageModel.name(), "my-instance"); - assertEquals(instancePrototypeInstanceByImageModel.networkInterfaces(), new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))); + assertEquals(instancePrototypeInstanceByImageModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); assertEquals(instancePrototypeInstanceByImageModel.placementTarget(), instancePlacementTargetPrototypeModel); assertEquals(instancePrototypeInstanceByImageModel.profile(), instanceProfileIdentityModel); assertEquals(instancePrototypeInstanceByImageModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeInstanceByImageModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceByImageModel.userData(), "testString"); - assertEquals(instancePrototypeInstanceByImageModel.volumeAttachments(), new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))); + assertEquals(instancePrototypeInstanceByImageModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)); assertEquals(instancePrototypeInstanceByImageModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeInstanceByImageModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instancePrototypeInstanceByImageModel.image(), imageIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotTest.java index 467b1a728a..3507965f6b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotTest.java @@ -38,8 +38,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -104,13 +102,13 @@ public void testInstancePrototypeInstanceBySourceSnapshot() throws Throwable { .allowIpSpoofing(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); assertEquals(networkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); assertEquals(networkInterfacePrototypeModel.name(), "my-network-interface"); assertEquals(networkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(networkInterfacePrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(networkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(networkInterfacePrototypeModel.subnet(), subnetIdentityModel); InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() @@ -169,6 +167,7 @@ public void testInstancePrototypeInstanceBySourceSnapshot() throws Throwable { .name("my-volume") .profile(volumeProfileIdentityModel) .sourceSnapshot(snapshotIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -176,6 +175,7 @@ public void testInstancePrototypeInstanceBySourceSnapshot() throws Throwable { assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.profile(), volumeProfileIdentityModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.sourceSnapshot(), snapshotIdentityModel); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceBySourceSnapshotContext volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel = new VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.Builder() .deleteVolumeOnInstanceDelete(true) @@ -194,16 +194,16 @@ public void testInstancePrototypeInstanceBySourceSnapshot() throws Throwable { InstancePrototypeInstanceBySourceSnapshot instancePrototypeInstanceBySourceSnapshotModel = new InstancePrototypeInstanceBySourceSnapshot.Builder() .availabilityPolicy(instanceAvailabilityPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) + .keys(java.util.Arrays.asList(keyIdentityModel)) .metadataService(instanceMetadataServicePrototypeModel) .name("my-instance") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))) + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) .placementTarget(instancePlacementTargetPrototypeModel) .profile(instanceProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") - .volumeAttachments(new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))) + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel) .primaryNetworkInterface(networkInterfacePrototypeModel) @@ -211,16 +211,16 @@ public void testInstancePrototypeInstanceBySourceSnapshot() throws Throwable { .build(); assertEquals(instancePrototypeInstanceBySourceSnapshotModel.availabilityPolicy(), instanceAvailabilityPrototypeModel); assertEquals(instancePrototypeInstanceBySourceSnapshotModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); - assertEquals(instancePrototypeInstanceBySourceSnapshotModel.keys(), new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))); + assertEquals(instancePrototypeInstanceBySourceSnapshotModel.keys(), java.util.Arrays.asList(keyIdentityModel)); assertEquals(instancePrototypeInstanceBySourceSnapshotModel.metadataService(), instanceMetadataServicePrototypeModel); assertEquals(instancePrototypeInstanceBySourceSnapshotModel.name(), "my-instance"); - assertEquals(instancePrototypeInstanceBySourceSnapshotModel.networkInterfaces(), new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))); + assertEquals(instancePrototypeInstanceBySourceSnapshotModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); assertEquals(instancePrototypeInstanceBySourceSnapshotModel.placementTarget(), instancePlacementTargetPrototypeModel); assertEquals(instancePrototypeInstanceBySourceSnapshotModel.profile(), instanceProfileIdentityModel); assertEquals(instancePrototypeInstanceBySourceSnapshotModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeInstanceBySourceSnapshotModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceBySourceSnapshotModel.userData(), "testString"); - assertEquals(instancePrototypeInstanceBySourceSnapshotModel.volumeAttachments(), new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))); + assertEquals(instancePrototypeInstanceBySourceSnapshotModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)); assertEquals(instancePrototypeInstanceBySourceSnapshotModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeInstanceBySourceSnapshotModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel); assertEquals(instancePrototypeInstanceBySourceSnapshotModel.primaryNetworkInterface(), networkInterfacePrototypeModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplateTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplateTest.java index 504f0181a0..e1da6dda4b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplateTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplateTest.java @@ -13,9 +13,11 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingIdentityCatalogOfferingByCRN; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.ImageIdentityById; import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototypeCatalogOfferingByOffering; import com.ibm.cloud.is.vpc.v1.model.InstanceDefaultTrustedProfilePrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; @@ -39,8 +41,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -105,13 +105,13 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { .allowIpSpoofing(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); assertEquals(networkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); assertEquals(networkInterfacePrototypeModel.name(), "my-network-interface"); assertEquals(networkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(networkInterfacePrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(networkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(networkInterfacePrototypeModel.subnet(), subnetIdentityModel); InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() @@ -164,12 +164,14 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("250")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() .deleteVolumeOnInstanceDelete(true) @@ -180,6 +182,16 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { assertEquals(volumeAttachmentPrototypeInstanceByImageContextModel.name(), "my-volume-attachment"); assertEquals(volumeAttachmentPrototypeInstanceByImageContextModel.volume(), volumePrototypeInstanceByImageContextModel); + CatalogOfferingIdentityCatalogOfferingByCRN catalogOfferingIdentityModel = new CatalogOfferingIdentityCatalogOfferingByCRN.Builder() + .crn("crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442") + .build(); + assertEquals(catalogOfferingIdentityModel.crn(), "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442"); + + InstanceCatalogOfferingPrototypeCatalogOfferingByOffering instanceCatalogOfferingPrototypeModel = new InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.Builder() + .offering(catalogOfferingIdentityModel) + .build(); + assertEquals(instanceCatalogOfferingPrototypeModel.offering(), catalogOfferingIdentityModel); + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() .id("72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") .build(); @@ -198,18 +210,19 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { InstancePrototypeInstanceBySourceTemplate instancePrototypeInstanceBySourceTemplateModel = new InstancePrototypeInstanceBySourceTemplate.Builder() .availabilityPolicy(instanceAvailabilityPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) + .keys(java.util.Arrays.asList(keyIdentityModel)) .metadataService(instanceMetadataServicePrototypeModel) .name("my-instance") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))) + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) .placementTarget(instancePlacementTargetPrototypeModel) .profile(instanceProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") - .volumeAttachments(new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))) + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) + .catalogOffering(instanceCatalogOfferingPrototypeModel) .image(imageIdentityModel) .primaryNetworkInterface(networkInterfacePrototypeModel) .sourceTemplate(instanceTemplateIdentityModel) @@ -217,18 +230,19 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { .build(); assertEquals(instancePrototypeInstanceBySourceTemplateModel.availabilityPolicy(), instanceAvailabilityPrototypeModel); assertEquals(instancePrototypeInstanceBySourceTemplateModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); - assertEquals(instancePrototypeInstanceBySourceTemplateModel.keys(), new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))); + assertEquals(instancePrototypeInstanceBySourceTemplateModel.keys(), java.util.Arrays.asList(keyIdentityModel)); assertEquals(instancePrototypeInstanceBySourceTemplateModel.metadataService(), instanceMetadataServicePrototypeModel); assertEquals(instancePrototypeInstanceBySourceTemplateModel.name(), "my-instance"); - assertEquals(instancePrototypeInstanceBySourceTemplateModel.networkInterfaces(), new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))); + assertEquals(instancePrototypeInstanceBySourceTemplateModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); assertEquals(instancePrototypeInstanceBySourceTemplateModel.placementTarget(), instancePlacementTargetPrototypeModel); assertEquals(instancePrototypeInstanceBySourceTemplateModel.profile(), instanceProfileIdentityModel); assertEquals(instancePrototypeInstanceBySourceTemplateModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeInstanceBySourceTemplateModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceBySourceTemplateModel.userData(), "testString"); - assertEquals(instancePrototypeInstanceBySourceTemplateModel.volumeAttachments(), new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))); + assertEquals(instancePrototypeInstanceBySourceTemplateModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)); assertEquals(instancePrototypeInstanceBySourceTemplateModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeInstanceBySourceTemplateModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); + assertEquals(instancePrototypeInstanceBySourceTemplateModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); assertEquals(instancePrototypeInstanceBySourceTemplateModel.image(), imageIdentityModel); assertEquals(instancePrototypeInstanceBySourceTemplateModel.primaryNetworkInterface(), networkInterfacePrototypeModel); assertEquals(instancePrototypeInstanceBySourceTemplateModel.sourceTemplate(), instanceTemplateIdentityModel); @@ -249,6 +263,7 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.userData(), "testString"); assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); + assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.image().toString(), imageIdentityModel.toString()); assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.primaryNetworkInterface().toString(), networkInterfacePrototypeModel.toString()); assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.sourceTemplate().toString(), instanceTemplateIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeTest.java index 2c42297867..897b13e18f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeTest.java @@ -38,8 +38,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionTest.java index 8714321d7a..6a8e774df1 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionTest.java @@ -42,8 +42,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingTest.java new file mode 100644 index 0000000000..3f6c937a44 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingTest.java @@ -0,0 +1,79 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingIdentityCatalogOfferingByCRN; +import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototypeCatalogOfferingByOffering; +import com.ibm.cloud.is.vpc.v1.model.InstanceDefaultTrustedProfilePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByCatalogOffering; +import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; +import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; +import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; +import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; +import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityTrustedProfileById; +import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; +import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeInstanceByImageContext; +import com.ibm.cloud.is.vpc.v1.model.ZoneIdentityByName; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceTemplateInstanceByCatalogOffering model. + */ +public class InstanceTemplateInstanceByCatalogOfferingTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceTemplateInstanceByCatalogOffering() throws Throwable { + InstanceTemplateInstanceByCatalogOffering instanceTemplateInstanceByCatalogOfferingModel = new InstanceTemplateInstanceByCatalogOffering(); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getAvailabilityPolicy()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getCreatedAt()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getCrn()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getDefaultTrustedProfile()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getHref()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getId()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getKeys()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getMetadataService()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getName()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getNetworkInterfaces()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getPlacementTarget()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getProfile()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getResourceGroup()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getTotalVolumeBandwidth()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getUserData()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getVolumeAttachments()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getVpc()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getBootVolumeAttachment()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getCatalogOffering()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getPrimaryNetworkInterface()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getZone()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageTest.java index 8aec0d04e8..4029c302c7 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageTest.java @@ -38,8 +38,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotTest.java index 4bd0b6a7ac..2d06dc94bf 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotTest.java @@ -38,8 +38,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByCatalogOfferingTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByCatalogOfferingTest.java new file mode 100644 index 0000000000..cced4d9d80 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByCatalogOfferingTest.java @@ -0,0 +1,260 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingIdentityCatalogOfferingByCRN; +import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototypeCatalogOfferingByOffering; +import com.ibm.cloud.is.vpc.v1.model.InstanceDefaultTrustedProfilePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceByCatalogOffering; +import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; +import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; +import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; +import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; +import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityTrustedProfileById; +import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; +import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeInstanceByImageContext; +import com.ibm.cloud.is.vpc.v1.model.ZoneIdentityByName; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceTemplatePrototypeInstanceByCatalogOffering model. + */ +public class InstanceTemplatePrototypeInstanceByCatalogOfferingTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceTemplatePrototypeInstanceByCatalogOffering() throws Throwable { + InstanceAvailabilityPrototype instanceAvailabilityPrototypeModel = new InstanceAvailabilityPrototype.Builder() + .hostFailure("restart") + .build(); + assertEquals(instanceAvailabilityPrototypeModel.hostFailure(), "restart"); + + TrustedProfileIdentityTrustedProfileById trustedProfileIdentityModel = new TrustedProfileIdentityTrustedProfileById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + assertEquals(trustedProfileIdentityModel.id(), "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"); + + InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototypeModel = new InstanceDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + assertEquals(instanceDefaultTrustedProfilePrototypeModel.autoLink(), Boolean.valueOf(false)); + assertEquals(instanceDefaultTrustedProfilePrototypeModel.target(), trustedProfileIdentityModel); + + KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() + .id("a6b1a881-2ce8-41a3-80fc-36316a73f803") + .build(); + assertEquals(keyIdentityModel.id(), "a6b1a881-2ce8-41a3-80fc-36316a73f803"); + + InstanceMetadataServicePrototype instanceMetadataServicePrototypeModel = new InstanceMetadataServicePrototype.Builder() + .enabled(false) + .build(); + assertEquals(instanceMetadataServicePrototypeModel.enabled(), Boolean.valueOf(false)); + + NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + assertEquals(networkInterfaceIpPrototypeModel.address(), "10.0.0.5"); + assertEquals(networkInterfaceIpPrototypeModel.autoDelete(), Boolean.valueOf(false)); + assertEquals(networkInterfaceIpPrototypeModel.name(), "my-reserved-ip"); + + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + assertEquals(securityGroupIdentityModel.id(), "be5df5ca-12a0-494b-907e-aa6ec2bfa271"); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + assertEquals(subnetIdentityModel.id(), "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"); + + NetworkInterfacePrototype networkInterfacePrototypeModel = new NetworkInterfacePrototype.Builder() + .allowIpSpoofing(true) + .name("my-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); + assertEquals(networkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); + assertEquals(networkInterfacePrototypeModel.name(), "my-network-interface"); + assertEquals(networkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); + assertEquals(networkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); + assertEquals(networkInterfacePrototypeModel.subnet(), subnetIdentityModel); + + InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() + .id("1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); + assertEquals(instancePlacementTargetPrototypeModel.id(), "1e09281b-f177-46fb-baf1-bc152b2e391a"); + + InstanceProfileIdentityByName instanceProfileIdentityModel = new InstanceProfileIdentityByName.Builder() + .name("cx2-16x32") + .build(); + assertEquals(instanceProfileIdentityModel.name(), "cx2-16x32"); + + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + + VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById volumeAttachmentVolumePrototypeInstanceContextModel = new VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.Builder() + .id("1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .build(); + assertEquals(volumeAttachmentVolumePrototypeInstanceContextModel.id(), "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"); + + VolumeAttachmentPrototypeInstanceContext volumeAttachmentPrototypeInstanceContextModel = new VolumeAttachmentPrototypeInstanceContext.Builder() + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumeAttachmentVolumePrototypeInstanceContextModel) + .build(); + assertEquals(volumeAttachmentPrototypeInstanceContextModel.deleteVolumeOnInstanceDelete(), Boolean.valueOf(true)); + assertEquals(volumeAttachmentPrototypeInstanceContextModel.name(), "my-volume-attachment"); + assertEquals(volumeAttachmentPrototypeInstanceContextModel.volume(), volumeAttachmentVolumePrototypeInstanceContextModel); + + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + assertEquals(vpcIdentityModel.id(), "4727d842-f94f-4a2d-824a-9bc9b02c523b"); + + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + assertEquals(encryptionKeyIdentityModel.crn(), "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"); + + VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() + .name("general-purpose") + .build(); + assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); + + VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .capacity(Long.valueOf("250")) + .encryptionKey(encryptionKeyIdentityModel) + .iops(Long.valueOf("10000")) + .name("my-volume") + .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) + .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("250")); + assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); + assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); + assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); + + VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumePrototypeInstanceByImageContextModel) + .build(); + assertEquals(volumeAttachmentPrototypeInstanceByImageContextModel.deleteVolumeOnInstanceDelete(), Boolean.valueOf(true)); + assertEquals(volumeAttachmentPrototypeInstanceByImageContextModel.name(), "my-volume-attachment"); + assertEquals(volumeAttachmentPrototypeInstanceByImageContextModel.volume(), volumePrototypeInstanceByImageContextModel); + + CatalogOfferingIdentityCatalogOfferingByCRN catalogOfferingIdentityModel = new CatalogOfferingIdentityCatalogOfferingByCRN.Builder() + .crn("crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442") + .build(); + assertEquals(catalogOfferingIdentityModel.crn(), "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442"); + + InstanceCatalogOfferingPrototypeCatalogOfferingByOffering instanceCatalogOfferingPrototypeModel = new InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.Builder() + .offering(catalogOfferingIdentityModel) + .build(); + assertEquals(instanceCatalogOfferingPrototypeModel.offering(), catalogOfferingIdentityModel); + + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + assertEquals(zoneIdentityModel.name(), "us-south-1"); + + InstanceTemplatePrototypeInstanceByCatalogOffering instanceTemplatePrototypeInstanceByCatalogOfferingModel = new InstanceTemplatePrototypeInstanceByCatalogOffering.Builder() + .availabilityPolicy(instanceAvailabilityPrototypeModel) + .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .metadataService(instanceMetadataServicePrototypeModel) + .name("my-instance") + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) + .placementTarget(instancePlacementTargetPrototypeModel) + .profile(instanceProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .totalVolumeBandwidth(Long.valueOf("500")) + .userData("testString") + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) + .vpc(vpcIdentityModel) + .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) + .catalogOffering(instanceCatalogOfferingPrototypeModel) + .primaryNetworkInterface(networkInterfacePrototypeModel) + .zone(zoneIdentityModel) + .build(); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.availabilityPolicy(), instanceAvailabilityPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.keys(), java.util.Arrays.asList(keyIdentityModel)); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.metadataService(), instanceMetadataServicePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.name(), "my-instance"); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.placementTarget(), instancePlacementTargetPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.profile(), instanceProfileIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.resourceGroup(), resourceGroupIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.vpc(), vpcIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.primaryNetworkInterface(), networkInterfacePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModel.zone(), zoneIdentityModel); + + String json = TestUtilities.serialize(instanceTemplatePrototypeInstanceByCatalogOfferingModel); + + InstanceTemplatePrototypeInstanceByCatalogOffering instanceTemplatePrototypeInstanceByCatalogOfferingModelNew = TestUtilities.deserialize(json, InstanceTemplatePrototypeInstanceByCatalogOffering.class); + assertTrue(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew instanceof InstanceTemplatePrototypeInstanceByCatalogOffering); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.availabilityPolicy().toString(), instanceAvailabilityPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.defaultTrustedProfile().toString(), instanceDefaultTrustedProfilePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.metadataService().toString(), instanceMetadataServicePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.name(), "my-instance"); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.placementTarget().toString(), instancePlacementTargetPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.profile().toString(), instanceProfileIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.vpc().toString(), vpcIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.primaryNetworkInterface().toString(), networkInterfacePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingModelNew.zone().toString(), zoneIdentityModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testInstanceTemplatePrototypeInstanceByCatalogOfferingError() throws Throwable { + new InstanceTemplatePrototypeInstanceByCatalogOffering.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImageTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImageTest.java index 5bb7b96a60..9ee4028ea7 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImageTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImageTest.java @@ -38,8 +38,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -104,13 +102,13 @@ public void testInstanceTemplatePrototypeInstanceByImage() throws Throwable { .allowIpSpoofing(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); assertEquals(networkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); assertEquals(networkInterfacePrototypeModel.name(), "my-network-interface"); assertEquals(networkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(networkInterfacePrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(networkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(networkInterfacePrototypeModel.subnet(), subnetIdentityModel); InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() @@ -163,12 +161,14 @@ public void testInstanceTemplatePrototypeInstanceByImage() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("250")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() .deleteVolumeOnInstanceDelete(true) @@ -192,16 +192,16 @@ public void testInstanceTemplatePrototypeInstanceByImage() throws Throwable { InstanceTemplatePrototypeInstanceByImage instanceTemplatePrototypeInstanceByImageModel = new InstanceTemplatePrototypeInstanceByImage.Builder() .availabilityPolicy(instanceAvailabilityPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) + .keys(java.util.Arrays.asList(keyIdentityModel)) .metadataService(instanceMetadataServicePrototypeModel) .name("my-instance") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))) + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) .placementTarget(instancePlacementTargetPrototypeModel) .profile(instanceProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") - .volumeAttachments(new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))) + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .image(imageIdentityModel) @@ -210,16 +210,16 @@ public void testInstanceTemplatePrototypeInstanceByImage() throws Throwable { .build(); assertEquals(instanceTemplatePrototypeInstanceByImageModel.availabilityPolicy(), instanceAvailabilityPrototypeModel); assertEquals(instanceTemplatePrototypeInstanceByImageModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceByImageModel.keys(), new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))); + assertEquals(instanceTemplatePrototypeInstanceByImageModel.keys(), java.util.Arrays.asList(keyIdentityModel)); assertEquals(instanceTemplatePrototypeInstanceByImageModel.metadataService(), instanceMetadataServicePrototypeModel); assertEquals(instanceTemplatePrototypeInstanceByImageModel.name(), "my-instance"); - assertEquals(instanceTemplatePrototypeInstanceByImageModel.networkInterfaces(), new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))); + assertEquals(instanceTemplatePrototypeInstanceByImageModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); assertEquals(instanceTemplatePrototypeInstanceByImageModel.placementTarget(), instancePlacementTargetPrototypeModel); assertEquals(instanceTemplatePrototypeInstanceByImageModel.profile(), instanceProfileIdentityModel); assertEquals(instanceTemplatePrototypeInstanceByImageModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instanceTemplatePrototypeInstanceByImageModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceByImageModel.userData(), "testString"); - assertEquals(instanceTemplatePrototypeInstanceByImageModel.volumeAttachments(), new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))); + assertEquals(instanceTemplatePrototypeInstanceByImageModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)); assertEquals(instanceTemplatePrototypeInstanceByImageModel.vpc(), vpcIdentityModel); assertEquals(instanceTemplatePrototypeInstanceByImageModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instanceTemplatePrototypeInstanceByImageModel.image(), imageIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceSnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceSnapshotTest.java new file mode 100644 index 0000000000..467150c2f6 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceSnapshotTest.java @@ -0,0 +1,253 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceDefaultTrustedProfilePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceBySourceSnapshot; +import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; +import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; +import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; +import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; +import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityTrustedProfileById; +import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; +import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeInstanceBySourceSnapshotContext; +import com.ibm.cloud.is.vpc.v1.model.ZoneIdentityByName; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceTemplatePrototypeInstanceBySourceSnapshot model. + */ +public class InstanceTemplatePrototypeInstanceBySourceSnapshotTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceTemplatePrototypeInstanceBySourceSnapshot() throws Throwable { + InstanceAvailabilityPrototype instanceAvailabilityPrototypeModel = new InstanceAvailabilityPrototype.Builder() + .hostFailure("restart") + .build(); + assertEquals(instanceAvailabilityPrototypeModel.hostFailure(), "restart"); + + TrustedProfileIdentityTrustedProfileById trustedProfileIdentityModel = new TrustedProfileIdentityTrustedProfileById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + assertEquals(trustedProfileIdentityModel.id(), "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"); + + InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototypeModel = new InstanceDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + assertEquals(instanceDefaultTrustedProfilePrototypeModel.autoLink(), Boolean.valueOf(false)); + assertEquals(instanceDefaultTrustedProfilePrototypeModel.target(), trustedProfileIdentityModel); + + KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() + .id("a6b1a881-2ce8-41a3-80fc-36316a73f803") + .build(); + assertEquals(keyIdentityModel.id(), "a6b1a881-2ce8-41a3-80fc-36316a73f803"); + + InstanceMetadataServicePrototype instanceMetadataServicePrototypeModel = new InstanceMetadataServicePrototype.Builder() + .enabled(false) + .build(); + assertEquals(instanceMetadataServicePrototypeModel.enabled(), Boolean.valueOf(false)); + + NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + assertEquals(networkInterfaceIpPrototypeModel.address(), "10.0.0.5"); + assertEquals(networkInterfaceIpPrototypeModel.autoDelete(), Boolean.valueOf(false)); + assertEquals(networkInterfaceIpPrototypeModel.name(), "my-reserved-ip"); + + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + assertEquals(securityGroupIdentityModel.id(), "be5df5ca-12a0-494b-907e-aa6ec2bfa271"); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + assertEquals(subnetIdentityModel.id(), "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"); + + NetworkInterfacePrototype networkInterfacePrototypeModel = new NetworkInterfacePrototype.Builder() + .allowIpSpoofing(true) + .name("my-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); + assertEquals(networkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); + assertEquals(networkInterfacePrototypeModel.name(), "my-network-interface"); + assertEquals(networkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); + assertEquals(networkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); + assertEquals(networkInterfacePrototypeModel.subnet(), subnetIdentityModel); + + InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() + .id("1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); + assertEquals(instancePlacementTargetPrototypeModel.id(), "1e09281b-f177-46fb-baf1-bc152b2e391a"); + + InstanceProfileIdentityByName instanceProfileIdentityModel = new InstanceProfileIdentityByName.Builder() + .name("cx2-16x32") + .build(); + assertEquals(instanceProfileIdentityModel.name(), "cx2-16x32"); + + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + + VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById volumeAttachmentVolumePrototypeInstanceContextModel = new VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.Builder() + .id("1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .build(); + assertEquals(volumeAttachmentVolumePrototypeInstanceContextModel.id(), "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"); + + VolumeAttachmentPrototypeInstanceContext volumeAttachmentPrototypeInstanceContextModel = new VolumeAttachmentPrototypeInstanceContext.Builder() + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumeAttachmentVolumePrototypeInstanceContextModel) + .build(); + assertEquals(volumeAttachmentPrototypeInstanceContextModel.deleteVolumeOnInstanceDelete(), Boolean.valueOf(true)); + assertEquals(volumeAttachmentPrototypeInstanceContextModel.name(), "my-volume-attachment"); + assertEquals(volumeAttachmentPrototypeInstanceContextModel.volume(), volumeAttachmentVolumePrototypeInstanceContextModel); + + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + assertEquals(vpcIdentityModel.id(), "4727d842-f94f-4a2d-824a-9bc9b02c523b"); + + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + assertEquals(encryptionKeyIdentityModel.crn(), "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"); + + VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() + .name("general-purpose") + .build(); + assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); + + SnapshotIdentityById snapshotIdentityModel = new SnapshotIdentityById.Builder() + .id("349a61d8-7ab1-420f-a690-5fed76ef9d4f") + .build(); + assertEquals(snapshotIdentityModel.id(), "349a61d8-7ab1-420f-a690-5fed76ef9d4f"); + + VolumePrototypeInstanceBySourceSnapshotContext volumePrototypeInstanceBySourceSnapshotContextModel = new VolumePrototypeInstanceBySourceSnapshotContext.Builder() + .capacity(Long.valueOf("100")) + .encryptionKey(encryptionKeyIdentityModel) + .iops(Long.valueOf("10000")) + .name("my-volume") + .profile(volumeProfileIdentityModel) + .sourceSnapshot(snapshotIdentityModel) + .userTags(java.util.Arrays.asList("testString")) + .build(); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.capacity(), Long.valueOf("100")); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.encryptionKey(), encryptionKeyIdentityModel); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.iops(), Long.valueOf("10000")); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.name(), "my-volume"); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.sourceSnapshot(), snapshotIdentityModel); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.userTags(), java.util.Arrays.asList("testString")); + + VolumeAttachmentPrototypeInstanceBySourceSnapshotContext volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel = new VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.Builder() + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumePrototypeInstanceBySourceSnapshotContextModel) + .build(); + assertEquals(volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel.deleteVolumeOnInstanceDelete(), Boolean.valueOf(true)); + assertEquals(volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel.name(), "my-volume-attachment"); + assertEquals(volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel.volume(), volumePrototypeInstanceBySourceSnapshotContextModel); + + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + assertEquals(zoneIdentityModel.name(), "us-south-1"); + + InstanceTemplatePrototypeInstanceBySourceSnapshot instanceTemplatePrototypeInstanceBySourceSnapshotModel = new InstanceTemplatePrototypeInstanceBySourceSnapshot.Builder() + .availabilityPolicy(instanceAvailabilityPrototypeModel) + .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .metadataService(instanceMetadataServicePrototypeModel) + .name("my-instance") + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) + .placementTarget(instancePlacementTargetPrototypeModel) + .profile(instanceProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .totalVolumeBandwidth(Long.valueOf("500")) + .userData("testString") + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) + .vpc(vpcIdentityModel) + .bootVolumeAttachment(volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel) + .primaryNetworkInterface(networkInterfacePrototypeModel) + .zone(zoneIdentityModel) + .build(); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.availabilityPolicy(), instanceAvailabilityPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.keys(), java.util.Arrays.asList(keyIdentityModel)); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.metadataService(), instanceMetadataServicePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.name(), "my-instance"); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.placementTarget(), instancePlacementTargetPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.profile(), instanceProfileIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.resourceGroup(), resourceGroupIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.vpc(), vpcIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.primaryNetworkInterface(), networkInterfacePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModel.zone(), zoneIdentityModel); + + String json = TestUtilities.serialize(instanceTemplatePrototypeInstanceBySourceSnapshotModel); + + InstanceTemplatePrototypeInstanceBySourceSnapshot instanceTemplatePrototypeInstanceBySourceSnapshotModelNew = TestUtilities.deserialize(json, InstanceTemplatePrototypeInstanceBySourceSnapshot.class); + assertTrue(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew instanceof InstanceTemplatePrototypeInstanceBySourceSnapshot); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew.availabilityPolicy().toString(), instanceAvailabilityPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew.defaultTrustedProfile().toString(), instanceDefaultTrustedProfilePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew.metadataService().toString(), instanceMetadataServicePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew.name(), "my-instance"); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew.placementTarget().toString(), instancePlacementTargetPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew.profile().toString(), instanceProfileIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew.vpc().toString(), vpcIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew.primaryNetworkInterface().toString(), networkInterfacePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotModelNew.zone().toString(), zoneIdentityModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testInstanceTemplatePrototypeInstanceBySourceSnapshotError() throws Throwable { + new InstanceTemplatePrototypeInstanceBySourceSnapshot.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplateTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplateTest.java index 43607f3750..6d98c2c460 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplateTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplateTest.java @@ -13,9 +13,11 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingIdentityCatalogOfferingByCRN; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.ImageIdentityById; import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOfferingPrototypeCatalogOfferingByOffering; import com.ibm.cloud.is.vpc.v1.model.InstanceDefaultTrustedProfilePrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; @@ -39,8 +41,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -105,13 +105,13 @@ public void testInstanceTemplatePrototypeInstanceBySourceTemplate() throws Throw .allowIpSpoofing(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); assertEquals(networkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); assertEquals(networkInterfacePrototypeModel.name(), "my-network-interface"); assertEquals(networkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(networkInterfacePrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(networkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(networkInterfacePrototypeModel.subnet(), subnetIdentityModel); InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() @@ -164,12 +164,14 @@ public void testInstanceTemplatePrototypeInstanceBySourceTemplate() throws Throw .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("250")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() .deleteVolumeOnInstanceDelete(true) @@ -180,6 +182,16 @@ public void testInstanceTemplatePrototypeInstanceBySourceTemplate() throws Throw assertEquals(volumeAttachmentPrototypeInstanceByImageContextModel.name(), "my-volume-attachment"); assertEquals(volumeAttachmentPrototypeInstanceByImageContextModel.volume(), volumePrototypeInstanceByImageContextModel); + CatalogOfferingIdentityCatalogOfferingByCRN catalogOfferingIdentityModel = new CatalogOfferingIdentityCatalogOfferingByCRN.Builder() + .crn("crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442") + .build(); + assertEquals(catalogOfferingIdentityModel.crn(), "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442"); + + InstanceCatalogOfferingPrototypeCatalogOfferingByOffering instanceCatalogOfferingPrototypeModel = new InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.Builder() + .offering(catalogOfferingIdentityModel) + .build(); + assertEquals(instanceCatalogOfferingPrototypeModel.offering(), catalogOfferingIdentityModel); + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() .id("72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") .build(); @@ -198,18 +210,19 @@ public void testInstanceTemplatePrototypeInstanceBySourceTemplate() throws Throw InstanceTemplatePrototypeInstanceBySourceTemplate instanceTemplatePrototypeInstanceBySourceTemplateModel = new InstanceTemplatePrototypeInstanceBySourceTemplate.Builder() .availabilityPolicy(instanceAvailabilityPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) + .keys(java.util.Arrays.asList(keyIdentityModel)) .metadataService(instanceMetadataServicePrototypeModel) .name("my-instance") - .networkInterfaces(new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))) + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) .placementTarget(instancePlacementTargetPrototypeModel) .profile(instanceProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") - .volumeAttachments(new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))) + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)) .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) + .catalogOffering(instanceCatalogOfferingPrototypeModel) .image(imageIdentityModel) .primaryNetworkInterface(networkInterfacePrototypeModel) .sourceTemplate(instanceTemplateIdentityModel) @@ -217,18 +230,19 @@ public void testInstanceTemplatePrototypeInstanceBySourceTemplate() throws Throw .build(); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.availabilityPolicy(), instanceAvailabilityPrototypeModel); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.keys(), new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))); + assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.keys(), java.util.Arrays.asList(keyIdentityModel)); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.metadataService(), instanceMetadataServicePrototypeModel); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.name(), "my-instance"); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.networkInterfaces(), new java.util.ArrayList(java.util.Arrays.asList(networkInterfacePrototypeModel))); + assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.placementTarget(), instancePlacementTargetPrototypeModel); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.profile(), instanceProfileIdentityModel); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.userData(), "testString"); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.volumeAttachments(), new java.util.ArrayList(java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel))); + assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeInstanceContextModel)); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.vpc(), vpcIdentityModel); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); + assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.image(), imageIdentityModel); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.primaryNetworkInterface(), networkInterfacePrototypeModel); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.sourceTemplate(), instanceTemplateIdentityModel); @@ -249,6 +263,7 @@ public void testInstanceTemplatePrototypeInstanceBySourceTemplate() throws Throw assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.userData(), "testString"); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.image().toString(), imageIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.primaryNetworkInterface().toString(), networkInterfacePrototypeModel.toString()); assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.sourceTemplate().toString(), instanceTemplateIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeTest.java index daea7e83b5..9a510f8fb5 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeTest.java @@ -38,8 +38,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateTest.java index ada3315936..cb947838bc 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateTest.java @@ -38,8 +38,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTest.java index fbba80031f..9f40e87cbe 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTest.java @@ -13,6 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionReference; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostGroupReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostReference; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostReferenceDeleted; @@ -20,6 +21,7 @@ import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.Instance; import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPolicy; +import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.InstanceDisk; import com.ibm.cloud.is.vpc.v1.model.InstanceGPU; import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataService; @@ -27,6 +29,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileReference; import com.ibm.cloud.is.vpc.v1.model.InstanceStatusReason; import com.ibm.cloud.is.vpc.v1.model.InstanceVCPU; +import com.ibm.cloud.is.vpc.v1.model.LifecycleReason; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceInstanceContextReference; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceInstanceContextReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ReservedIPReference; @@ -64,6 +67,7 @@ public void testInstance() throws Throwable { assertNull(instanceModel.getAvailabilityPolicy()); assertNull(instanceModel.getBandwidth()); assertNull(instanceModel.getBootVolumeAttachment()); + assertNull(instanceModel.getCatalogOffering()); assertNull(instanceModel.getCreatedAt()); assertNull(instanceModel.getCrn()); assertNull(instanceModel.getDedicatedHost()); @@ -72,6 +76,8 @@ public void testInstance() throws Throwable { assertNull(instanceModel.getHref()); assertNull(instanceModel.getId()); assertNull(instanceModel.getImage()); + assertNull(instanceModel.getLifecycleReasons()); + assertNull(instanceModel.getLifecycleState()); assertNull(instanceModel.getMemory()); assertNull(instanceModel.getMetadataService()); assertNull(instanceModel.getName()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LifecycleReasonTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LifecycleReasonTest.java new file mode 100644 index 0000000000..96d89f0cb5 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LifecycleReasonTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.LifecycleReason; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the LifecycleReason model. + */ +public class LifecycleReasonTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testLifecycleReason() throws Throwable { + LifecycleReason lifecycleReasonModel = new LifecycleReason(); + assertNull(lifecycleReasonModel.getCode()); + assertNull(lifecycleReasonModel.getMessage()); + assertNull(lifecycleReasonModel.getMoreInfo()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewaysOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewaysOptionsTest.java index 72a503684d..febec85c0c 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewaysOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewaysOptionsTest.java @@ -35,11 +35,13 @@ public void testListVpnGatewaysOptions() throws Throwable { .start("testString") .limit(Long.valueOf("1")) .resourceGroupId("testString") + .sort("name") .mode("route") .build(); assertEquals(listVpnGatewaysOptionsModel.start(), "testString"); assertEquals(listVpnGatewaysOptionsModel.limit(), Long.valueOf("1")); assertEquals(listVpnGatewaysOptionsModel.resourceGroupId(), "testString"); + assertEquals(listVpnGatewaysOptionsModel.sort(), "name"); assertEquals(listVpnGatewaysOptionsModel.mode(), "route"); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollectionTest.java index c7d13700f1..ad5de6c94a 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerCollectionTest.java @@ -36,8 +36,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerCollectionTest.java index ab570fbe0c..f9a71636ee 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerCollectionTest.java @@ -27,8 +27,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyCollectionTest.java index 613972ff5d..abf2c6e7df 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyCollectionTest.java @@ -23,8 +23,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyPrototypeTest.java index 238f4d2e05..c47f963dde 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPolicyPrototypeTest.java @@ -19,8 +19,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -55,13 +53,13 @@ public void testLoadBalancerListenerPolicyPrototype() throws Throwable { .action("forward") .name("my-policy") .priority(Long.valueOf("5")) - .rules(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel))) + .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) .target(loadBalancerListenerPolicyTargetPrototypeModel) .build(); assertEquals(loadBalancerListenerPolicyPrototypeModel.action(), "forward"); assertEquals(loadBalancerListenerPolicyPrototypeModel.name(), "my-policy"); assertEquals(loadBalancerListenerPolicyPrototypeModel.priority(), Long.valueOf("5")); - assertEquals(loadBalancerListenerPolicyPrototypeModel.rules(), new java.util.ArrayList(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel))); + assertEquals(loadBalancerListenerPolicyPrototypeModel.rules(), java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)); assertEquals(loadBalancerListenerPolicyPrototypeModel.target(), loadBalancerListenerPolicyTargetPrototypeModel); String json = TestUtilities.serialize(loadBalancerListenerPolicyPrototypeModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPrototypeLoadBalancerContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPrototypeLoadBalancerContextTest.java index e101635864..e1b24b7c10 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPrototypeLoadBalancerContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerListenerPrototypeLoadBalancerContextTest.java @@ -13,6 +13,9 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerListenerHTTPSRedirectPrototype; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerListenerIdentityById; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerListenerPrototypeLoadBalancerContext; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolIdentityByName; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; @@ -32,23 +35,46 @@ public class LoadBalancerListenerPrototypeLoadBalancerContextTest { @Test public void testLoadBalancerListenerPrototypeLoadBalancerContext() throws Throwable { + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") + .build(); + assertEquals(certificateInstanceIdentityModel.crn(), "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"); + LoadBalancerPoolIdentityByName loadBalancerPoolIdentityByNameModel = new LoadBalancerPoolIdentityByName.Builder() .name("my-load-balancer-pool") .build(); assertEquals(loadBalancerPoolIdentityByNameModel.name(), "my-load-balancer-pool"); + LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() + .id("70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + assertEquals(loadBalancerListenerIdentityModel.id(), "70294e14-4e61-11e8-bcf4-0242ac110004"); + + LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototypeModel = new LoadBalancerListenerHTTPSRedirectPrototype.Builder() + .httpStatusCode(Long.valueOf("301")) + .listener(loadBalancerListenerIdentityModel) + .uri("/example?doc=get") + .build(); + assertEquals(loadBalancerListenerHttpsRedirectPrototypeModel.httpStatusCode(), Long.valueOf("301")); + assertEquals(loadBalancerListenerHttpsRedirectPrototypeModel.listener(), loadBalancerListenerIdentityModel); + assertEquals(loadBalancerListenerHttpsRedirectPrototypeModel.uri(), "/example?doc=get"); + LoadBalancerListenerPrototypeLoadBalancerContext loadBalancerListenerPrototypeLoadBalancerContextModel = new LoadBalancerListenerPrototypeLoadBalancerContext.Builder() .acceptProxyProtocol(true) + .certificateInstance(certificateInstanceIdentityModel) .connectionLimit(Long.valueOf("2000")) .defaultPool(loadBalancerPoolIdentityByNameModel) + .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) .port(Long.valueOf("443")) .portMax(Long.valueOf("499")) .portMin(Long.valueOf("443")) .protocol("http") .build(); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.acceptProxyProtocol(), Boolean.valueOf(true)); + assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.certificateInstance(), certificateInstanceIdentityModel); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.connectionLimit(), Long.valueOf("2000")); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.defaultPool(), loadBalancerPoolIdentityByNameModel); + assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.httpsRedirect(), loadBalancerListenerHttpsRedirectPrototypeModel); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.port(), Long.valueOf("443")); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.portMax(), Long.valueOf("499")); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModel.portMin(), Long.valueOf("443")); @@ -59,8 +85,10 @@ public void testLoadBalancerListenerPrototypeLoadBalancerContext() throws Throwa LoadBalancerListenerPrototypeLoadBalancerContext loadBalancerListenerPrototypeLoadBalancerContextModelNew = TestUtilities.deserialize(json, LoadBalancerListenerPrototypeLoadBalancerContext.class); assertTrue(loadBalancerListenerPrototypeLoadBalancerContextModelNew instanceof LoadBalancerListenerPrototypeLoadBalancerContext); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModelNew.acceptProxyProtocol(), Boolean.valueOf(true)); + assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModelNew.certificateInstance().toString(), certificateInstanceIdentityModel.toString()); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModelNew.connectionLimit(), Long.valueOf("2000")); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModelNew.defaultPool().toString(), loadBalancerPoolIdentityByNameModel.toString()); + assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModelNew.httpsRedirect().toString(), loadBalancerListenerHttpsRedirectPrototypeModel.toString()); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModelNew.port(), Long.valueOf("443")); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModelNew.portMax(), Long.valueOf("499")); assertEquals(loadBalancerListenerPrototypeLoadBalancerContextModelNew.portMin(), Long.valueOf("443")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPatchTest.java index 9914414027..afa8db5861 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPatchTest.java @@ -16,6 +16,7 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerLogging; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerLoggingDatapath; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPatch; +import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -44,12 +45,19 @@ public void testLoadBalancerPatch() throws Throwable { .build(); assertEquals(loadBalancerLoggingModel.datapath(), loadBalancerLoggingDatapathModel); + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + assertEquals(subnetIdentityModel.id(), "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"); + LoadBalancerPatch loadBalancerPatchModel = new LoadBalancerPatch.Builder() .logging(loadBalancerLoggingModel) .name("my-load-balancer") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) .build(); assertEquals(loadBalancerPatchModel.logging(), loadBalancerLoggingModel); assertEquals(loadBalancerPatchModel.name(), "my-load-balancer"); + assertEquals(loadBalancerPatchModel.subnets(), java.util.Arrays.asList(subnetIdentityModel)); String json = TestUtilities.serialize(loadBalancerPatchModel); @@ -68,15 +76,21 @@ public void testLoadBalancerPatchAsPatch() throws Throwable { .datapath(loadBalancerLoggingDatapathModel) .build(); + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + LoadBalancerPatch loadBalancerPatchModel = new LoadBalancerPatch.Builder() .logging(loadBalancerLoggingModel) .name("my-load-balancer") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) .build(); Map mergePatch = loadBalancerPatchModel.asPatch(); assertTrue(mergePatch.containsKey("logging")); assertEquals(mergePatch.get("name"), "my-load-balancer"); + assertTrue(mergePatch.containsKey("subnets")); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolCollectionTest.java index 4556acc85f..fab332f5ce 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolCollectionTest.java @@ -25,8 +25,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolPrototypeTest.java index daeb0770c4..f6761b7b7f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolPrototypeTest.java @@ -21,8 +21,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -76,7 +74,7 @@ public void testLoadBalancerPoolPrototype() throws Throwable { LoadBalancerPoolPrototype loadBalancerPoolPrototypeModel = new LoadBalancerPoolPrototype.Builder() .algorithm("least_connections") .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) - .members(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))) + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) .name("my-load-balancer-pool") .protocol("http") .proxyProtocol("disabled") @@ -84,7 +82,7 @@ public void testLoadBalancerPoolPrototype() throws Throwable { .build(); assertEquals(loadBalancerPoolPrototypeModel.algorithm(), "least_connections"); assertEquals(loadBalancerPoolPrototypeModel.healthMonitor(), loadBalancerPoolHealthMonitorPrototypeModel); - assertEquals(loadBalancerPoolPrototypeModel.members(), new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))); + assertEquals(loadBalancerPoolPrototypeModel.members(), java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)); assertEquals(loadBalancerPoolPrototypeModel.name(), "my-load-balancer-pool"); assertEquals(loadBalancerPoolPrototypeModel.protocol(), "http"); assertEquals(loadBalancerPoolPrototypeModel.proxyProtocol(), "disabled"); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionTest.java index 5afe0e6451..b80185a21c 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionTest.java @@ -24,8 +24,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTest.java index f8a78a09ee..7355de6138 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTest.java @@ -21,8 +21,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionTest.java index a61a7720e7..e0756002ed 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionTest.java @@ -17,7 +17,7 @@ import com.ibm.cloud.is.vpc.v1.model.NetworkACLCollection; import com.ibm.cloud.is.vpc.v1.model.NetworkACLCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.NetworkACLCollectionNext; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolICMP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; @@ -29,8 +29,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLByRulesTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLByRulesTest.java index 1da0a6244c..a2f16cf3fb 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLByRulesTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLByRulesTest.java @@ -14,14 +14,12 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.NetworkACLPrototypeNetworkACLByRules; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -46,7 +44,7 @@ public void testNetworkACLPrototypeNetworkACLByRules() throws Throwable { .build(); assertEquals(vpcIdentityModel.id(), "cf7cd5a-2f30-4336-a495-6addc820cd61"); - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP.Builder() + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.Builder() .action("allow") .destination("192.168.3.2/32") .direction("inbound") @@ -73,12 +71,12 @@ public void testNetworkACLPrototypeNetworkACLByRules() throws Throwable { .name("my-network-acl") .resourceGroup(resourceGroupIdentityModel) .vpc(vpcIdentityModel) - .rules(new java.util.ArrayList(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel))) + .rules(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel)) .build(); assertEquals(networkAclPrototypeNetworkAclByRulesModel.name(), "my-network-acl"); assertEquals(networkAclPrototypeNetworkAclByRulesModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(networkAclPrototypeNetworkAclByRulesModel.vpc(), vpcIdentityModel); - assertEquals(networkAclPrototypeNetworkAclByRulesModel.rules(), new java.util.ArrayList(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel))); + assertEquals(networkAclPrototypeNetworkAclByRulesModel.rules(), java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel)); String json = TestUtilities.serialize(networkAclPrototypeNetworkAclByRulesModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeTest.java index cd0bc61d2f..f674707823 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeTest.java @@ -14,14 +14,12 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.NetworkACLPrototype; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionTest.java index 2bc74b7be3..5d7cfb7ce5 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionTest.java @@ -16,7 +16,7 @@ import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleCollection; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleCollectionNext; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolICMP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReferenceDeleted; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePatchTest.java index 6e0cb953e9..403d167257 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePatchTest.java @@ -46,7 +46,8 @@ public void testNetworkACLRulePatch() throws Throwable { .destinationPortMax(Long.valueOf("22")) .destinationPortMin(Long.valueOf("22")) .direction("inbound") - .name("my-rule-2") + .name("my-rule-1") + .protocol("tcp") .source("192.168.3.2/32") .sourcePortMax(Long.valueOf("65535")) .sourcePortMin(Long.valueOf("49152")) @@ -59,7 +60,8 @@ public void testNetworkACLRulePatch() throws Throwable { assertEquals(networkAclRulePatchModel.destinationPortMax(), Long.valueOf("22")); assertEquals(networkAclRulePatchModel.destinationPortMin(), Long.valueOf("22")); assertEquals(networkAclRulePatchModel.direction(), "inbound"); - assertEquals(networkAclRulePatchModel.name(), "my-rule-2"); + assertEquals(networkAclRulePatchModel.name(), "my-rule-1"); + assertEquals(networkAclRulePatchModel.protocol(), "tcp"); assertEquals(networkAclRulePatchModel.source(), "192.168.3.2/32"); assertEquals(networkAclRulePatchModel.sourcePortMax(), Long.valueOf("65535")); assertEquals(networkAclRulePatchModel.sourcePortMin(), Long.valueOf("49152")); @@ -76,7 +78,8 @@ public void testNetworkACLRulePatch() throws Throwable { assertEquals(networkAclRulePatchModelNew.destinationPortMax(), Long.valueOf("22")); assertEquals(networkAclRulePatchModelNew.destinationPortMin(), Long.valueOf("22")); assertEquals(networkAclRulePatchModelNew.direction(), "inbound"); - assertEquals(networkAclRulePatchModelNew.name(), "my-rule-2"); + assertEquals(networkAclRulePatchModelNew.name(), "my-rule-1"); + assertEquals(networkAclRulePatchModelNew.protocol(), "tcp"); assertEquals(networkAclRulePatchModelNew.source(), "192.168.3.2/32"); assertEquals(networkAclRulePatchModelNew.sourcePortMax(), Long.valueOf("65535")); assertEquals(networkAclRulePatchModelNew.sourcePortMin(), Long.valueOf("49152")); @@ -96,7 +99,8 @@ public void testNetworkACLRulePatchAsPatch() throws Throwable { .destinationPortMax(Long.valueOf("22")) .destinationPortMin(Long.valueOf("22")) .direction("inbound") - .name("my-rule-2") + .name("my-rule-1") + .protocol("tcp") .source("192.168.3.2/32") .sourcePortMax(Long.valueOf("65535")) .sourcePortMin(Long.valueOf("49152")) @@ -112,7 +116,8 @@ public void testNetworkACLRulePatchAsPatch() throws Throwable { assertTrue(mergePatch.containsKey("destination_port_max")); assertTrue(mergePatch.containsKey("destination_port_min")); assertEquals(mergePatch.get("direction"), "inbound"); - assertEquals(mergePatch.get("name"), "my-rule-2"); + assertEquals(mergePatch.get("name"), "my-rule-1"); + assertEquals(mergePatch.get("protocol"), "tcp"); assertEquals(mergePatch.get("source"), "192.168.3.2/32"); assertTrue(mergePatch.containsKey("source_port_max")); assertTrue(mergePatch.containsKey("source_port_min")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeTest.java new file mode 100644 index 0000000000..edfe254aaf --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeTest.java @@ -0,0 +1,66 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype model. + */ +public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype() throws Throwable { + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Builder() + .action("allow") + .destination("192.168.3.2/32") + .direction("inbound") + .name("my-rule-2") + .source("192.168.3.2/32") + .protocol("all") + .build(); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel.name(), "my-rule-2"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel.protocol(), "all"); + + String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel); + + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.class); + assertTrue(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew.name(), "my-rule-2"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew.protocol(), "all"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeError() throws Throwable { + new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototypeTest.java new file mode 100644 index 0000000000..fee98e4f3c --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototypeTest.java @@ -0,0 +1,72 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype model. + */ +public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype() throws Throwable { + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.Builder() + .action("allow") + .destination("192.168.3.2/32") + .direction("inbound") + .name("my-rule-2") + .source("192.168.3.2/32") + .code(Long.valueOf("0")) + .protocol("icmp") + .type(Long.valueOf("8")) + .build(); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModel.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModel.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModel.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModel.name(), "my-rule-2"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModel.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModel.code(), Long.valueOf("0")); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModel.protocol(), "icmp"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModel.type(), Long.valueOf("8")); + + String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModel); + + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.class); + assertTrue(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModelNew.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModelNew.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModelNew.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModelNew.name(), "my-rule-2"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModelNew.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModelNew.code(), Long.valueOf("0")); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModelNew.protocol(), "icmp"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmpPrototypeModelNew.type(), Long.valueOf("8")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototypeError() throws Throwable { + new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototypeTest.java new file mode 100644 index 0000000000..cd034dcbf6 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototypeTest.java @@ -0,0 +1,78 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model. + */ +public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype() throws Throwable { + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.Builder() + .action("allow") + .destination("192.168.3.2/32") + .direction("inbound") + .name("my-rule-2") + .source("192.168.3.2/32") + .destinationPortMax(Long.valueOf("22")) + .destinationPortMin(Long.valueOf("22")) + .protocol("udp") + .sourcePortMax(Long.valueOf("65535")) + .sourcePortMin(Long.valueOf("49152")) + .build(); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModel.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModel.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModel.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModel.name(), "my-rule-2"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModel.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModel.destinationPortMax(), Long.valueOf("22")); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModel.destinationPortMin(), Long.valueOf("22")); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModel.protocol(), "udp"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModel.sourcePortMax(), Long.valueOf("65535")); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModel.sourcePortMin(), Long.valueOf("49152")); + + String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModel); + + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.class); + assertTrue(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModelNew.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModelNew.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModelNew.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModelNew.name(), "my-rule-2"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModelNew.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModelNew.destinationPortMax(), Long.valueOf("22")); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModelNew.destinationPortMin(), Long.valueOf("22")); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModelNew.protocol(), "udp"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModelNew.sourcePortMax(), Long.valueOf("65535")); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolTcpudpPrototypeModelNew.sourcePortMin(), Long.valueOf("49152")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototypeError() throws Throwable { + new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeTest.java new file mode 100644 index 0000000000..78ba3ef1b1 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeTest.java @@ -0,0 +1,75 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype model. + */ +public class NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype() throws Throwable { + NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById networkAclRuleBeforePrototypeModel = new NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.Builder() + .id("8daca77a-4980-4d33-8f3e-7038797be8f9") + .build(); + assertEquals(networkAclRuleBeforePrototypeModel.id(), "8daca77a-4980-4d33-8f3e-7038797be8f9"); + + NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Builder() + .action("allow") + .before(networkAclRuleBeforePrototypeModel) + .destination("192.168.3.2/32") + .direction("inbound") + .name("my-rule-2") + .source("192.168.3.2/32") + .protocol("all") + .build(); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.before(), networkAclRuleBeforePrototypeModel); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.name(), "my-rule-2"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.protocol(), "all"); + + String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel); + + NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.class); + assertTrue(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.before().toString(), networkAclRuleBeforePrototypeModel.toString()); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.name(), "my-rule-2"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.protocol(), "all"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeError() throws Throwable { + new NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototypeTest.java new file mode 100644 index 0000000000..5e83e48de4 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototypeTest.java @@ -0,0 +1,81 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype model. + */ +public class NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype() throws Throwable { + NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById networkAclRuleBeforePrototypeModel = new NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.Builder() + .id("8daca77a-4980-4d33-8f3e-7038797be8f9") + .build(); + assertEquals(networkAclRuleBeforePrototypeModel.id(), "8daca77a-4980-4d33-8f3e-7038797be8f9"); + + NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.Builder() + .action("allow") + .before(networkAclRuleBeforePrototypeModel) + .destination("192.168.3.2/32") + .direction("inbound") + .name("my-rule-2") + .source("192.168.3.2/32") + .code(Long.valueOf("0")) + .protocol("icmp") + .type(Long.valueOf("8")) + .build(); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModel.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModel.before(), networkAclRuleBeforePrototypeModel); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModel.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModel.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModel.name(), "my-rule-2"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModel.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModel.code(), Long.valueOf("0")); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModel.protocol(), "icmp"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModel.type(), Long.valueOf("8")); + + String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModel); + + NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.class); + assertTrue(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModelNew.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModelNew.before().toString(), networkAclRuleBeforePrototypeModel.toString()); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModelNew.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModelNew.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModelNew.name(), "my-rule-2"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModelNew.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModelNew.code(), Long.valueOf("0")); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModelNew.protocol(), "icmp"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmpPrototypeModelNew.type(), Long.valueOf("8")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testNetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototypeError() throws Throwable { + new NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototypeTest.java new file mode 100644 index 0000000000..5ce337a1c1 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototypeTest.java @@ -0,0 +1,87 @@ +/* + * (C) Copyright IBM Corp. 2020, 2021, 2022. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model. + */ +public class NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype() throws Throwable { + NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById networkAclRuleBeforePrototypeModel = new NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.Builder() + .id("8daca77a-4980-4d33-8f3e-7038797be8f9") + .build(); + assertEquals(networkAclRuleBeforePrototypeModel.id(), "8daca77a-4980-4d33-8f3e-7038797be8f9"); + + NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.Builder() + .action("allow") + .before(networkAclRuleBeforePrototypeModel) + .destination("192.168.3.2/32") + .direction("inbound") + .name("my-rule-2") + .source("192.168.3.2/32") + .destinationPortMax(Long.valueOf("22")) + .destinationPortMin(Long.valueOf("22")) + .protocol("udp") + .sourcePortMax(Long.valueOf("65535")) + .sourcePortMin(Long.valueOf("49152")) + .build(); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModel.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModel.before(), networkAclRuleBeforePrototypeModel); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModel.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModel.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModel.name(), "my-rule-2"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModel.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModel.destinationPortMax(), Long.valueOf("22")); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModel.destinationPortMin(), Long.valueOf("22")); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModel.protocol(), "udp"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModel.sourcePortMax(), Long.valueOf("65535")); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModel.sourcePortMin(), Long.valueOf("49152")); + + String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModel); + + NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.class); + assertTrue(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModelNew.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModelNew.before().toString(), networkAclRuleBeforePrototypeModel.toString()); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModelNew.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModelNew.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModelNew.name(), "my-rule-2"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModelNew.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModelNew.destinationPortMax(), Long.valueOf("22")); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModelNew.destinationPortMin(), Long.valueOf("22")); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModelNew.protocol(), "udp"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModelNew.sourcePortMax(), Long.valueOf("65535")); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolTcpudpPrototypeModelNew.sourcePortMin(), Long.valueOf("49152")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testNetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototypeError() throws Throwable { + new NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLTest.java index 54562fdbbd..697d35815a 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLTest.java @@ -14,7 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.NetworkACL; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolICMP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePrototypeTest.java index f4e285a780..d1f689bf8e 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePrototypeTest.java @@ -20,8 +20,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -59,13 +57,13 @@ public void testNetworkInterfacePrototype() throws Throwable { .allowIpSpoofing(true) .name("my-network-interface") .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); assertEquals(networkInterfacePrototypeModel.allowIpSpoofing(), Boolean.valueOf(true)); assertEquals(networkInterfacePrototypeModel.name(), "my-network-interface"); assertEquals(networkInterfacePrototypeModel.primaryIp(), networkInterfaceIpPrototypeModel); - assertEquals(networkInterfacePrototypeModel.securityGroups(), new java.util.ArrayList(java.util.Arrays.asList(securityGroupIdentityModel))); + assertEquals(networkInterfacePrototypeModel.securityGroups(), java.util.Arrays.asList(securityGroupIdentityModel)); assertEquals(networkInterfacePrototypeModel.subnet(), subnetIdentityModel); String json = TestUtilities.serialize(networkInterfacePrototypeModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceUnpaginatedCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceUnpaginatedCollectionTest.java index a848810e3f..83dbf4f88d 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceUnpaginatedCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfaceUnpaginatedCollectionTest.java @@ -27,8 +27,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ReplaceLoadBalancerPoolMembersOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ReplaceLoadBalancerPoolMembersOptionsTest.java index 9b277ac34f..bbed584b8c 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ReplaceLoadBalancerPoolMembersOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ReplaceLoadBalancerPoolMembersOptionsTest.java @@ -19,8 +19,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -52,11 +50,11 @@ public void testReplaceLoadBalancerPoolMembersOptions() throws Throwable { ReplaceLoadBalancerPoolMembersOptions replaceLoadBalancerPoolMembersOptionsModel = new ReplaceLoadBalancerPoolMembersOptions.Builder() .loadBalancerId("testString") .poolId("testString") - .members(new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))) + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) .build(); assertEquals(replaceLoadBalancerPoolMembersOptionsModel.loadBalancerId(), "testString"); assertEquals(replaceLoadBalancerPoolMembersOptionsModel.poolId(), "testString"); - assertEquals(replaceLoadBalancerPoolMembersOptionsModel.members(), new java.util.ArrayList(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel))); + assertEquals(replaceLoadBalancerPoolMembersOptionsModel.members(), java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollectionTest.java index b0b8f7ea05..7c5c36aefd 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RoutingTableCollectionTest.java @@ -26,8 +26,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RoutingTablePatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RoutingTablePatchTest.java index ba3bf4f285..d6416f968c 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RoutingTablePatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RoutingTablePatchTest.java @@ -18,8 +18,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -41,13 +39,13 @@ public void testRoutingTablePatch() throws Throwable { assertEquals(resourceFilterModel.resourceType(), "vpn_server"); RoutingTablePatch routingTablePatchModel = new RoutingTablePatch.Builder() - .acceptRoutesFrom(new java.util.ArrayList(java.util.Arrays.asList(resourceFilterModel))) + .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) .name("my-routing-table-2") .routeDirectLinkIngress(true) .routeTransitGatewayIngress(true) .routeVpcZoneIngress(true) .build(); - assertEquals(routingTablePatchModel.acceptRoutesFrom(), new java.util.ArrayList(java.util.Arrays.asList(resourceFilterModel))); + assertEquals(routingTablePatchModel.acceptRoutesFrom(), java.util.Arrays.asList(resourceFilterModel)); assertEquals(routingTablePatchModel.name(), "my-routing-table-2"); assertEquals(routingTablePatchModel.routeDirectLinkIngress(), Boolean.valueOf(true)); assertEquals(routingTablePatchModel.routeTransitGatewayIngress(), Boolean.valueOf(true)); @@ -69,7 +67,7 @@ public void testRoutingTablePatchAsPatch() throws Throwable { .build(); RoutingTablePatch routingTablePatchModel = new RoutingTablePatch.Builder() - .acceptRoutesFrom(new java.util.ArrayList(java.util.Arrays.asList(resourceFilterModel))) + .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) .name("my-routing-table-2") .routeDirectLinkIngress(true) .routeTransitGatewayIngress(true) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollectionTest.java index 351263c6b4..8512ac5136 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupCollectionTest.java @@ -28,8 +28,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionTest.java index 3e2dc8a572..1a668e1687 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionTest.java @@ -30,8 +30,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatchTest.java index 0b80c6247d..8c644e7673 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatchTest.java @@ -17,8 +17,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -36,10 +34,10 @@ public class SnapshotPatchTest { public void testSnapshotPatch() throws Throwable { SnapshotPatch snapshotPatchModel = new SnapshotPatch.Builder() .name("my-snapshot") - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(snapshotPatchModel.name(), "my-snapshot"); - assertEquals(snapshotPatchModel.userTags(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(snapshotPatchModel.userTags(), java.util.Arrays.asList("testString")); String json = TestUtilities.serialize(snapshotPatchModel); @@ -51,7 +49,7 @@ public void testSnapshotPatch() throws Throwable { public void testSnapshotPatchAsPatch() throws Throwable { SnapshotPatch snapshotPatchModel = new SnapshotPatch.Builder() .name("my-snapshot") - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .userTags(java.util.Arrays.asList("testString")) .build(); Map mergePatch = snapshotPatchModel.asPatch(); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolumeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolumeTest.java index 8a7a2fe0e2..33e4b4fb57 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolumeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolumeTest.java @@ -19,8 +19,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -48,12 +46,12 @@ public void testSnapshotPrototypeSnapshotBySourceVolume() throws Throwable { SnapshotPrototypeSnapshotBySourceVolume snapshotPrototypeSnapshotBySourceVolumeModel = new SnapshotPrototypeSnapshotBySourceVolume.Builder() .name("my-snapshot") .resourceGroup(resourceGroupIdentityModel) - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .userTags(java.util.Arrays.asList("testString")) .sourceVolume(volumeIdentityModel) .build(); assertEquals(snapshotPrototypeSnapshotBySourceVolumeModel.name(), "my-snapshot"); assertEquals(snapshotPrototypeSnapshotBySourceVolumeModel.resourceGroup(), resourceGroupIdentityModel); - assertEquals(snapshotPrototypeSnapshotBySourceVolumeModel.userTags(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(snapshotPrototypeSnapshotBySourceVolumeModel.userTags(), java.util.Arrays.asList("testString")); assertEquals(snapshotPrototypeSnapshotBySourceVolumeModel.sourceVolume(), volumeIdentityModel); String json = TestUtilities.serialize(snapshotPrototypeSnapshotBySourceVolumeModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeTest.java index 5b78a1a19b..9553dd76a9 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeTest.java @@ -19,8 +19,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerOptionsTest.java index cf0cceb47e..da383429cb 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateLoadBalancerOptionsTest.java @@ -34,9 +34,11 @@ public void testUpdateLoadBalancerOptions() throws Throwable { UpdateLoadBalancerOptions updateLoadBalancerOptionsModel = new UpdateLoadBalancerOptions.Builder() .id("testString") .loadBalancerPatch(new java.util.HashMap() { { put("foo", TestUtilities.createMockMap()); } }) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); assertEquals(updateLoadBalancerOptionsModel.id(), "testString"); assertEquals(updateLoadBalancerOptionsModel.loadBalancerPatch(), new java.util.HashMap() { { put("foo", TestUtilities.createMockMap()); } }); + assertEquals(updateLoadBalancerOptionsModel.ifMatch(), "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\""); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPCCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPCCollectionTest.java index 47beed0ada..ebcf5ad08d 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPCCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPCCollectionTest.java @@ -31,8 +31,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionTest.java index f0d7875b1a..0111869fd3 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionTest.java @@ -17,6 +17,8 @@ import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.VPCReference; +import com.ibm.cloud.is.vpc.v1.model.VPCReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayCollection; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayCollectionNext; @@ -28,8 +30,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionCollectionTest.java index d8a5f45709..dbcc5667c4 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionCollectionTest.java @@ -26,8 +26,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeTest.java index cc997d3767..30c517efb8 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeTest.java @@ -20,8 +20,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototypeTest.java index 3640770e2d..33a5af5089 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototypeTest.java @@ -20,8 +20,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -63,8 +61,8 @@ public void testVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModeProto .name("my-vpn-connection") .peerAddress("169.21.50.5") .psk("lkj14b1oi0alcniejkso") - .localCidrs(new java.util.ArrayList(java.util.Arrays.asList("192.168.1.0/24"))) - .peerCidrs(new java.util.ArrayList(java.util.Arrays.asList("10.45.1.0/24"))) + .localCidrs(java.util.Arrays.asList("192.168.1.0/24")) + .peerCidrs(java.util.Arrays.asList("10.45.1.0/24")) .build(); assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototypeModel.adminStateUp(), Boolean.valueOf(true)); assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototypeModel.deadPeerDetection(), vpnGatewayConnectionDpdPrototypeModel); @@ -73,8 +71,8 @@ public void testVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModeProto assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototypeModel.name(), "my-vpn-connection"); assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototypeModel.peerAddress(), "169.21.50.5"); assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototypeModel.psk(), "lkj14b1oi0alcniejkso"); - assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototypeModel.localCidrs(), new java.util.ArrayList(java.util.Arrays.asList("192.168.1.0/24"))); - assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototypeModel.peerCidrs(), new java.util.ArrayList(java.util.Arrays.asList("10.45.1.0/24"))); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototypeModel.localCidrs(), java.util.Arrays.asList("192.168.1.0/24")); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototypeModel.peerCidrs(), java.util.Arrays.asList("10.45.1.0/24")); String json = TestUtilities.serialize(vpnGatewayConnectionPrototypeVpnGatewayConnectionPolicyModePrototypeModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPolicyModeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPolicyModeTest.java index 648a147a25..e631814562 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPolicyModeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPolicyModeTest.java @@ -17,6 +17,8 @@ import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.VPCReference; +import com.ibm.cloud.is.vpc.v1.model.VPCReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionReference; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayMember; @@ -50,6 +52,7 @@ public void testVPNGatewayPolicyMode() throws Throwable { assertNull(vpnGatewayPolicyModeModel.getResourceType()); assertNull(vpnGatewayPolicyModeModel.getStatus()); assertNull(vpnGatewayPolicyModeModel.getSubnet()); + assertNull(vpnGatewayPolicyModeModel.getVpc()); assertNull(vpnGatewayPolicyModeModel.getMode()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayRouteModeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayRouteModeTest.java index a4ffe8ffeb..241294b89b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayRouteModeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayRouteModeTest.java @@ -17,6 +17,8 @@ import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.VPCReference; +import com.ibm.cloud.is.vpc.v1.model.VPCReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionReference; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayMember; @@ -50,6 +52,7 @@ public void testVPNGatewayRouteMode() throws Throwable { assertNull(vpnGatewayRouteModeModel.getResourceType()); assertNull(vpnGatewayRouteModeModel.getStatus()); assertNull(vpnGatewayRouteModeModel.getSubnet()); + assertNull(vpnGatewayRouteModeModel.getVpc()); assertNull(vpnGatewayRouteModeModel.getMode()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayTest.java index 1dde890d99..3fac92d6a0 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayTest.java @@ -17,6 +17,8 @@ import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.VPCReference; +import com.ibm.cloud.is.vpc.v1.model.VPCReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.VPNGateway; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionReference; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionReferenceDeleted; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollectionTest.java index e42e7a1bdd..51afb59037 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNServerCollectionTest.java @@ -34,8 +34,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNServerPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNServerPatchTest.java index 6685d6cc93..c9c1fd9ff0 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNServerPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNServerPatchTest.java @@ -22,8 +22,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -68,26 +66,26 @@ public void testVPNServerPatch() throws Throwable { VPNServerPatch vpnServerPatchModel = new VPNServerPatch.Builder() .certificate(certificateInstanceIdentityModel) - .clientAuthentication(new java.util.ArrayList(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel))) - .clientDnsServerIps(new java.util.ArrayList(java.util.Arrays.asList(ipModel))) + .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) + .clientDnsServerIps(java.util.Arrays.asList(ipModel)) .clientIdleTimeout(Long.valueOf("600")) .clientIpPool("172.16.0.0/16") .enableSplitTunneling(true) .name("my-vpn-server") .port(Long.valueOf("443")) .protocol("udp") - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) .build(); assertEquals(vpnServerPatchModel.certificate(), certificateInstanceIdentityModel); - assertEquals(vpnServerPatchModel.clientAuthentication(), new java.util.ArrayList(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel))); - assertEquals(vpnServerPatchModel.clientDnsServerIps(), new java.util.ArrayList(java.util.Arrays.asList(ipModel))); + assertEquals(vpnServerPatchModel.clientAuthentication(), java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)); + assertEquals(vpnServerPatchModel.clientDnsServerIps(), java.util.Arrays.asList(ipModel)); assertEquals(vpnServerPatchModel.clientIdleTimeout(), Long.valueOf("600")); assertEquals(vpnServerPatchModel.clientIpPool(), "172.16.0.0/16"); assertEquals(vpnServerPatchModel.enableSplitTunneling(), Boolean.valueOf(true)); assertEquals(vpnServerPatchModel.name(), "my-vpn-server"); assertEquals(vpnServerPatchModel.port(), Long.valueOf("443")); assertEquals(vpnServerPatchModel.protocol(), "udp"); - assertEquals(vpnServerPatchModel.subnets(), new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))); + assertEquals(vpnServerPatchModel.subnets(), java.util.Arrays.asList(subnetIdentityModel)); String json = TestUtilities.serialize(vpnServerPatchModel); @@ -126,15 +124,15 @@ public void testVPNServerPatchAsPatch() throws Throwable { VPNServerPatch vpnServerPatchModel = new VPNServerPatch.Builder() .certificate(certificateInstanceIdentityModel) - .clientAuthentication(new java.util.ArrayList(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel))) - .clientDnsServerIps(new java.util.ArrayList(java.util.Arrays.asList(ipModel))) + .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) + .clientDnsServerIps(java.util.Arrays.asList(ipModel)) .clientIdleTimeout(Long.valueOf("600")) .clientIpPool("172.16.0.0/16") .enableSplitTunneling(true) .name("my-vpn-server") .port(Long.valueOf("443")) .protocol("udp") - .subnets(new java.util.ArrayList(java.util.Arrays.asList(subnetIdentityModel))) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) .build(); Map mergePatch = vpnServerPatchModel.asPatch(); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceByImageContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceByImageContextTest.java index 085fcc7be4..8aefa12adc 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceByImageContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceByImageContextTest.java @@ -50,12 +50,14 @@ public void testVolumeAttachmentPrototypeInstanceByImageContext() throws Throwab .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("250")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() .deleteVolumeOnInstanceDelete(true) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceBySourceSnapshotContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceBySourceSnapshotContextTest.java index 94c6c11e18..359715d0dc 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceBySourceSnapshotContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceBySourceSnapshotContextTest.java @@ -57,6 +57,7 @@ public void testVolumeAttachmentPrototypeInstanceBySourceSnapshotContext() throw .name("my-volume") .profile(volumeProfileIdentityModel) .sourceSnapshot(snapshotIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -64,6 +65,7 @@ public void testVolumeAttachmentPrototypeInstanceBySourceSnapshotContext() throw assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.profile(), volumeProfileIdentityModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.sourceSnapshot(), snapshotIdentityModel); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceBySourceSnapshotContext volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel = new VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.Builder() .deleteVolumeOnInstanceDelete(true) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityTest.java index 1d9d3ab5ae..1cdc5890db 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityTest.java @@ -47,12 +47,14 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) .build(); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.iops(), Long.valueOf("10000")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.name(), "my-volume"); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.profile(), volumeProfileIdentityModel); + assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.userTags(), java.util.Arrays.asList("testString")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.capacity(), Long.valueOf("100")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.encryptionKey(), encryptionKeyIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotTest.java index f397dbd172..4e033c21b1 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotTest.java @@ -53,6 +53,7 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) .sourceSnapshot(snapshotIdentityModel) @@ -60,6 +61,7 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.iops(), Long.valueOf("10000")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.name(), "my-volume"); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.profile(), volumeProfileIdentityModel); + assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.userTags(), java.util.Arrays.asList("testString")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.capacity(), Long.valueOf("100")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.sourceSnapshot(), snapshotIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityTest.java index 8c34758d05..4277e1fc33 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityTest.java @@ -47,12 +47,14 @@ public void testVolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeIns .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) .build(); assertEquals(volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.iops(), Long.valueOf("10000")); assertEquals(volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.name(), "my-volume"); assertEquals(volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.profile(), volumeProfileIdentityModel); + assertEquals(volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.userTags(), java.util.Arrays.asList("testString")); assertEquals(volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.capacity(), Long.valueOf("100")); assertEquals(volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.encryptionKey(), encryptionKeyIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotTest.java index 2ce5374740..8e34a1b911 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotTest.java @@ -53,6 +53,7 @@ public void testVolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeIns .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) .sourceSnapshot(snapshotIdentityModel) @@ -60,6 +61,7 @@ public void testVolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeIns assertEquals(volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.iops(), Long.valueOf("10000")); assertEquals(volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.name(), "my-volume"); assertEquals(volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.profile(), volumeProfileIdentityModel); + assertEquals(volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.userTags(), java.util.Arrays.asList("testString")); assertEquals(volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.capacity(), Long.valueOf("100")); assertEquals(volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(volumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.sourceSnapshot(), snapshotIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionTest.java index 4d280ae75d..73e734a824 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionTest.java @@ -36,8 +36,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePatchTest.java index e394d07215..6b20986b99 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePatchTest.java @@ -18,8 +18,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -45,13 +43,13 @@ public void testVolumePatch() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePatchModel.capacity(), Long.valueOf("100")); assertEquals(volumePatchModel.iops(), Long.valueOf("10000")); assertEquals(volumePatchModel.name(), "my-volume"); assertEquals(volumePatchModel.profile(), volumeProfileIdentityModel); - assertEquals(volumePatchModel.userTags(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(volumePatchModel.userTags(), java.util.Arrays.asList("testString")); String json = TestUtilities.serialize(volumePatchModel); @@ -73,7 +71,7 @@ public void testVolumePatchAsPatch() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .userTags(java.util.Arrays.asList("testString")) .build(); Map mergePatch = volumePatchModel.asPatch(); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContextTest.java index d67b8fbe45..1de08fa054 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContextTest.java @@ -49,12 +49,14 @@ public void testVolumePrototypeInstanceByImageContext() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("250")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); String json = TestUtilities.serialize(volumePrototypeInstanceByImageContextModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContextTest.java index c087a89eaa..889c6cdc7e 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContextTest.java @@ -56,6 +56,7 @@ public void testVolumePrototypeInstanceBySourceSnapshotContext() throws Throwabl .name("my-volume") .profile(volumeProfileIdentityModel) .sourceSnapshot(snapshotIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -63,6 +64,7 @@ public void testVolumePrototypeInstanceBySourceSnapshotContext() throws Throwabl assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.profile(), volumeProfileIdentityModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.sourceSnapshot(), snapshotIdentityModel); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.userTags(), java.util.Arrays.asList("testString")); String json = TestUtilities.serialize(volumePrototypeInstanceBySourceSnapshotContextModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeTest.java index 5ca6e0bebc..63bf7475f0 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeTest.java @@ -21,8 +21,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeByCapacityTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeByCapacityTest.java index 9b3e47974f..87fa2f7299 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeByCapacityTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeByCapacityTest.java @@ -21,8 +21,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -62,7 +60,7 @@ public void testVolumePrototypeVolumeByCapacity() throws Throwable { .name("my-volume") .profile(volumeProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .userTags(java.util.Arrays.asList("testString")) .zone(zoneIdentityModel) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -71,7 +69,7 @@ public void testVolumePrototypeVolumeByCapacity() throws Throwable { assertEquals(volumePrototypeVolumeByCapacityModel.name(), "my-volume"); assertEquals(volumePrototypeVolumeByCapacityModel.profile(), volumeProfileIdentityModel); assertEquals(volumePrototypeVolumeByCapacityModel.resourceGroup(), resourceGroupIdentityModel); - assertEquals(volumePrototypeVolumeByCapacityModel.userTags(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(volumePrototypeVolumeByCapacityModel.userTags(), java.util.Arrays.asList("testString")); assertEquals(volumePrototypeVolumeByCapacityModel.zone(), zoneIdentityModel); assertEquals(volumePrototypeVolumeByCapacityModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeVolumeByCapacityModel.encryptionKey(), encryptionKeyIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshotTest.java index b78532cbbf..79fc474cc5 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshotTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshotTest.java @@ -22,8 +22,6 @@ import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -68,7 +66,7 @@ public void testVolumePrototypeVolumeBySourceSnapshot() throws Throwable { .name("my-volume") .profile(volumeProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) - .userTags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .userTags(java.util.Arrays.asList("testString")) .zone(zoneIdentityModel) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -78,7 +76,7 @@ public void testVolumePrototypeVolumeBySourceSnapshot() throws Throwable { assertEquals(volumePrototypeVolumeBySourceSnapshotModel.name(), "my-volume"); assertEquals(volumePrototypeVolumeBySourceSnapshotModel.profile(), volumeProfileIdentityModel); assertEquals(volumePrototypeVolumeBySourceSnapshotModel.resourceGroup(), resourceGroupIdentityModel); - assertEquals(volumePrototypeVolumeBySourceSnapshotModel.userTags(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(volumePrototypeVolumeBySourceSnapshotModel.userTags(), java.util.Arrays.asList("testString")); assertEquals(volumePrototypeVolumeBySourceSnapshotModel.zone(), zoneIdentityModel); assertEquals(volumePrototypeVolumeBySourceSnapshotModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeVolumeBySourceSnapshotModel.encryptionKey(), encryptionKeyIdentityModel); diff --git a/pom.xml b/pom.xml index 43b59a70ce..e096b45def 100644 --- a/pom.xml +++ b/pom.xml @@ -21,30 +21,30 @@ of the SDK generator used to generate your SDK code. See this link for details: https://github.ibm.com/CloudEngineering/openapi-sdkgen/wiki/Compatibility-Chart --> - 9.15.4 + 9.17.3 vpc-java-sdk 7.4.0 - 4.9.1 - 3.0.0-M3 - 0.8.5 - 1.6.8 - 1.6 - 3.0.0-M1 - 3.1.0 - 3.2.2 - 3.2.0 - 3.1.1 - 3.8.1 - 3.7.1 - 3.1.0 - 3.0.0 - 3.0.0-M4 - 1.4 - 2.0.5 + 4.10.0 + 3.0.0-M7 + 0.8.8 + 1.6.13 + 3.0.1 + 3.0.0 + 3.2.1 + 3.3.0 + 3.2.2 + 3.4.1 + 3.10.1 + 3.12.1 + 3.2.0 + 3.4.1 + 3.0.0-M7 + 3.0.0 + 2.0.9 3.2.4 - 1.7.28 + 2.0.0 UTF-8