From 264cea239d3d339d0d41d8d7a9fe8aab9507a4c5 Mon Sep 17 00:00:00 2001 From: Mathias Ricken Date: Thu, 27 Apr 2017 17:19:58 -0700 Subject: [PATCH] Releasing version 1.2.7 of the Java SDK for Oracle Bare Metal Cloud Services. --- CHANGELOG.md | 8 + bmc-audit/pom.xml | 4 +- .../internal/http/ListEventsConverter.java | 17 +- bmc-bom/pom.xml | 18 +- bmc-common/pom.xml | 2 +- .../PEMFileRSAPrivateKeySupplier.java | 5 +- bmc-core/pom.xml | 4 +- .../oracle/bmc/core/BlockstorageWaiters.java | 20 +- .../com/oracle/bmc/core/ComputeWaiters.java | 33 +- .../com/oracle/bmc/core/VirtualNetwork.java | 149 ++++- .../oracle/bmc/core/VirtualNetworkAsync.java | 188 +++++- .../bmc/core/VirtualNetworkAsyncClient.java | 131 ++++ .../oracle/bmc/core/VirtualNetworkClient.java | 88 +++ .../bmc/core/VirtualNetworkWaiters.java | 156 +++-- .../http/CreateVirtualCircuitConverter.java | 103 +++ .../http/DeleteVirtualCircuitConverter.java | 98 +++ .../http/GetVirtualCircuitConverter.java | 102 +++ ...tFastConnectProviderServicesConverter.java | 120 ++++ ...irtualCircuitBandwidthShapesConverter.java | 120 ++++ .../http/ListVirtualCircuitsConverter.java | 114 ++++ .../http/UpdateVirtualCircuitConverter.java | 111 ++++ .../oracle/bmc/core/model/ConsoleHistory.java | 17 +- .../java/com/oracle/bmc/core/model/Cpe.java | 9 +- .../model/CreateVirtualCircuitDetails.java | 228 +++++++ .../bmc/core/model/CrossConnectMapping.java | 127 ++++ .../oracle/bmc/core/model/DhcpDnsOption.java | 17 +- .../oracle/bmc/core/model/DhcpOptions.java | 21 +- .../core/model/DhcpSearchDomainOption.java | 3 +- .../java/com/oracle/bmc/core/model/Drg.java | 24 +- .../oracle/bmc/core/model/DrgAttachment.java | 17 +- .../model/FastConnectProviderService.java | 85 +++ .../bmc/core/model/IPSecConnection.java | 21 +- .../java/com/oracle/bmc/core/model/Image.java | 17 +- .../com/oracle/bmc/core/model/Instance.java | 28 +- .../bmc/core/model/InternetGateway.java | 17 +- .../bmc/core/model/LaunchInstanceDetails.java | 4 +- .../com/oracle/bmc/core/model/RouteTable.java | 17 +- .../oracle/bmc/core/model/SecurityList.java | 17 +- .../com/oracle/bmc/core/model/Subnet.java | 17 +- .../oracle/bmc/core/model/TunnelStatus.java | 17 +- .../model/UpdateVirtualCircuitDetails.java | 194 ++++++ .../java/com/oracle/bmc/core/model/Vcn.java | 17 +- .../oracle/bmc/core/model/VirtualCircuit.java | 479 ++++++++++++++ .../model/VirtualCircuitBandwidthShape.java | 72 ++ .../java/com/oracle/bmc/core/model/Vnic.java | 17 +- .../oracle/bmc/core/model/VnicAttachment.java | 17 +- .../com/oracle/bmc/core/model/Volume.java | 17 +- .../bmc/core/model/VolumeAttachment.java | 17 +- .../oracle/bmc/core/model/VolumeBackup.java | 17 +- .../requests/CreateVirtualCircuitRequest.java | 47 ++ .../requests/DeleteVirtualCircuitRequest.java | 45 ++ .../requests/GetVirtualCircuitRequest.java | 36 + ...istFastConnectProviderServicesRequest.java | 52 ++ ...tVirtualCircuitBandwidthShapesRequest.java | 52 ++ .../requests/ListVirtualCircuitsRequest.java | 52 ++ .../requests/UpdateVirtualCircuitRequest.java | 51 ++ .../CreateVirtualCircuitResponse.java | 53 ++ .../DeleteVirtualCircuitResponse.java | 41 ++ .../responses/GetVirtualCircuitResponse.java | 53 ++ ...stFastConnectProviderServicesResponse.java | 56 ++ ...VirtualCircuitBandwidthShapesResponse.java | 56 ++ .../ListVirtualCircuitsResponse.java | 56 ++ .../UpdateVirtualCircuitResponse.java | 53 ++ bmc-examples/pom.xml | 4 +- bmc-identity/pom.xml | 4 +- .../oracle/bmc/identity/IdentityWaiters.java | 49 +- .../com/oracle/bmc/identity/model/ApiKey.java | 17 +- .../bmc/identity/model/Compartment.java | 17 +- .../com/oracle/bmc/identity/model/Group.java | 17 +- .../com/oracle/bmc/identity/model/Policy.java | 17 +- .../bmc/identity/model/SwiftPassword.java | 17 +- .../oracle/bmc/identity/model/UIPassword.java | 17 +- .../com/oracle/bmc/identity/model/User.java | 17 +- .../identity/model/UserGroupMembership.java | 17 +- bmc-loadbalancer/pom.xml | 25 + .../oracle/bmc/loadbalancer/LoadBalancer.java | 332 ++++++++++ .../bmc/loadbalancer/LoadBalancerAsync.java | 467 +++++++++++++ .../loadbalancer/LoadBalancerAsyncClient.java | 621 ++++++++++++++++++ .../bmc/loadbalancer/LoadBalancerClient.java | 478 ++++++++++++++ .../bmc/loadbalancer/LoadBalancerWaiters.java | 140 ++++ .../internal/http/CreateBackendConverter.java | 120 ++++ .../http/CreateBackendSetConverter.java | 116 ++++ .../http/CreateCertificateConverter.java | 116 ++++ .../http/CreateListenerConverter.java | 114 ++++ .../http/CreateLoadBalancerConverter.java | 107 +++ .../internal/http/DeleteBackendConverter.java | 117 ++++ .../http/DeleteBackendSetConverter.java | 113 ++++ .../http/DeleteCertificateConverter.java | 113 ++++ .../http/DeleteListenerConverter.java | 111 ++++ .../http/DeleteLoadBalancerConverter.java | 107 +++ .../internal/http/GetBackendConverter.java | 109 +++ .../internal/http/GetBackendSetConverter.java | 103 +++ .../http/GetHealthCheckerConverter.java | 106 +++ .../http/GetLoadBalancerConverter.java | 98 +++ .../http/GetWorkRequestConverter.java | 97 +++ .../http/ListBackendSetsConverter.java | 100 +++ .../internal/http/ListBackendsConverter.java | 105 +++ .../http/ListCertificatesConverter.java | 101 +++ .../http/ListLoadBalancersConverter.java | 122 ++++ .../internal/http/ListPoliciesConverter.java | 117 ++++ .../internal/http/ListProtocolsConverter.java | 117 ++++ .../internal/http/ListShapesConverter.java | 117 ++++ .../http/ListWorkRequestsConverter.java | 119 ++++ .../internal/http/UpdateBackendConverter.java | 125 ++++ .../http/UpdateBackendSetConverter.java | 121 ++++ .../http/UpdateHealthCheckerConverter.java | 122 ++++ .../http/UpdateListenerConverter.java | 119 ++++ .../http/UpdateLoadBalancerConverter.java | 115 ++++ .../bmc/loadbalancer/model/Backend.java | 157 +++++ .../loadbalancer/model/BackendDetails.java | 134 ++++ .../bmc/loadbalancer/model/BackendSet.java | 103 +++ .../loadbalancer/model/BackendSetDetails.java | 86 +++ .../bmc/loadbalancer/model/Certificate.java | 107 +++ .../model/CertificateDetails.java | 138 ++++ .../model/CreateBackendDetails.java | 137 ++++ .../model/CreateBackendSetDetails.java | 101 +++ .../model/CreateCertificateDetails.java | 138 ++++ .../model/CreateListenerDetails.java | 115 ++++ .../model/CreateLoadBalancerDetails.java | 127 ++++ .../bmc/loadbalancer/model/HealthChecker.java | 169 +++++ .../model/HealthCheckerDetails.java | 164 +++++ .../bmc/loadbalancer/model/IpAddress.java | 58 ++ .../bmc/loadbalancer/model/Listener.java | 112 ++++ .../loadbalancer/model/ListenerDetails.java | 96 +++ .../bmc/loadbalancer/model/LoadBalancer.java | 234 +++++++ .../model/LoadBalancerPolicy.java | 58 ++ .../model/LoadBalancerProtocol.java | 55 ++ .../loadbalancer/model/LoadBalancerShape.java | 60 ++ .../loadbalancer/model/SSLConfiguration.java | 91 +++ .../model/SSLConfigurationDetails.java | 84 +++ .../model/UpdateBackendDetails.java | 110 ++++ .../model/UpdateBackendSetDetails.java | 88 +++ .../model/UpdateHealthCheckerDetails.java | 177 +++++ .../model/UpdateListenerDetails.java | 97 +++ .../model/UpdateLoadBalancerDetails.java | 58 ++ .../bmc/loadbalancer/model/WorkRequest.java | 207 ++++++ .../loadbalancer/model/WorkRequestError.java | 109 +++ .../requests/CreateBackendRequest.java | 70 ++ .../requests/CreateBackendSetRequest.java | 61 ++ .../requests/CreateCertificateRequest.java | 61 ++ .../requests/CreateListenerRequest.java | 61 ++ .../requests/CreateLoadBalancerRequest.java | 55 ++ .../requests/DeleteBackendRequest.java | 62 ++ .../requests/DeleteBackendSetRequest.java | 53 ++ .../requests/DeleteCertificateRequest.java | 53 ++ .../requests/DeleteListenerRequest.java | 53 ++ .../requests/DeleteLoadBalancerRequest.java | 44 ++ .../requests/GetBackendRequest.java | 62 ++ .../requests/GetBackendSetRequest.java | 53 ++ .../requests/GetHealthCheckerRequest.java | 53 ++ .../requests/GetLoadBalancerRequest.java | 44 ++ .../requests/GetWorkRequestRequest.java | 44 ++ .../requests/ListBackendSetsRequest.java | 44 ++ .../requests/ListBackendsRequest.java | 53 ++ .../requests/ListCertificatesRequest.java | 44 ++ .../requests/ListLoadBalancersRequest.java | 71 ++ .../requests/ListPoliciesRequest.java | 62 ++ .../requests/ListProtocolsRequest.java | 62 ++ .../requests/ListShapesRequest.java | 62 ++ .../requests/ListWorkRequestsRequest.java | 62 ++ .../requests/UpdateBackendRequest.java | 79 +++ .../requests/UpdateBackendSetRequest.java | 70 ++ .../requests/UpdateHealthCheckerRequest.java | 70 ++ .../requests/UpdateListenerRequest.java | 70 ++ .../requests/UpdateLoadBalancerRequest.java | 61 ++ .../responses/CreateBackendResponse.java | 47 ++ .../responses/CreateBackendSetResponse.java | 47 ++ .../responses/CreateCertificateResponse.java | 47 ++ .../responses/CreateListenerResponse.java | 47 ++ .../responses/CreateLoadBalancerResponse.java | 47 ++ .../responses/DeleteBackendResponse.java | 47 ++ .../responses/DeleteBackendSetResponse.java | 47 ++ .../responses/DeleteCertificateResponse.java | 47 ++ .../responses/DeleteListenerResponse.java | 47 ++ .../responses/DeleteLoadBalancerResponse.java | 47 ++ .../responses/GetBackendResponse.java | 47 ++ .../responses/GetBackendSetResponse.java | 47 ++ .../responses/GetHealthCheckerResponse.java | 47 ++ .../responses/GetLoadBalancerResponse.java | 47 ++ .../responses/GetWorkRequestResponse.java | 47 ++ .../responses/ListBackendSetsResponse.java | 47 ++ .../responses/ListBackendsResponse.java | 47 ++ .../responses/ListCertificatesResponse.java | 47 ++ .../responses/ListLoadBalancersResponse.java | 56 ++ .../responses/ListPoliciesResponse.java | 56 ++ .../responses/ListProtocolsResponse.java | 56 ++ .../responses/ListShapesResponse.java | 56 ++ .../responses/ListWorkRequestsResponse.java | 56 ++ .../responses/UpdateBackendResponse.java | 47 ++ .../responses/UpdateBackendSetResponse.java | 47 ++ .../UpdateHealthCheckerResponse.java | 47 ++ .../responses/UpdateListenerResponse.java | 47 ++ .../responses/UpdateLoadBalancerResponse.java | 47 ++ bmc-objectstorage/pom.xml | 4 +- .../transfer/MultipartObjectAssembler.java | 8 +- pom.xml | 3 +- 196 files changed, 15389 insertions(+), 243 deletions(-) create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/internal/http/CreateVirtualCircuitConverter.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/internal/http/DeleteVirtualCircuitConverter.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/internal/http/GetVirtualCircuitConverter.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/internal/http/ListFastConnectProviderServicesConverter.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/internal/http/ListVirtualCircuitBandwidthShapesConverter.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/internal/http/ListVirtualCircuitsConverter.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/internal/http/UpdateVirtualCircuitConverter.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/model/CreateVirtualCircuitDetails.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/model/CrossConnectMapping.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/model/FastConnectProviderService.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/model/UpdateVirtualCircuitDetails.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/model/VirtualCircuit.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/model/VirtualCircuitBandwidthShape.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/requests/CreateVirtualCircuitRequest.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/requests/DeleteVirtualCircuitRequest.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/requests/GetVirtualCircuitRequest.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/requests/ListFastConnectProviderServicesRequest.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/requests/ListVirtualCircuitBandwidthShapesRequest.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/requests/ListVirtualCircuitsRequest.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/requests/UpdateVirtualCircuitRequest.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/responses/CreateVirtualCircuitResponse.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/responses/DeleteVirtualCircuitResponse.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/responses/GetVirtualCircuitResponse.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/responses/ListFastConnectProviderServicesResponse.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/responses/ListVirtualCircuitBandwidthShapesResponse.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/responses/ListVirtualCircuitsResponse.java create mode 100644 bmc-core/src/main/java/com/oracle/bmc/core/responses/UpdateVirtualCircuitResponse.java create mode 100644 bmc-loadbalancer/pom.xml create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancer.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsync.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsyncClient.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerClient.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerWaiters.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateBackendConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateBackendSetConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateCertificateConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateListenerConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateLoadBalancerConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteBackendConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteBackendSetConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteCertificateConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteListenerConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteLoadBalancerConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetBackendConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetBackendSetConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetHealthCheckerConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetLoadBalancerConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetWorkRequestConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListBackendSetsConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListBackendsConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListCertificatesConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListLoadBalancersConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListPoliciesConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListProtocolsConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListShapesConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListWorkRequestsConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateBackendConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateBackendSetConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateHealthCheckerConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateListenerConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateLoadBalancerConverter.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Backend.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSet.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSetDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Certificate.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CertificateDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendSetDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateCertificateDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateListenerDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateLoadBalancerDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthChecker.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthCheckerDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/IpAddress.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Listener.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/ListenerDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancer.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerPolicy.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerProtocol.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerShape.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfiguration.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfigurationDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateBackendDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateBackendSetDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateHealthCheckerDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateListenerDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateLoadBalancerDetails.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/WorkRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/WorkRequestError.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateBackendRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateBackendSetRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateCertificateRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateListenerRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateLoadBalancerRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendSetRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteCertificateRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteListenerRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteLoadBalancerRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendSetRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetHealthCheckerRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetLoadBalancerRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetWorkRequestRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListBackendSetsRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListBackendsRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListCertificatesRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListLoadBalancersRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListPoliciesRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListProtocolsRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListShapesRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListWorkRequestsRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendSetRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateHealthCheckerRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateListenerRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateLoadBalancerRequest.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateBackendResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateBackendSetResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateCertificateResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateListenerResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateLoadBalancerResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteBackendResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteBackendSetResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteCertificateResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteListenerResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteLoadBalancerResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetBackendResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetBackendSetResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetHealthCheckerResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetLoadBalancerResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetWorkRequestResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListBackendSetsResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListBackendsResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListCertificatesResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListLoadBalancersResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListPoliciesResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListProtocolsResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListShapesResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListWorkRequestsResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateBackendResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateBackendSetResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateHealthCheckerResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateListenerResponse.java create mode 100644 bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateLoadBalancerResponse.java diff --git a/CHANGELOG.md b/CHANGELOG.md index ef6c24d95aa..265685ba75f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Added - N/A +## 1.2.7 - 2017-04-27 +### Changed +- A new value called UnknownEnumValue has been added to all enums that are used in responses returned from services. If a service returns a value that cannot be recognized by the version of the SDK, then the enum will be set to this value. Previously this would throw an exception. + +### Added +- Support for FastConnect +- Support for Load Balancer Service + ## 1.2.5 - 2017-04-06 ### Changed - Added opc-client-request-id truncation logic in MultipartObjectAssembler to prevent failures diff --git a/bmc-audit/pom.xml b/bmc-audit/pom.xml index 93a2d94abaa..acba792e53b 100644 --- a/bmc-audit/pom.xml +++ b/bmc-audit/pom.xml @@ -5,7 +5,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk - 1.2.5 + 1.2.7 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk-common - 1.2.5 + 1.2.7 diff --git a/bmc-audit/src/main/java/com/oracle/bmc/audit/internal/http/ListEventsConverter.java b/bmc-audit/src/main/java/com/oracle/bmc/audit/internal/http/ListEventsConverter.java index 901109fdb69..4ee520d74a7 100644 --- a/bmc-audit/src/main/java/com/oracle/bmc/audit/internal/http/ListEventsConverter.java +++ b/bmc-audit/src/main/java/com/oracle/bmc/audit/internal/http/ListEventsConverter.java @@ -44,20 +44,23 @@ public static Invocation.Builder fromRequest(RestClient client, ListEventsReques throw new NullPointerException("compartmentId is required"); } + if (request.getStartTime() == null) { + throw new NullPointerException("startTime is required"); + } + + if (request.getEndTime() == null) { + throw new NullPointerException("endTime is required"); + } + WebTarget target = client.getBaseTarget().path("/20160918").path("auditEvents"); target = target.queryParam( "compartmentId", attemptEncodeQueryParam(request.getCompartmentId())); - if (request.getStartTime() != null) { - target = - target.queryParam("startTime", attemptEncodeQueryParam(request.getStartTime())); - } + target = target.queryParam("startTime", attemptEncodeQueryParam(request.getStartTime())); - if (request.getEndTime() != null) { - target = target.queryParam("endTime", attemptEncodeQueryParam(request.getEndTime())); - } + target = target.queryParam("endTime", attemptEncodeQueryParam(request.getEndTime())); if (request.getPage() != null) { target = target.queryParam("page", attemptEncodeQueryParam(request.getPage())); diff --git a/bmc-bom/pom.xml b/bmc-bom/pom.xml index 696e9f94396..1aed43ef48f 100644 --- a/bmc-bom/pom.xml +++ b/bmc-bom/pom.xml @@ -7,7 +7,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk - 1.2.5 + 1.2.7 ../pom.xml @@ -24,7 +24,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk-common - 1.2.5 + 1.2.7 false @@ -33,25 +33,31 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk-audit - 1.2.5 + 1.2.7 false com.oracle.bmc.sdk oracle-bmc-java-sdk-core - 1.2.5 + 1.2.7 false com.oracle.bmc.sdk oracle-bmc-java-sdk-identity - 1.2.5 + 1.2.7 + false + + + com.oracle.bmc.sdk + oracle-bmc-java-sdk-loadbalancer + 1.2.7 false com.oracle.bmc.sdk oracle-bmc-java-sdk-objectstorage - 1.2.5 + 1.2.7 false diff --git a/bmc-common/pom.xml b/bmc-common/pom.xml index 0c8f0337a51..dbd2c89c99f 100644 --- a/bmc-common/pom.xml +++ b/bmc-common/pom.xml @@ -5,7 +5,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk - 1.2.5 + 1.2.7 ../pom.xml diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/PEMFileRSAPrivateKeySupplier.java b/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/PEMFileRSAPrivateKeySupplier.java index cf66293ab7f..294c2d1101f 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/PEMFileRSAPrivateKeySupplier.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/PEMFileRSAPrivateKeySupplier.java @@ -25,6 +25,7 @@ import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.base.Throwables; +import com.oracle.bmc.util.StreamUtils; import lombok.extern.slf4j.Slf4j; @@ -49,7 +50,7 @@ public class PEMFileRSAPrivateKeySupplier implements KeySupplier /** * Constructs a new file key supplier which reads the private key from the - * specified file. + * specified file. The provided stream will be closed by this supplier automatically. * * @param inputStream * the path to the RSA private key @@ -95,6 +96,8 @@ public PEMFileRSAPrivateKeySupplier( } this.key = (RSAPrivateKey) converter.getPrivateKey(keyInfo); + } finally { + StreamUtils.closeQuietly(inputStream); } } catch (IOException ex) { LOG.debug("Failed to read RSA private key from file", ex); diff --git a/bmc-core/pom.xml b/bmc-core/pom.xml index d6463cbdfb9..f9dc324c167 100644 --- a/bmc-core/pom.xml +++ b/bmc-core/pom.xml @@ -5,7 +5,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk - 1.2.5 + 1.2.7 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk-common - 1.2.5 + 1.2.7 diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageWaiters.java b/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageWaiters.java index b3ce1bf05b0..5d36743815c 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageWaiters.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageWaiters.java @@ -3,7 +3,6 @@ */ package com.oracle.bmc.core; -import com.oracle.bmc.core.model.*; import com.oracle.bmc.core.requests.*; import com.oracle.bmc.core.responses.*; @@ -38,7 +37,7 @@ public class BlockstorageWaiters { * @return A new Waiter instance. */ public Waiter forVolume( - GetVolumeRequest request, Volume.LifecycleState targetState) { + GetVolumeRequest request, com.oracle.bmc.core.model.Volume.LifecycleState targetState) { return forVolume(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -53,7 +52,7 @@ public Waiter forVolume( */ public Waiter forVolume( GetVolumeRequest request, - Volume.LifecycleState targetState, + com.oracle.bmc.core.model.Volume.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forVolume( @@ -64,7 +63,7 @@ public Waiter forVolume( private Waiter forVolume( BmcGenericWaiter waiter, final GetVolumeRequest request, - final Volume.LifecycleState targetState) { + final com.oracle.bmc.core.model.Volume.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -81,7 +80,7 @@ public boolean apply(GetVolumeResponse response) { return response.getVolume().getLifecycleState() == targetState; } }, - targetState == Volume.LifecycleState.Terminated), + targetState == com.oracle.bmc.core.model.Volume.LifecycleState.Terminated), request); } @@ -93,7 +92,8 @@ public boolean apply(GetVolumeResponse response) { * @return A new Waiter instance. */ public Waiter forVolumeBackup( - GetVolumeBackupRequest request, VolumeBackup.LifecycleState targetState) { + GetVolumeBackupRequest request, + com.oracle.bmc.core.model.VolumeBackup.LifecycleState targetState) { return forVolumeBackup(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -108,7 +108,7 @@ public Waiter forVolumeBackup( */ public Waiter forVolumeBackup( GetVolumeBackupRequest request, - VolumeBackup.LifecycleState targetState, + com.oracle.bmc.core.model.VolumeBackup.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forVolumeBackup( @@ -119,7 +119,7 @@ public Waiter forVolumeBackup( private Waiter forVolumeBackup( BmcGenericWaiter waiter, final GetVolumeBackupRequest request, - final VolumeBackup.LifecycleState targetState) { + final com.oracle.bmc.core.model.VolumeBackup.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -137,7 +137,9 @@ public boolean apply(GetVolumeBackupResponse response) { == targetState; } }, - targetState == VolumeBackup.LifecycleState.Terminated), + targetState + == com.oracle.bmc.core.model.VolumeBackup.LifecycleState + .Terminated), request); } } diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/ComputeWaiters.java b/bmc-core/src/main/java/com/oracle/bmc/core/ComputeWaiters.java index 1bd92baad7a..986488006da 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/ComputeWaiters.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/ComputeWaiters.java @@ -3,7 +3,6 @@ */ package com.oracle.bmc.core; -import com.oracle.bmc.core.model.*; import com.oracle.bmc.core.requests.*; import com.oracle.bmc.core.responses.*; @@ -38,7 +37,8 @@ public class ComputeWaiters { * @return A new Waiter instance. */ public Waiter forConsoleHistory( - GetConsoleHistoryRequest request, ConsoleHistory.LifecycleState targetState) { + GetConsoleHistoryRequest request, + com.oracle.bmc.core.model.ConsoleHistory.LifecycleState targetState) { return forConsoleHistory(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -53,7 +53,7 @@ public Waiter forConsoleHis */ public Waiter forConsoleHistory( GetConsoleHistoryRequest request, - ConsoleHistory.LifecycleState targetState, + com.oracle.bmc.core.model.ConsoleHistory.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forConsoleHistory( @@ -64,7 +64,7 @@ public Waiter forConsoleHis private Waiter forConsoleHistory( BmcGenericWaiter waiter, final GetConsoleHistoryRequest request, - final ConsoleHistory.LifecycleState targetState) { + final com.oracle.bmc.core.model.ConsoleHistory.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -95,7 +95,7 @@ public boolean apply(GetConsoleHistoryResponse response) { * @return A new Waiter instance. */ public Waiter forImage( - GetImageRequest request, Image.LifecycleState targetState) { + GetImageRequest request, com.oracle.bmc.core.model.Image.LifecycleState targetState) { return forImage(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -110,7 +110,7 @@ public Waiter forImage( */ public Waiter forImage( GetImageRequest request, - Image.LifecycleState targetState, + com.oracle.bmc.core.model.Image.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forImage( @@ -121,7 +121,7 @@ public Waiter forImage( private Waiter forImage( BmcGenericWaiter waiter, final GetImageRequest request, - final Image.LifecycleState targetState) { + final com.oracle.bmc.core.model.Image.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -138,7 +138,7 @@ public boolean apply(GetImageResponse response) { return response.getImage().getLifecycleState() == targetState; } }, - targetState == Image.LifecycleState.Deleted), + targetState == com.oracle.bmc.core.model.Image.LifecycleState.Deleted), request); } @@ -150,7 +150,8 @@ public boolean apply(GetImageResponse response) { * @return A new Waiter instance. */ public Waiter forInstance( - GetInstanceRequest request, Instance.LifecycleState targetState) { + GetInstanceRequest request, + com.oracle.bmc.core.model.Instance.LifecycleState targetState) { return forInstance(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -165,7 +166,7 @@ public Waiter forInstance( */ public Waiter forInstance( GetInstanceRequest request, - Instance.LifecycleState targetState, + com.oracle.bmc.core.model.Instance.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forInstance( @@ -176,7 +177,7 @@ public Waiter forInstance( private Waiter forInstance( BmcGenericWaiter waiter, final GetInstanceRequest request, - final Instance.LifecycleState targetState) { + final com.oracle.bmc.core.model.Instance.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -193,7 +194,8 @@ public boolean apply(GetInstanceResponse response) { return response.getInstance().getLifecycleState() == targetState; } }, - targetState == Instance.LifecycleState.Terminated), + targetState + == com.oracle.bmc.core.model.Instance.LifecycleState.Terminated), request); } @@ -205,7 +207,8 @@ public boolean apply(GetInstanceResponse response) { * @return A new Waiter instance. */ public Waiter forVolumeAttachment( - GetVolumeAttachmentRequest request, VolumeAttachment.LifecycleState targetState) { + GetVolumeAttachmentRequest request, + com.oracle.bmc.core.model.VolumeAttachment.LifecycleState targetState) { return forVolumeAttachment(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -220,7 +223,7 @@ public Waiter forVolume */ public Waiter forVolumeAttachment( GetVolumeAttachmentRequest request, - VolumeAttachment.LifecycleState targetState, + com.oracle.bmc.core.model.VolumeAttachment.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forVolumeAttachment( @@ -231,7 +234,7 @@ public Waiter forVolume private Waiter forVolumeAttachment( BmcGenericWaiter waiter, final GetVolumeAttachmentRequest request, - final VolumeAttachment.LifecycleState targetState) { + final com.oracle.bmc.core.model.VolumeAttachment.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetwork.java b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetwork.java index 96c3dba573c..5007442b238 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetwork.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetwork.java @@ -39,13 +39,13 @@ public interface VirtualNetwork extends AutoCloseable { void setRegion(String regionId); /** - * Creates a new virtual Customer-Premise Equipment (CPE) object in the specified compartment. For - * more information, see [Managing Customer-Premise Equipment (CPE)](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingCPEs.htm). + * Creates a new virtual Customer-Premises Equipment (CPE) object in the specified compartment. For + * more information, see [Managing IPSec VPNs](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingIPsec.htm). *

* For the purposes of access control, you must provide the OCID of the compartment where you want * the CPE to reside. Notice that the CPE doesn't have to be in the same compartment as the IPSec * connection or other Networking Service components. If you're not sure which compartment to - * use, put the CPE in the same compartment as the IPSec connection. For more information about + * use, put the CPE in the same compartment as the DRG. For more information about * compartments and access control, see [Overview of the IAM Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). * For information about OCIDs, see [Resource Identifiers](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). *

@@ -105,8 +105,9 @@ public interface VirtualNetwork extends AutoCloseable { CreateDrgResponse createDrg(CreateDrgRequest request); /** - * Attaches the specified DRG to the specified VCN. A VCN can be attached to only one DRG at a time. - * The response includes a `DrgAttachment` object with its own OCID. For more information about DRGs, see + * Attaches the specified DRG to the specified VCN. A VCN can be attached to only one DRG at a time, + * and vice versa. The response includes a `DrgAttachment` object with its own OCID. For more + * information about DRGs, see * [Managing Dynamic Routing Gateways (DRGs)](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingDRGs.htm). *

* You may optionally specify a *display name* for the attachment, otherwise a default is provided. @@ -133,7 +134,7 @@ public interface VirtualNetwork extends AutoCloseable { * For the purposes of access control, you must provide the OCID of the compartment where you want the * IPSec connection to reside. Notice that the IPSec connection doesn't have to be in the same compartment * as the DRG, CPE, or other Networking Service components. If you're not sure which compartment to - * use, put the IPSec connection in the same compartment as the CPE. For more information about + * use, put the IPSec connection in the same compartment as the DRG. For more information about * compartments and access control, see * [Overview of the IAM Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). * For information about OCIDs, see [Resource Identifiers](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). @@ -301,9 +302,9 @@ public interface VirtualNetwork extends AutoCloseable { * The OCID for each is returned in the response. You can't delete these default objects, but you can change their * contents (i.e., route rules, etc.) *

- * The VCN and subnets you create are not accessible until you attach an Internet Gateway or set up a VPN. - * For more information, see - * [Typical Networking Service Scenarios](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm#three). + * The VCN and subnets you create are not accessible until you attach an Internet Gateway or set up an IPSec VPN + * or FastConnect. For more information, see + * [Overview of the Networking Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm). * * * @param request The request object containing the details to send @@ -312,6 +313,36 @@ public interface VirtualNetwork extends AutoCloseable { */ CreateVcnResponse createVcn(CreateVcnRequest request); + /** + * Creates a new virtual circuit to use with Oracle Bare Metal Cloud + * Services FastConnect. For more information, see + * [FastConnect](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + *

+ * For the purposes of access control, you must provide the OCID of the + * compartment where you want the virtual circuit to reside. If you're + * not sure which compartment to use, put the virtual circuit in the + * same compartment with the DRG it's using. For more information about + * compartments and access control, see + * [Overview of the IAM Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). + * For information about OCIDs, see + * [Resource Identifiers](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + *

+ * You may optionally specify a *display name* for the virtual circuit. + * It does not have to be unique, and you can change it. + *

+ **Important:** When creating a virtual circuit, you specify a DRG for + * the traffic to flow through. Make sure you attach the DRG to your + * VCN and confirm the VCN's routing sends traffic to the DRG. Otherwise + * traffic will not flow. For more information, see + * [Managing Route Tables](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm). + * + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + CreateVirtualCircuitResponse createVirtualCircuit(CreateVirtualCircuitRequest request); + /** * Deletes the specified CPE object. The CPE must not be connected to a DRG. This is an asynchronous * operation; the CPE's `lifecycleState` will change to TERMINATING temporarily until the CPE is completely @@ -364,9 +395,9 @@ public interface VirtualNetwork extends AutoCloseable { DeleteDrgAttachmentResponse deleteDrgAttachment(DeleteDrgAttachmentRequest request); /** - * Deletes the specified IPSec connection. If your goal is to disable the VPN between your VCN and - * on-premise network, it's easiest to simply detach the DRG but keep all the VPN components intact. - * If you were to delete all the components and then later need to create a VPN again, you would + * Deletes the specified IPSec connection. If your goal is to disable the IPSec VPN between your VCN and + * on-premise network, it's easiest to simply detach the DRG but keep all the IPSec VPN components intact. + * If you were to delete all the components and then later need to create an IPSec VPN again, you would * need to configure your on-premise router again with the new information returned from * {@link #createIPSecConnection(CreateIPSecConnectionRequest) createIPSecConnection}. *

@@ -446,6 +477,19 @@ public interface VirtualNetwork extends AutoCloseable { */ DeleteVcnResponse deleteVcn(DeleteVcnRequest request); + /** + * Deletes the specified virtual circuit. + *

+ **Important:** Make sure to also terminate the connection with + * the provider, or else the provider may continue to bill you. + * + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + DeleteVirtualCircuitResponse deleteVirtualCircuit(DeleteVirtualCircuitRequest request); + /** * Gets the specified CPE's information. * @@ -562,6 +606,15 @@ GetIPSecConnectionDeviceStatusResponse getIPSecConnectionDeviceStatus( */ GetVcnResponse getVcn(GetVcnRequest request); + /** + * Gets the specified virtual circuit's information. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + GetVirtualCircuitResponse getVirtualCircuit(GetVirtualCircuitRequest request); + /** * Gets the information for the specified Virtual Network Interface Card (VNIC), including the attached * instance's public and private IP addresses. You can get the instance's VNIC OCID from the @@ -575,7 +628,7 @@ GetIPSecConnectionDeviceStatusResponse getIPSecConnectionDeviceStatus( GetVnicResponse getVnic(GetVnicRequest request); /** - * Lists the Customer-Premise Equipment objects (CPEs) in the specified compartment. + * Lists the Customer-Premises Equipment objects (CPEs) in the specified compartment. * * * @param request The request object containing the details to send @@ -617,6 +670,23 @@ GetIPSecConnectionDeviceStatusResponse getIPSecConnectionDeviceStatus( */ ListDrgsResponse listDrgs(ListDrgsRequest request); + /** + * Lists the service offerings from supported providers. You need this + * information so you can specify your desired provider and service + * offering when you create a virtual circuit. + *

+ * For the compartment ID, provide the OCID of your tenancy (the root compartment). + *

+ * For more information, see [FastConnect](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + * + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListFastConnectProviderServicesResponse listFastConnectProviderServices( + ListFastConnectProviderServicesRequest request); + /** * Lists the IPSec connections for the specified compartment. You can filter the * results by DRG or CPE. @@ -680,6 +750,34 @@ GetIPSecConnectionDeviceStatusResponse getIPSecConnectionDeviceStatus( */ ListVcnsResponse listVcns(ListVcnsRequest request); + /** + * Lists the available bandwidth levels for virtual circuits. You need this + * information so you can specify your desired bandwidth level (i.e., shape) + * when you create a virtual circuit. + *

+ * For the compartment ID, provide the OCID of your tenancy (the root compartment). + *

+ * For more information about virtual circuits, see + * [FastConnect](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + * + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListVirtualCircuitBandwidthShapesResponse listVirtualCircuitBandwidthShapes( + ListVirtualCircuitBandwidthShapesRequest request); + + /** + * Lists the virtual circuits in the specified compartment. + * + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListVirtualCircuitsResponse listVirtualCircuits(ListVirtualCircuitsRequest request); + /** * Updates the specified CPE's display name. * @@ -787,6 +885,31 @@ GetIPSecConnectionDeviceStatusResponse getIPSecConnectionDeviceStatus( */ UpdateVcnResponse updateVcn(UpdateVcnRequest request); + /** + * Updates the specified virtual circuit. This can be called by + * either the customer who owns the virtual circuit, or the + * provider (when provisioning or de-provisioning the virtual + * circuit from their end). The documentation for + * {@link #updateVirtualCircuitDetails(UpdateVirtualCircuitDetailsRequest) updateVirtualCircuitDetails} + * indicates who can update each property of the virtual circuit. + *

+ **Important:** If the virtual circuit is working and in the + * PROVISIONED state, updating any of the network-related properties + * (such as the DRG being used, the BGP ASN, etc.) will cause the virtual + * circuit's state to switch to PROVISIONING and the related BGP + * session to go down. After Oracle re-provisions the virtual circuit, + * its state will return to PROVISIONED. Make sure you confirm that + * the associated BGP session is back up. For more information + * about the various states and how to test connectivity, see + * [FastConnect](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + * + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + UpdateVirtualCircuitResponse updateVirtualCircuit(UpdateVirtualCircuitRequest request); + /** * Gets the pre-configured waiters available for resources for this service. * diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsync.java b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsync.java index 20d666b1156..462c6f1bcc9 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsync.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsync.java @@ -43,13 +43,13 @@ public interface VirtualNetworkAsync extends AutoCloseable { void setRegion(String regionId); /** - * Creates a new virtual Customer-Premise Equipment (CPE) object in the specified compartment. For - * more information, see [Managing Customer-Premise Equipment (CPE)](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingCPEs.htm). + * Creates a new virtual Customer-Premises Equipment (CPE) object in the specified compartment. For + * more information, see [Managing IPSec VPNs](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingIPsec.htm). *

* For the purposes of access control, you must provide the OCID of the compartment where you want * the CPE to reside. Notice that the CPE doesn't have to be in the same compartment as the IPSec * connection or other Networking Service components. If you're not sure which compartment to - * use, put the CPE in the same compartment as the IPSec connection. For more information about + * use, put the CPE in the same compartment as the DRG. For more information about * compartments and access control, see [Overview of the IAM Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). * For information about OCIDs, see [Resource Identifiers](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). *

@@ -122,8 +122,9 @@ Future createDrg( CreateDrgRequest request, AsyncHandler handler); /** - * Attaches the specified DRG to the specified VCN. A VCN can be attached to only one DRG at a time. - * The response includes a `DrgAttachment` object with its own OCID. For more information about DRGs, see + * Attaches the specified DRG to the specified VCN. A VCN can be attached to only one DRG at a time, + * and vice versa. The response includes a `DrgAttachment` object with its own OCID. For more + * information about DRGs, see * [Managing Dynamic Routing Gateways (DRGs)](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingDRGs.htm). *

* You may optionally specify a *display name* for the attachment, otherwise a default is provided. @@ -155,7 +156,7 @@ Future createDrgAttachment( * For the purposes of access control, you must provide the OCID of the compartment where you want the * IPSec connection to reside. Notice that the IPSec connection doesn't have to be in the same compartment * as the DRG, CPE, or other Networking Service components. If you're not sure which compartment to - * use, put the IPSec connection in the same compartment as the CPE. For more information about + * use, put the IPSec connection in the same compartment as the DRG. For more information about * compartments and access control, see * [Overview of the IAM Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). * For information about OCIDs, see [Resource Identifiers](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). @@ -348,9 +349,9 @@ Future createSubnet( * The OCID for each is returned in the response. You can't delete these default objects, but you can change their * contents (i.e., route rules, etc.) *

- * The VCN and subnets you create are not accessible until you attach an Internet Gateway or set up a VPN. - * For more information, see - * [Typical Networking Service Scenarios](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm#three). + * The VCN and subnets you create are not accessible until you attach an Internet Gateway or set up an IPSec VPN + * or FastConnect. For more information, see + * [Overview of the Networking Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm). * * * @param request The request object containing the details to send @@ -363,6 +364,41 @@ Future createSubnet( Future createVcn( CreateVcnRequest request, AsyncHandler handler); + /** + * Creates a new virtual circuit to use with Oracle Bare Metal Cloud + * Services FastConnect. For more information, see + * [FastConnect](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + *

+ * For the purposes of access control, you must provide the OCID of the + * compartment where you want the virtual circuit to reside. If you're + * not sure which compartment to use, put the virtual circuit in the + * same compartment with the DRG it's using. For more information about + * compartments and access control, see + * [Overview of the IAM Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). + * For information about OCIDs, see + * [Resource Identifiers](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + *

+ * You may optionally specify a *display name* for the virtual circuit. + * It does not have to be unique, and you can change it. + *

+ **Important:** When creating a virtual circuit, you specify a DRG for + * the traffic to flow through. Make sure you attach the DRG to your + * VCN and confirm the VCN's routing sends traffic to the DRG. Otherwise + * traffic will not flow. For more information, see + * [Managing Route Tables](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm). + * + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future createVirtualCircuit( + CreateVirtualCircuitRequest request, + AsyncHandler handler); + /** * Deletes the specified CPE object. The CPE must not be connected to a DRG. This is an asynchronous * operation; the CPE's `lifecycleState` will change to TERMINATING temporarily until the CPE is completely @@ -433,9 +469,9 @@ Future deleteDrgAttachment( AsyncHandler handler); /** - * Deletes the specified IPSec connection. If your goal is to disable the VPN between your VCN and - * on-premise network, it's easiest to simply detach the DRG but keep all the VPN components intact. - * If you were to delete all the components and then later need to create a VPN again, you would + * Deletes the specified IPSec connection. If your goal is to disable the IPSec VPN between your VCN and + * on-premise network, it's easiest to simply detach the DRG but keep all the IPSec VPN components intact. + * If you were to delete all the components and then later need to create an IPSec VPN again, you would * need to configure your on-premise router again with the new information returned from * {@link #createIPSecConnection(CreateIPSecConnectionRequest, Consumer, Consumer) createIPSecConnection}. *

@@ -544,6 +580,24 @@ Future deleteSubnet( Future deleteVcn( DeleteVcnRequest request, AsyncHandler handler); + /** + * Deletes the specified virtual circuit. + *

+ **Important:** Make sure to also terminate the connection with + * the provider, or else the provider may continue to bill you. + * + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future deleteVirtualCircuit( + DeleteVirtualCircuitRequest request, + AsyncHandler handler); + /** * Gets the specified CPE's information. * @@ -720,6 +774,20 @@ Future getSubnet( Future getVcn( GetVcnRequest request, AsyncHandler handler); + /** + * Gets the specified virtual circuit's information. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future getVirtualCircuit( + GetVirtualCircuitRequest request, + AsyncHandler handler); + /** * Gets the information for the specified Virtual Network Interface Card (VNIC), including the attached * instance's public and private IP addresses. You can get the instance's VNIC OCID from the @@ -737,7 +805,7 @@ Future getVnic( GetVnicRequest request, AsyncHandler handler); /** - * Lists the Customer-Premise Equipment objects (CPEs) in the specified compartment. + * Lists the Customer-Premises Equipment objects (CPEs) in the specified compartment. * * * @param request The request object containing the details to send @@ -797,6 +865,30 @@ Future listDrgAttachments( Future listDrgs( ListDrgsRequest request, AsyncHandler handler); + /** + * Lists the service offerings from supported providers. You need this + * information so you can specify your desired provider and service + * offering when you create a virtual circuit. + *

+ * For the compartment ID, provide the OCID of your tenancy (the root compartment). + *

+ * For more information, see [FastConnect](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + * + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future listFastConnectProviderServices( + ListFastConnectProviderServicesRequest request, + AsyncHandler< + ListFastConnectProviderServicesRequest, + ListFastConnectProviderServicesResponse> + handler); + /** * Lists the IPSec connections for the specified compartment. You can filter the * results by DRG or CPE. @@ -889,6 +981,46 @@ Future listSubnets( Future listVcns( ListVcnsRequest request, AsyncHandler handler); + /** + * Lists the available bandwidth levels for virtual circuits. You need this + * information so you can specify your desired bandwidth level (i.e., shape) + * when you create a virtual circuit. + *

+ * For the compartment ID, provide the OCID of your tenancy (the root compartment). + *

+ * For more information about virtual circuits, see + * [FastConnect](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + * + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future listVirtualCircuitBandwidthShapes( + ListVirtualCircuitBandwidthShapesRequest request, + AsyncHandler< + ListVirtualCircuitBandwidthShapesRequest, + ListVirtualCircuitBandwidthShapesResponse> + handler); + + /** + * Lists the virtual circuits in the specified compartment. + * + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future listVirtualCircuits( + ListVirtualCircuitsRequest request, + AsyncHandler handler); + /** * Updates the specified CPE's display name. * @@ -1042,4 +1174,34 @@ Future updateSubnet( */ Future updateVcn( UpdateVcnRequest request, AsyncHandler handler); + + /** + * Updates the specified virtual circuit. This can be called by + * either the customer who owns the virtual circuit, or the + * provider (when provisioning or de-provisioning the virtual + * circuit from their end). The documentation for + * {@link #updateVirtualCircuitDetails(UpdateVirtualCircuitDetailsRequest, Consumer, Consumer) updateVirtualCircuitDetails} + * indicates who can update each property of the virtual circuit. + *

+ **Important:** If the virtual circuit is working and in the + * PROVISIONED state, updating any of the network-related properties + * (such as the DRG being used, the BGP ASN, etc.) will cause the virtual + * circuit's state to switch to PROVISIONING and the related BGP + * session to go down. After Oracle re-provisions the virtual circuit, + * its state will return to PROVISIONED. Make sure you confirm that + * the associated BGP session is back up. For more information + * about the various states and how to test connectivity, see + * [FastConnect](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + * + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future updateVirtualCircuit( + UpdateVirtualCircuitRequest request, + AsyncHandler handler); } diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsyncClient.java b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsyncClient.java index 2ae1f4b00ff..18f5c2935cc 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsyncClient.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsyncClient.java @@ -313,6 +313,25 @@ public Future createVcn( return new TransformingFuture<>(responseFuture, transformer); } + @Override + public Future createVirtualCircuit( + CreateVirtualCircuitRequest request, + AsyncHandler handler) { + LOG.trace("Called async createVirtualCircuit"); + request = CreateVirtualCircuitConverter.interceptRequest(request); + Invocation.Builder ib = CreateVirtualCircuitConverter.fromRequest(client, request); + Function transformer = + CreateVirtualCircuitConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = + client.post( + ib, request.getCreateVirtualCircuitDetails(), request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + @Override public Future deleteCpe( DeleteCpeRequest request, AsyncHandler handler) { @@ -476,6 +495,23 @@ public Future deleteVcn( return new TransformingFuture<>(responseFuture, transformer); } + @Override + public Future deleteVirtualCircuit( + DeleteVirtualCircuitRequest request, + AsyncHandler handler) { + LOG.trace("Called async deleteVirtualCircuit"); + request = DeleteVirtualCircuitConverter.interceptRequest(request); + Invocation.Builder ib = DeleteVirtualCircuitConverter.fromRequest(client, request); + Function transformer = + DeleteVirtualCircuitConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.delete(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + @Override public Future getCpe( GetCpeRequest request, AsyncHandler handler) { @@ -680,6 +716,23 @@ public Future getVcn( return new TransformingFuture<>(responseFuture, transformer); } + @Override + public Future getVirtualCircuit( + GetVirtualCircuitRequest request, + AsyncHandler handler) { + LOG.trace("Called async getVirtualCircuit"); + request = GetVirtualCircuitConverter.interceptRequest(request); + Invocation.Builder ib = GetVirtualCircuitConverter.fromRequest(client, request); + Function transformer = + GetVirtualCircuitConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + @Override public Future getVnic( GetVnicRequest request, AsyncHandler handler) { @@ -759,6 +812,27 @@ public Future listDrgs( return new TransformingFuture<>(responseFuture, transformer); } + @Override + public Future listFastConnectProviderServices( + ListFastConnectProviderServicesRequest request, + AsyncHandler< + ListFastConnectProviderServicesRequest, + ListFastConnectProviderServicesResponse> + handler) { + LOG.trace("Called async listFastConnectProviderServices"); + request = ListFastConnectProviderServicesConverter.interceptRequest(request); + Invocation.Builder ib = + ListFastConnectProviderServicesConverter.fromRequest(client, request); + Function transformer = + ListFastConnectProviderServicesConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + @Override public Future listIPSecConnections( ListIPSecConnectionsRequest request, @@ -858,6 +932,44 @@ public Future listVcns( return new TransformingFuture<>(responseFuture, transformer); } + @Override + public Future listVirtualCircuitBandwidthShapes( + ListVirtualCircuitBandwidthShapesRequest request, + AsyncHandler< + ListVirtualCircuitBandwidthShapesRequest, + ListVirtualCircuitBandwidthShapesResponse> + handler) { + LOG.trace("Called async listVirtualCircuitBandwidthShapes"); + request = ListVirtualCircuitBandwidthShapesConverter.interceptRequest(request); + Invocation.Builder ib = + ListVirtualCircuitBandwidthShapesConverter.fromRequest(client, request); + Function transformer = + ListVirtualCircuitBandwidthShapesConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future listVirtualCircuits( + ListVirtualCircuitsRequest request, + AsyncHandler handler) { + LOG.trace("Called async listVirtualCircuits"); + request = ListVirtualCircuitsConverter.interceptRequest(request); + Invocation.Builder ib = ListVirtualCircuitsConverter.fromRequest(client, request); + Function transformer = + ListVirtualCircuitsConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + @Override public Future updateCpe( UpdateCpeRequest request, AsyncHandler handler) { @@ -1033,4 +1145,23 @@ public Future updateVcn( client.put(ib, request.getUpdateVcnDetails(), request, onSuccess, onError); return new TransformingFuture<>(responseFuture, transformer); } + + @Override + public Future updateVirtualCircuit( + UpdateVirtualCircuitRequest request, + AsyncHandler handler) { + LOG.trace("Called async updateVirtualCircuit"); + request = UpdateVirtualCircuitConverter.interceptRequest(request); + Invocation.Builder ib = UpdateVirtualCircuitConverter.fromRequest(client, request); + Function transformer = + UpdateVirtualCircuitConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = + client.put( + ib, request.getUpdateVirtualCircuitDetails(), request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } } diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkClient.java b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkClient.java index febaec8ddb0..fc5f346e191 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkClient.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkClient.java @@ -257,6 +257,18 @@ public CreateVcnResponse createVcn(CreateVcnRequest request) { return transformer.apply(response); } + @Override + public CreateVirtualCircuitResponse createVirtualCircuit(CreateVirtualCircuitRequest request) { + LOG.trace("Called createVirtualCircuit"); + request = CreateVirtualCircuitConverter.interceptRequest(request); + Invocation.Builder ib = CreateVirtualCircuitConverter.fromRequest(client, request); + Function transformer = + CreateVirtualCircuitConverter.fromResponse(); + + Response response = client.post(ib, request.getCreateVirtualCircuitDetails(), request); + return transformer.apply(response); + } + @Override public DeleteCpeResponse deleteCpe(DeleteCpeRequest request) { LOG.trace("Called deleteCpe"); @@ -375,6 +387,18 @@ public DeleteVcnResponse deleteVcn(DeleteVcnRequest request) { return transformer.apply(response); } + @Override + public DeleteVirtualCircuitResponse deleteVirtualCircuit(DeleteVirtualCircuitRequest request) { + LOG.trace("Called deleteVirtualCircuit"); + request = DeleteVirtualCircuitConverter.interceptRequest(request); + Invocation.Builder ib = DeleteVirtualCircuitConverter.fromRequest(client, request); + Function transformer = + DeleteVirtualCircuitConverter.fromResponse(); + + Response response = client.delete(ib, request); + return transformer.apply(response); + } + @Override public GetCpeResponse getCpe(GetCpeRequest request) { LOG.trace("Called getCpe"); @@ -519,6 +543,18 @@ public GetVcnResponse getVcn(GetVcnRequest request) { return transformer.apply(response); } + @Override + public GetVirtualCircuitResponse getVirtualCircuit(GetVirtualCircuitRequest request) { + LOG.trace("Called getVirtualCircuit"); + request = GetVirtualCircuitConverter.interceptRequest(request); + Invocation.Builder ib = GetVirtualCircuitConverter.fromRequest(client, request); + Function transformer = + GetVirtualCircuitConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + @Override public GetVnicResponse getVnic(GetVnicRequest request) { LOG.trace("Called getVnic"); @@ -576,6 +612,20 @@ public ListDrgsResponse listDrgs(ListDrgsRequest request) { return transformer.apply(response); } + @Override + public ListFastConnectProviderServicesResponse listFastConnectProviderServices( + ListFastConnectProviderServicesRequest request) { + LOG.trace("Called listFastConnectProviderServices"); + request = ListFastConnectProviderServicesConverter.interceptRequest(request); + Invocation.Builder ib = + ListFastConnectProviderServicesConverter.fromRequest(client, request); + Function transformer = + ListFastConnectProviderServicesConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + @Override public ListIPSecConnectionsResponse listIPSecConnections(ListIPSecConnectionsRequest request) { LOG.trace("Called listIPSecConnections"); @@ -646,6 +696,32 @@ public ListVcnsResponse listVcns(ListVcnsRequest request) { return transformer.apply(response); } + @Override + public ListVirtualCircuitBandwidthShapesResponse listVirtualCircuitBandwidthShapes( + ListVirtualCircuitBandwidthShapesRequest request) { + LOG.trace("Called listVirtualCircuitBandwidthShapes"); + request = ListVirtualCircuitBandwidthShapesConverter.interceptRequest(request); + Invocation.Builder ib = + ListVirtualCircuitBandwidthShapesConverter.fromRequest(client, request); + Function transformer = + ListVirtualCircuitBandwidthShapesConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public ListVirtualCircuitsResponse listVirtualCircuits(ListVirtualCircuitsRequest request) { + LOG.trace("Called listVirtualCircuits"); + request = ListVirtualCircuitsConverter.interceptRequest(request); + Invocation.Builder ib = ListVirtualCircuitsConverter.fromRequest(client, request); + Function transformer = + ListVirtualCircuitsConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + @Override public UpdateCpeResponse updateCpe(UpdateCpeRequest request) { LOG.trace("Called updateCpe"); @@ -764,6 +840,18 @@ public UpdateVcnResponse updateVcn(UpdateVcnRequest request) { return transformer.apply(response); } + @Override + public UpdateVirtualCircuitResponse updateVirtualCircuit(UpdateVirtualCircuitRequest request) { + LOG.trace("Called updateVirtualCircuit"); + request = UpdateVirtualCircuitConverter.interceptRequest(request); + Invocation.Builder ib = UpdateVirtualCircuitConverter.fromRequest(client, request); + Function transformer = + UpdateVirtualCircuitConverter.fromResponse(); + + Response response = client.put(ib, request.getUpdateVirtualCircuitDetails(), request); + return transformer.apply(response); + } + @Override public VirtualNetworkWaiters getWaiters() { return waiters; diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkWaiters.java b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkWaiters.java index 7f4716fcf90..156c91a9763 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkWaiters.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkWaiters.java @@ -3,7 +3,6 @@ */ package com.oracle.bmc.core; -import com.oracle.bmc.core.model.*; import com.oracle.bmc.core.requests.*; import com.oracle.bmc.core.responses.*; @@ -38,7 +37,8 @@ public class VirtualNetworkWaiters { * @return A new Waiter instance. */ public Waiter forDhcpOptions( - GetDhcpOptionsRequest request, DhcpOptions.LifecycleState targetState) { + GetDhcpOptionsRequest request, + com.oracle.bmc.core.model.DhcpOptions.LifecycleState targetState) { return forDhcpOptions(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -53,7 +53,7 @@ public Waiter forDhcpOptions( */ public Waiter forDhcpOptions( GetDhcpOptionsRequest request, - DhcpOptions.LifecycleState targetState, + com.oracle.bmc.core.model.DhcpOptions.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forDhcpOptions( @@ -64,7 +64,7 @@ public Waiter forDhcpOptions( private Waiter forDhcpOptions( BmcGenericWaiter waiter, final GetDhcpOptionsRequest request, - final DhcpOptions.LifecycleState targetState) { + final com.oracle.bmc.core.model.DhcpOptions.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -81,7 +81,8 @@ public boolean apply(GetDhcpOptionsResponse response) { return response.getDhcpOptions().getLifecycleState() == targetState; } }, - targetState == DhcpOptions.LifecycleState.Terminated), + targetState + == com.oracle.bmc.core.model.DhcpOptions.LifecycleState.Terminated), request); } @@ -93,7 +94,7 @@ public boolean apply(GetDhcpOptionsResponse response) { * @return A new Waiter instance. */ public Waiter forDrg( - GetDrgRequest request, Drg.LifecycleState targetState) { + GetDrgRequest request, com.oracle.bmc.core.model.Drg.LifecycleState targetState) { return forDrg(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -108,7 +109,7 @@ public Waiter forDrg( */ public Waiter forDrg( GetDrgRequest request, - Drg.LifecycleState targetState, + com.oracle.bmc.core.model.Drg.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forDrg(Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); @@ -118,7 +119,7 @@ public Waiter forDrg( private Waiter forDrg( BmcGenericWaiter waiter, final GetDrgRequest request, - final Drg.LifecycleState targetState) { + final com.oracle.bmc.core.model.Drg.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -135,7 +136,7 @@ public boolean apply(GetDrgResponse response) { return response.getDrg().getLifecycleState() == targetState; } }, - targetState == Drg.LifecycleState.Terminated), + targetState == com.oracle.bmc.core.model.Drg.LifecycleState.Terminated), request); } @@ -147,7 +148,8 @@ public boolean apply(GetDrgResponse response) { * @return A new Waiter instance. */ public Waiter forDrgAttachment( - GetDrgAttachmentRequest request, DrgAttachment.LifecycleState targetState) { + GetDrgAttachmentRequest request, + com.oracle.bmc.core.model.DrgAttachment.LifecycleState targetState) { return forDrgAttachment(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -162,7 +164,7 @@ public Waiter forDrgAttachmen */ public Waiter forDrgAttachment( GetDrgAttachmentRequest request, - DrgAttachment.LifecycleState targetState, + com.oracle.bmc.core.model.DrgAttachment.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forDrgAttachment( @@ -173,7 +175,7 @@ public Waiter forDrgAttachmen private Waiter forDrgAttachment( BmcGenericWaiter waiter, final GetDrgAttachmentRequest request, - final DrgAttachment.LifecycleState targetState) { + final com.oracle.bmc.core.model.DrgAttachment.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -191,7 +193,8 @@ public boolean apply(GetDrgAttachmentResponse response) { == targetState; } }, - targetState == DrgAttachment.LifecycleState.Detached), + targetState + == com.oracle.bmc.core.model.DrgAttachment.LifecycleState.Detached), request); } @@ -203,7 +206,8 @@ public boolean apply(GetDrgAttachmentResponse response) { * @return A new Waiter instance. */ public Waiter forIPSecConnection( - GetIPSecConnectionRequest request, IPSecConnection.LifecycleState targetState) { + GetIPSecConnectionRequest request, + com.oracle.bmc.core.model.IPSecConnection.LifecycleState targetState) { return forIPSecConnection(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -218,7 +222,7 @@ public Waiter forIPSecCon */ public Waiter forIPSecConnection( GetIPSecConnectionRequest request, - IPSecConnection.LifecycleState targetState, + com.oracle.bmc.core.model.IPSecConnection.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forIPSecConnection( @@ -229,7 +233,7 @@ public Waiter forIPSecCon private Waiter forIPSecConnection( BmcGenericWaiter waiter, final GetIPSecConnectionRequest request, - final IPSecConnection.LifecycleState targetState) { + final com.oracle.bmc.core.model.IPSecConnection.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -248,7 +252,9 @@ public boolean apply(GetIPSecConnectionResponse response) { == targetState; } }, - targetState == IPSecConnection.LifecycleState.Terminated), + targetState + == com.oracle.bmc.core.model.IPSecConnection.LifecycleState + .Terminated), request); } @@ -260,7 +266,8 @@ public boolean apply(GetIPSecConnectionResponse response) { * @return A new Waiter instance. */ public Waiter forInternetGateway( - GetInternetGatewayRequest request, InternetGateway.LifecycleState targetState) { + GetInternetGatewayRequest request, + com.oracle.bmc.core.model.InternetGateway.LifecycleState targetState) { return forInternetGateway(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -275,7 +282,7 @@ public Waiter forInternet */ public Waiter forInternetGateway( GetInternetGatewayRequest request, - InternetGateway.LifecycleState targetState, + com.oracle.bmc.core.model.InternetGateway.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forInternetGateway( @@ -286,7 +293,7 @@ public Waiter forInternet private Waiter forInternetGateway( BmcGenericWaiter waiter, final GetInternetGatewayRequest request, - final InternetGateway.LifecycleState targetState) { + final com.oracle.bmc.core.model.InternetGateway.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -305,7 +312,9 @@ public boolean apply(GetInternetGatewayResponse response) { == targetState; } }, - targetState == InternetGateway.LifecycleState.Terminated), + targetState + == com.oracle.bmc.core.model.InternetGateway.LifecycleState + .Terminated), request); } @@ -317,7 +326,8 @@ public boolean apply(GetInternetGatewayResponse response) { * @return A new Waiter instance. */ public Waiter forRouteTable( - GetRouteTableRequest request, RouteTable.LifecycleState targetState) { + GetRouteTableRequest request, + com.oracle.bmc.core.model.RouteTable.LifecycleState targetState) { return forRouteTable(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -332,7 +342,7 @@ public Waiter forRouteTable( */ public Waiter forRouteTable( GetRouteTableRequest request, - RouteTable.LifecycleState targetState, + com.oracle.bmc.core.model.RouteTable.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forRouteTable( @@ -343,7 +353,7 @@ public Waiter forRouteTable( private Waiter forRouteTable( BmcGenericWaiter waiter, final GetRouteTableRequest request, - final RouteTable.LifecycleState targetState) { + final com.oracle.bmc.core.model.RouteTable.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -360,7 +370,8 @@ public boolean apply(GetRouteTableResponse response) { return response.getRouteTable().getLifecycleState() == targetState; } }, - targetState == RouteTable.LifecycleState.Terminated), + targetState + == com.oracle.bmc.core.model.RouteTable.LifecycleState.Terminated), request); } @@ -372,7 +383,8 @@ public boolean apply(GetRouteTableResponse response) { * @return A new Waiter instance. */ public Waiter forSecurityList( - GetSecurityListRequest request, SecurityList.LifecycleState targetState) { + GetSecurityListRequest request, + com.oracle.bmc.core.model.SecurityList.LifecycleState targetState) { return forSecurityList(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -387,7 +399,7 @@ public Waiter forSecurityList( */ public Waiter forSecurityList( GetSecurityListRequest request, - SecurityList.LifecycleState targetState, + com.oracle.bmc.core.model.SecurityList.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forSecurityList( @@ -398,7 +410,7 @@ public Waiter forSecurityList( private Waiter forSecurityList( BmcGenericWaiter waiter, final GetSecurityListRequest request, - final SecurityList.LifecycleState targetState) { + final com.oracle.bmc.core.model.SecurityList.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -416,7 +428,9 @@ public boolean apply(GetSecurityListResponse response) { == targetState; } }, - targetState == SecurityList.LifecycleState.Terminated), + targetState + == com.oracle.bmc.core.model.SecurityList.LifecycleState + .Terminated), request); } @@ -428,7 +442,7 @@ public boolean apply(GetSecurityListResponse response) { * @return A new Waiter instance. */ public Waiter forSubnet( - GetSubnetRequest request, Subnet.LifecycleState targetState) { + GetSubnetRequest request, com.oracle.bmc.core.model.Subnet.LifecycleState targetState) { return forSubnet(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -443,7 +457,7 @@ public Waiter forSubnet( */ public Waiter forSubnet( GetSubnetRequest request, - Subnet.LifecycleState targetState, + com.oracle.bmc.core.model.Subnet.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forSubnet( @@ -454,7 +468,7 @@ public Waiter forSubnet( private Waiter forSubnet( BmcGenericWaiter waiter, final GetSubnetRequest request, - final Subnet.LifecycleState targetState) { + final com.oracle.bmc.core.model.Subnet.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -471,7 +485,7 @@ public boolean apply(GetSubnetResponse response) { return response.getSubnet().getLifecycleState() == targetState; } }, - targetState == Subnet.LifecycleState.Terminated), + targetState == com.oracle.bmc.core.model.Subnet.LifecycleState.Terminated), request); } @@ -483,7 +497,7 @@ public boolean apply(GetSubnetResponse response) { * @return A new Waiter instance. */ public Waiter forVcn( - GetVcnRequest request, Vcn.LifecycleState targetState) { + GetVcnRequest request, com.oracle.bmc.core.model.Vcn.LifecycleState targetState) { return forVcn(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -498,7 +512,7 @@ public Waiter forVcn( */ public Waiter forVcn( GetVcnRequest request, - Vcn.LifecycleState targetState, + com.oracle.bmc.core.model.Vcn.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forVcn(Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); @@ -508,7 +522,7 @@ public Waiter forVcn( private Waiter forVcn( BmcGenericWaiter waiter, final GetVcnRequest request, - final Vcn.LifecycleState targetState) { + final com.oracle.bmc.core.model.Vcn.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -525,7 +539,67 @@ public boolean apply(GetVcnResponse response) { return response.getVcn().getLifecycleState() == targetState; } }, - targetState == Vcn.LifecycleState.Terminated), + targetState == com.oracle.bmc.core.model.Vcn.LifecycleState.Terminated), + request); + } + + /** + * Creates a new {@link Waiter} using default configuration. + * + * @param request The request to send. + * @param targetState The desired state to wait for. + * @return A new Waiter instance. + */ + public Waiter forVirtualCircuit( + GetVirtualCircuitRequest request, + com.oracle.bmc.core.model.VirtualCircuit.LifecycleState targetState) { + return forVirtualCircuit(Waiters.DEFAULT_POLLING_WAITER, request, targetState); + } + + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request The request to send. + * @param targetState The desired state to wait for. + * @param terminationStrategy The {@link TerminationStrategy} to use. + * @param delayStrategy The {@link DelayStrategy} to use. + * @return A new Waiter instance. + */ + public Waiter forVirtualCircuit( + GetVirtualCircuitRequest request, + com.oracle.bmc.core.model.VirtualCircuit.LifecycleState targetState, + TerminationStrategy terminationStrategy, + DelayStrategy delayStrategy) { + return forVirtualCircuit( + Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); + } + + // Helper method to create a new Waiter for VirtualCircuit. + private Waiter forVirtualCircuit( + BmcGenericWaiter waiter, + final GetVirtualCircuitRequest request, + final com.oracle.bmc.core.model.VirtualCircuit.LifecycleState targetState) { + return new SimpleWaiterImpl<>( + executorService, + waiter.toCallable( + Suppliers.ofInstance(request), + new Function() { + @Override + public GetVirtualCircuitResponse apply( + GetVirtualCircuitRequest request) { + return client.getVirtualCircuit(request); + } + }, + new Predicate() { + @Override + public boolean apply(GetVirtualCircuitResponse response) { + return response.getVirtualCircuit().getLifecycleState() + == targetState; + } + }, + targetState + == com.oracle.bmc.core.model.VirtualCircuit.LifecycleState + .Terminated), request); } @@ -537,7 +611,7 @@ public boolean apply(GetVcnResponse response) { * @return A new Waiter instance. */ public Waiter forVnic( - GetVnicRequest request, Vnic.LifecycleState targetState) { + GetVnicRequest request, com.oracle.bmc.core.model.Vnic.LifecycleState targetState) { return forVnic(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -552,7 +626,7 @@ public Waiter forVnic( */ public Waiter forVnic( GetVnicRequest request, - Vnic.LifecycleState targetState, + com.oracle.bmc.core.model.Vnic.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forVnic(Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); @@ -562,7 +636,7 @@ public Waiter forVnic( private Waiter forVnic( BmcGenericWaiter waiter, final GetVnicRequest request, - final Vnic.LifecycleState targetState) { + final com.oracle.bmc.core.model.Vnic.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -579,7 +653,7 @@ public boolean apply(GetVnicResponse response) { return response.getVnic().getLifecycleState() == targetState; } }, - targetState == Vnic.LifecycleState.Terminated), + targetState == com.oracle.bmc.core.model.Vnic.LifecycleState.Terminated), request); } } diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/CreateVirtualCircuitConverter.java b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/CreateVirtualCircuitConverter.java new file mode 100644 index 00000000000..26dce82f907 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/CreateVirtualCircuitConverter.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; +import com.oracle.bmc.core.requests.*; +import com.oracle.bmc.core.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Slf4j +public class CreateVirtualCircuitConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static CreateVirtualCircuitRequest interceptRequest( + CreateVirtualCircuitRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, CreateVirtualCircuitRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getCreateVirtualCircuitDetails() == null) { + throw new NullPointerException("createVirtualCircuitDetails is required"); + } + + WebTarget target = client.getBaseTarget().path("/20160918").path("virtualCircuits"); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public CreateVirtualCircuitResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for CreateVirtualCircuitResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(VirtualCircuit.class); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + CreateVirtualCircuitResponse.Builder builder = + CreateVirtualCircuitResponse.builder(); + + builder.virtualCircuit(response.getItem()); + + Optional> etagHeader = HeaderUtils.get(headers, "etag"); + if (etagHeader.isPresent()) { + builder.etag( + HeaderUtils.toValue( + "etag", etagHeader.get().get(0), String.class)); + } + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + CreateVirtualCircuitResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/DeleteVirtualCircuitConverter.java b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/DeleteVirtualCircuitConverter.java new file mode 100644 index 00000000000..c901d5ad050 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/DeleteVirtualCircuitConverter.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; +import com.oracle.bmc.core.requests.*; +import com.oracle.bmc.core.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Slf4j +public class DeleteVirtualCircuitConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static DeleteVirtualCircuitRequest interceptRequest( + DeleteVirtualCircuitRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, DeleteVirtualCircuitRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getVirtualCircuitId() == null) { + throw new NullPointerException("virtualCircuitId is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20160918") + .path("virtualCircuits") + .path(encodePathSegment(request.getVirtualCircuitId())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getIfMatch() != null) { + ib.header("if-match", request.getIfMatch()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public DeleteVirtualCircuitResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for DeleteVirtualCircuitResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + DeleteVirtualCircuitResponse.Builder builder = + DeleteVirtualCircuitResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + DeleteVirtualCircuitResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/GetVirtualCircuitConverter.java b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/GetVirtualCircuitConverter.java new file mode 100644 index 00000000000..69bc0ab9851 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/GetVirtualCircuitConverter.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; +import com.oracle.bmc.core.requests.*; +import com.oracle.bmc.core.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Slf4j +public class GetVirtualCircuitConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static GetVirtualCircuitRequest interceptRequest(GetVirtualCircuitRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, GetVirtualCircuitRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getVirtualCircuitId() == null) { + throw new NullPointerException("virtualCircuitId is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20160918") + .path("virtualCircuits") + .path(encodePathSegment(request.getVirtualCircuitId())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public GetVirtualCircuitResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for GetVirtualCircuitResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(VirtualCircuit.class); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + GetVirtualCircuitResponse.Builder builder = + GetVirtualCircuitResponse.builder(); + + builder.virtualCircuit(response.getItem()); + + Optional> etagHeader = HeaderUtils.get(headers, "etag"); + if (etagHeader.isPresent()) { + builder.etag( + HeaderUtils.toValue( + "etag", etagHeader.get().get(0), String.class)); + } + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + GetVirtualCircuitResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/ListFastConnectProviderServicesConverter.java b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/ListFastConnectProviderServicesConverter.java new file mode 100644 index 00000000000..bc6c90f8b5b --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/ListFastConnectProviderServicesConverter.java @@ -0,0 +1,120 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; +import com.oracle.bmc.core.requests.*; +import com.oracle.bmc.core.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Slf4j +public class ListFastConnectProviderServicesConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static ListFastConnectProviderServicesRequest interceptRequest( + ListFastConnectProviderServicesRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, ListFastConnectProviderServicesRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getCompartmentId() == null) { + throw new NullPointerException("compartmentId is required"); + } + + WebTarget target = + client.getBaseTarget().path("/20160918").path("fastConnectProviderServices"); + + target = + target.queryParam( + "compartmentId", attemptEncodeQueryParam(request.getCompartmentId())); + + if (request.getLimit() != null) { + target = target.queryParam("limit", attemptEncodeQueryParam(request.getLimit())); + } + + if (request.getPage() != null) { + target = target.queryParam("page", attemptEncodeQueryParam(request.getPage())); + } + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public ListFastConnectProviderServicesResponse apply(Response rawResponse) { + LOG.trace( + "Transform function invoked for ListFastConnectProviderServicesResponse"); + Function>> + responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new GenericType< + List>() {}); + + WithHeaders> response = + responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + ListFastConnectProviderServicesResponse.Builder builder = + ListFastConnectProviderServicesResponse.builder(); + + builder.items(response.getItem()); + + Optional> opcNextPageHeader = + HeaderUtils.get(headers, "opc-next-page"); + if (opcNextPageHeader.isPresent()) { + builder.opcNextPage( + HeaderUtils.toValue( + "opc-next-page", + opcNextPageHeader.get().get(0), + String.class)); + } + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListFastConnectProviderServicesResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/ListVirtualCircuitBandwidthShapesConverter.java b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/ListVirtualCircuitBandwidthShapesConverter.java new file mode 100644 index 00000000000..5eabce37707 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/ListVirtualCircuitBandwidthShapesConverter.java @@ -0,0 +1,120 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; +import com.oracle.bmc.core.requests.*; +import com.oracle.bmc.core.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Slf4j +public class ListVirtualCircuitBandwidthShapesConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static ListVirtualCircuitBandwidthShapesRequest interceptRequest( + ListVirtualCircuitBandwidthShapesRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, ListVirtualCircuitBandwidthShapesRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getCompartmentId() == null) { + throw new NullPointerException("compartmentId is required"); + } + + WebTarget target = + client.getBaseTarget().path("/20160918").path("virtualCircuitBandwidthShapes"); + + target = + target.queryParam( + "compartmentId", attemptEncodeQueryParam(request.getCompartmentId())); + + if (request.getLimit() != null) { + target = target.queryParam("limit", attemptEncodeQueryParam(request.getLimit())); + } + + if (request.getPage() != null) { + target = target.queryParam("page", attemptEncodeQueryParam(request.getPage())); + } + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public ListVirtualCircuitBandwidthShapesResponse apply(Response rawResponse) { + LOG.trace( + "Transform function invoked for ListVirtualCircuitBandwidthShapesResponse"); + Function>> + responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new GenericType< + List>() {}); + + WithHeaders> response = + responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + ListVirtualCircuitBandwidthShapesResponse.Builder builder = + ListVirtualCircuitBandwidthShapesResponse.builder(); + + builder.items(response.getItem()); + + Optional> opcNextPageHeader = + HeaderUtils.get(headers, "opc-next-page"); + if (opcNextPageHeader.isPresent()) { + builder.opcNextPage( + HeaderUtils.toValue( + "opc-next-page", + opcNextPageHeader.get().get(0), + String.class)); + } + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListVirtualCircuitBandwidthShapesResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/ListVirtualCircuitsConverter.java b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/ListVirtualCircuitsConverter.java new file mode 100644 index 00000000000..8306e8adf77 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/ListVirtualCircuitsConverter.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; +import com.oracle.bmc.core.requests.*; +import com.oracle.bmc.core.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Slf4j +public class ListVirtualCircuitsConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static ListVirtualCircuitsRequest interceptRequest(ListVirtualCircuitsRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, ListVirtualCircuitsRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getCompartmentId() == null) { + throw new NullPointerException("compartmentId is required"); + } + + WebTarget target = client.getBaseTarget().path("/20160918").path("virtualCircuits"); + + target = + target.queryParam( + "compartmentId", attemptEncodeQueryParam(request.getCompartmentId())); + + if (request.getLimit() != null) { + target = target.queryParam("limit", attemptEncodeQueryParam(request.getLimit())); + } + + if (request.getPage() != null) { + target = target.queryParam("page", attemptEncodeQueryParam(request.getPage())); + } + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public ListVirtualCircuitsResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for ListVirtualCircuitsResponse"); + Function>> responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new GenericType>() {}); + + WithHeaders> response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + ListVirtualCircuitsResponse.Builder builder = + ListVirtualCircuitsResponse.builder(); + + builder.items(response.getItem()); + + Optional> opcNextPageHeader = + HeaderUtils.get(headers, "opc-next-page"); + if (opcNextPageHeader.isPresent()) { + builder.opcNextPage( + HeaderUtils.toValue( + "opc-next-page", + opcNextPageHeader.get().get(0), + String.class)); + } + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListVirtualCircuitsResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/UpdateVirtualCircuitConverter.java b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/UpdateVirtualCircuitConverter.java new file mode 100644 index 00000000000..6922c4b3375 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/internal/http/UpdateVirtualCircuitConverter.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; +import com.oracle.bmc.core.requests.*; +import com.oracle.bmc.core.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Slf4j +public class UpdateVirtualCircuitConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static UpdateVirtualCircuitRequest interceptRequest( + UpdateVirtualCircuitRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, UpdateVirtualCircuitRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getVirtualCircuitId() == null) { + throw new NullPointerException("virtualCircuitId is required"); + } + + if (request.getUpdateVirtualCircuitDetails() == null) { + throw new NullPointerException("updateVirtualCircuitDetails is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20160918") + .path("virtualCircuits") + .path(encodePathSegment(request.getVirtualCircuitId())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getIfMatch() != null) { + ib.header("if-match", request.getIfMatch()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public UpdateVirtualCircuitResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for UpdateVirtualCircuitResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(VirtualCircuit.class); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + UpdateVirtualCircuitResponse.Builder builder = + UpdateVirtualCircuitResponse.builder(); + + builder.virtualCircuit(response.getItem()); + + Optional> etagHeader = HeaderUtils.get(headers, "etag"); + if (etagHeader.isPresent()) { + builder.etag( + HeaderUtils.toValue( + "etag", etagHeader.get().get(0), String.class)); + } + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + UpdateVirtualCircuitResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/ConsoleHistory.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/ConsoleHistory.java index 3a54b1d514d..07eb3d77c18 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/ConsoleHistory.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/ConsoleHistory.java @@ -130,12 +130,18 @@ public static Builder builder() { /** * The current state of the console history. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Requested("REQUESTED"), GettingHistory("GETTING-HISTORY"), Succeeded("SUCCEEDED"), Failed("FAILED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -143,7 +149,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -161,7 +169,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/Cpe.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/Cpe.java index 7f92bd24ad5..28e8865528f 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/Cpe.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/Cpe.java @@ -15,10 +15,11 @@ import lombok.experimental.*; /** - * A virtual representation of your Customer-Premise Equipment, which is the actual router - * on-premise at your site at your end of the VPN connection to your VCN. You need to - * create this object as part of the process of setting up the VPN. For more information, - * see [Typical Networking Service Scenarios](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm#three). + * An object you create when setting up an IPSec VPN between your on-premise network + * and VCN. The `Cpe` is a virtual representation of your Customer-Premises Equipment, + * which is the actual router on-premise at your site at your end of the IPSec VPN connection. + * For more information, + * see [Overview of the Networking Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm). *

* To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, * talk to an administrator. If you're an administrator who needs to write policies to give users access, see diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/CreateVirtualCircuitDetails.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/CreateVirtualCircuitDetails.java new file mode 100644 index 00000000000..2cb56a02a15 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/CreateVirtualCircuitDetails.java @@ -0,0 +1,228 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Value +@JsonDeserialize(builder = CreateVirtualCircuitDetails.Builder.class) +public class CreateVirtualCircuitDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("bandwidthShapeName") + private String bandwidthShapeName; + + @JsonProperty("compartmentId") + private String compartmentId; + + @JsonProperty("crossConnectMappings") + private List crossConnectMappings; + + @JsonProperty("customerBgpAsn") + private Integer customerBgpAsn; + + @JsonProperty("displayName") + private String displayName; + + @JsonProperty("gatewayId") + private String gatewayId; + + @JsonProperty("providerName") + private String providerName; + + @JsonProperty("providerServiceName") + private String providerServiceName; + + @JsonProperty("region") + private String region; + + @JsonProperty("type") + private Type type; + + public CreateVirtualCircuitDetails build() { + return new CreateVirtualCircuitDetails( + bandwidthShapeName, + compartmentId, + crossConnectMappings, + customerBgpAsn, + displayName, + gatewayId, + providerName, + providerServiceName, + region, + type); + } + + @JsonIgnore + public Builder copy(CreateVirtualCircuitDetails o) { + return bandwidthShapeName(o.getBandwidthShapeName()) + .compartmentId(o.getCompartmentId()) + .crossConnectMappings(o.getCrossConnectMappings()) + .customerBgpAsn(o.getCustomerBgpAsn()) + .displayName(o.getDisplayName()) + .gatewayId(o.getGatewayId()) + .providerName(o.getProviderName()) + .providerServiceName(o.getProviderServiceName()) + .region(o.getRegion()) + .type(o.getType()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The provisioned data rate of the connection. To get a list of the + * available bandwidth levels (i.e., shapes), see + * {@link #listVirtualCircuitBandwidthShapes(ListVirtualCircuitBandwidthShapesRequest) listVirtualCircuitBandwidthShapes}. + *

+ * Example: `10 Gbps` + * + **/ + @JsonProperty("bandwidthShapeName") + String bandwidthShapeName; + + /** + * The OCID of the compartment to contain the virtual circuit. + * + **/ + @JsonProperty("compartmentId") + @Valid + @NotNull + @Size(min = 1, max = 255) + String compartmentId; + + /** + * Leave this empty or null when creating the virtual circuit. + * The provider will later update the virtual circuit during + * provisioning and add one or more mappings, each containing + * properties for a cross-connect or cross-connect group + * associated with this virtual circuit. + * + **/ + @JsonProperty("crossConnectMappings") + List crossConnectMappings; + + /** + * If the BGP session goes from your CPE to Oracle, then + * provide your BGP ASN (either public or private). Otherwise, + * leave this empty or null. + * + **/ + @JsonProperty("customerBgpAsn") + Integer customerBgpAsn; + + /** + * A user-friendly name. Does not have to be unique, and it's changeable. + * + **/ + @JsonProperty("displayName") + @Size(min = 1, max = 255) + String displayName; + + /** + * The OCID of the {@link Drg} + * that this virtual circuit uses. + * + **/ + @JsonProperty("gatewayId") + @Size(min = 1, max = 255) + String gatewayId; + + /** + * The name of the provider. To get a list of the provider names, see + * {@link #listFastConnectProviderServices(ListFastConnectProviderServicesRequest) listFastConnectProviderServices}. + * + **/ + @JsonProperty("providerName") + @Size(min = 1, max = 255) + String providerName; + + /** + * The name of the service offered by the provider. To get a list of the + * available service offerings, see + * {@link #listFastConnectProviderServices(ListFastConnectProviderServicesRequest) listFastConnectProviderServices}. + * + **/ + @JsonProperty("providerServiceName") + @Size(min = 1, max = 255) + String providerServiceName; + + /** + * The Oracle Bare Metal Cloud Services region where this virtual + * circuit is located. + *

+ * Example: `phx` + * + **/ + @JsonProperty("region") + @Valid + @NotNull + @Size(min = 1, max = 255) + String region; + /** + * The type of IP addresses used in this virtual circuit. PRIVATE + * means [RFC 1918](https://tools.ietf.org/html/rfc1918) addresses + * (10.0.0.0/8, 172.16/12, and 192.168/16). Only PRIVATE is supported. + * + **/ + public enum Type { + Public("PUBLIC"), + Private("PRIVATE"), + ; + + private final String value; + private static Map map; + + static { + map = new HashMap<>(); + for (Type v : Type.values()) { + map.put(v.getValue(), v); + } + } + + Type(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @JsonCreator + public static Type create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + throw new RuntimeException("Invalid Type: " + key); + } + }; + /** + * The type of IP addresses used in this virtual circuit. PRIVATE + * means [RFC 1918](https://tools.ietf.org/html/rfc1918) addresses + * (10.0.0.0/8, 172.16/12, and 192.168/16). Only PRIVATE is supported. + * + **/ + @JsonProperty("type") + @Valid + @NotNull + Type type; +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/CrossConnectMapping.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/CrossConnectMapping.java new file mode 100644 index 00000000000..3f224fe94fc --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/CrossConnectMapping.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * Each virtual circuit runs on one or more cross-connects or + * cross-connect groups owned by the provider. A `CrossConnectMapping` + * contains the properties for an individual cross-connect or + * cross-connect group associated with a given virtual circuit. + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Value +@JsonDeserialize(builder = CrossConnectMapping.Builder.class) +public class CrossConnectMapping { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("bgpMd5AuthKey") + private String bgpMd5AuthKey; + + @JsonProperty("crossConnectOrCrossConnectGroupId") + private String crossConnectOrCrossConnectGroupId; + + @JsonProperty("customerBgpPeeringIp") + private String customerBgpPeeringIp; + + @JsonProperty("oracleBgpPeeringIp") + private String oracleBgpPeeringIp; + + @JsonProperty("vlan") + private Integer vlan; + + public CrossConnectMapping build() { + return new CrossConnectMapping( + bgpMd5AuthKey, + crossConnectOrCrossConnectGroupId, + customerBgpPeeringIp, + oracleBgpPeeringIp, + vlan); + } + + @JsonIgnore + public Builder copy(CrossConnectMapping o) { + return bgpMd5AuthKey(o.getBgpMd5AuthKey()) + .crossConnectOrCrossConnectGroupId(o.getCrossConnectOrCrossConnectGroupId()) + .customerBgpPeeringIp(o.getCustomerBgpPeeringIp()) + .oracleBgpPeeringIp(o.getOracleBgpPeeringIp()) + .vlan(o.getVlan()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The key for BGP MD5 authentication. Only applicable if your system + * requires MD5 authentication. If empty or not set (null), that + * means you don't use BGP MD5 authentication. + * + **/ + @JsonProperty("bgpMd5AuthKey") + @Size(min = 1, max = 255) + String bgpMd5AuthKey; + + /** + * The OCID of the cross-connect or cross-connect group for this mapping. + * + **/ + @JsonProperty("crossConnectOrCrossConnectGroupId") + @Size(min = 1, max = 255) + String crossConnectOrCrossConnectGroupId; + + /** + * The BGP IP address for the router on the other end of the BGP session from + * Oracle. If the session goes from the customer's CPE to Oracle, this is + * the BGP IP address for the customer's CPE. If the session goes from the + * provider's edge router to Oracle, this is the BGP IP address for the + * provider's router. Must use a /31 or /32 subnet mask. + *

+ * Example: `10.0.0.18/31` + * + **/ + @JsonProperty("customerBgpPeeringIp") + @Size(min = 7, max = 46) + String customerBgpPeeringIp; + + /** + * The IP address for Oracle's end of the BPG session. Must use a /31 or /32 + * subnet mask. + *

+ * Example: `10.0.0.19/31` + * + **/ + @JsonProperty("oracleBgpPeeringIp") + @Size(min = 7, max = 46) + String oracleBgpPeeringIp; + + /** + * The number of the specific VLAN (on the cross-connect or cross-connect + * group) that is assigned to this virtual circuit. + *

+ * Example: `200` + * + **/ + @JsonProperty("vlan") + @Min(100) + @Max(16777216) + Integer vlan; +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/DhcpDnsOption.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/DhcpDnsOption.java index c607ea7e270..cc519cb6d09 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/DhcpDnsOption.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/DhcpDnsOption.java @@ -84,11 +84,17 @@ public DhcpDnsOption(List customDnsServers, ServerType serverType) { * - **CustomDnsServer:** Instances use a DNS server of your choice (three maximum). * **/ + @lombok.extern.slf4j.Slf4j public enum ServerType { VcnLocal("VcnLocal"), VcnLocalPlusInternet("VcnLocalPlusInternet"), CustomDnsServer("CustomDnsServer"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -96,7 +102,9 @@ public enum ServerType { static { map = new HashMap<>(); for (ServerType v : ServerType.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -114,7 +122,10 @@ public static ServerType create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid ServerType: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'ServerType', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/DhcpOptions.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/DhcpOptions.java index 9ece114932b..8445bb6337c 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/DhcpOptions.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/DhcpOptions.java @@ -17,13 +17,13 @@ /** * A set of DHCP options. Used by the VCN to automatically provide configuration * information to the instances when they boot up. There are two options you can set: - * + *

* - {@link DhcpDnsOption}: Lets you specify how DNS (hostname resolution) is * handled in the subnets in your VCN. *

* - {@link DhcpSearchDomainOption}: Lets you specify * a search domain name to use for DNS queries. - * + *

* For more information, see [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm) * and [Managing DHCP Options](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingDHCP.htm). *

@@ -112,12 +112,18 @@ public static Builder builder() { /** * The current state of the set of DHCP options. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Provisioning("PROVISIONING"), Available("AVAILABLE"), Terminating("TERMINATING"), Terminated("TERMINATED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -125,7 +131,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -143,7 +151,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/DhcpSearchDomainOption.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/DhcpSearchDomainOption.java index 6f9a03adc63..2edd885031d 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/DhcpSearchDomainOption.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/DhcpSearchDomainOption.java @@ -58,8 +58,7 @@ public DhcpSearchDomainOption(List searchDomainNames) { /** * A single search domain name according to [RFC 952](https://tools.ietf.org/html/rfc952) * and [RFC 1123](https://tools.ietf.org/html/rfc1123). During a DNS query, - * the OS will append this search domain name to the value being queried, but only if - * that value is not a fully qualified domain name (FQDN). + * the OS will append this search domain name to the value being queried. *

* If you set {@link DhcpDnsOption} to `VcnLocalPlusInternet`, * and you assign a DNS label to the VCN during creation, the search domain name in the diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/Drg.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/Drg.java index 1b718c9c298..5044cd6321a 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/Drg.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/Drg.java @@ -16,9 +16,10 @@ /** * A Dynamic Routing Gateway (DRG), which is a virtual router that provides a path for private - * network traffic between your VCN and your on-premise network. You use it with other Networking - * Service components and an on-premise router to create a site-to-site VPN. For more information, see - * [Typical Networking Service Scenarios](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm#three). + * network traffic between your VCN and your existing network. You use it with other Networking + * Service components to create an IPSec VPN or a connection that uses + * Oracle Bare Metal Cloud Services FastConnect. For more information, see + * [Overview of the Networking Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm). *

* To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, * talk to an administrator. If you're an administrator who needs to write policies to give users access, see @@ -96,12 +97,18 @@ public static Builder builder() { /** * The DRG's current state. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Provisioning("PROVISIONING"), Available("AVAILABLE"), Terminating("TERMINATING"), Terminated("TERMINATED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -109,7 +116,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -127,7 +136,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/DrgAttachment.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/DrgAttachment.java index bc06c943bd5..bbe666876a8 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/DrgAttachment.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/DrgAttachment.java @@ -108,12 +108,18 @@ public static Builder builder() { /** * The DRG attachment's current state. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Attaching("ATTACHING"), Attached("ATTACHED"), Detaching("DETACHING"), Detached("DETACHED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -121,7 +127,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -139,7 +147,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/FastConnectProviderService.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/FastConnectProviderService.java new file mode 100644 index 00000000000..2b7e2aa1341 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/FastConnectProviderService.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * A service offering from a supported provider. For more information, + * see [FastConnect](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Value +@JsonDeserialize(builder = FastConnectProviderService.Builder.class) +public class FastConnectProviderService { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("description") + private String description; + + @JsonProperty("providerName") + private String providerName; + + @JsonProperty("providerServiceName") + private String providerServiceName; + + public FastConnectProviderService build() { + return new FastConnectProviderService(description, providerName, providerServiceName); + } + + @JsonIgnore + public Builder copy(FastConnectProviderService o) { + return description(o.getDescription()) + .providerName(o.getProviderName()) + .providerServiceName(o.getProviderServiceName()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * A description of the service offered by the provider. + * + **/ + @JsonProperty("description") + @Size(min = 1, max = 255) + String description; + + /** + * The name of the provider. + * + **/ + @JsonProperty("providerName") + @Valid + @NotNull + @Size(min = 1, max = 255) + String providerName; + + /** + * The name of the service offered by the provider. + * + **/ + @JsonProperty("providerServiceName") + @Valid + @NotNull + @Size(min = 1, max = 255) + String providerServiceName; +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/IPSecConnection.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/IPSecConnection.java index 825ed954562..2a2f783fe49 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/IPSecConnection.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/IPSecConnection.java @@ -17,8 +17,8 @@ /** * A connection between a DRG and CPE. This connection consists of multiple IPSec * tunnels. Creating this connection is one of the steps required when setting up - * a VPN. For more information, see - * [Typical Networking Service Scenarios](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm#three). + * an IPSec VPN. For more information, see + * [Overview of the Networking Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/overview.htm). *

* To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, * talk to an administrator. If you're an administrator who needs to write policies to give users access, see @@ -134,12 +134,18 @@ public static Builder builder() { /** * The IPSec connection's current state. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Provisioning("PROVISIONING"), Available("AVAILABLE"), Terminating("TERMINATING"), Terminated("TERMINATED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -147,7 +153,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -165,7 +173,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/Image.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/Image.java index 688a625c753..ccc1eeb0870 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/Image.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/Image.java @@ -142,12 +142,18 @@ public static Builder builder() { String id; /** **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Provisioning("PROVISIONING"), Available("AVAILABLE"), Disabled("DISABLED"), Deleted("DELETED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -155,7 +161,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -173,7 +181,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/Instance.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/Instance.java index 43b075199c9..06a5896633c 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/Instance.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/Instance.java @@ -164,18 +164,17 @@ public static Builder builder() { * every time an instance boots; not only after the initial * LaunchInstance call. *

- * The default iPXE script connects to the instance\u2019s local boot + * The default iPXE script connects to the instance's local boot * volume over iSCSI and performs a network boot. If you use a custom iPXE - * script and want to network-boot from the instance\u2019s local boot volume + * script and want to network-boot from the instance's local boot volume * over iSCSI the same way as the default iPXE script, you should use the * following iSCSI IP address: 169.254.0.2, and boot volume IQN: * iqn.2015-02.oracle.boot. *

* For more information about the Bring Your Own Image feature of - * Oracle Bare Metal Cloud Services, see [Bring Your Own Custom - * Image: RHEL 7.x & Derivatives (CentOS, Oracle Linux)] - * (/Content/General/Reference/aqswhitepapers.htm). - * + * Oracle Bare Metal Cloud Services, see + * [Bring Your Own Image](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/References/bringyourownimage.htm). + *

* For more information about iPXE, see http://ipxe.org. * **/ @@ -185,6 +184,7 @@ public static Builder builder() { /** * The current state of the instance. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Provisioning("PROVISIONING"), Running("RUNNING"), @@ -194,7 +194,12 @@ public enum LifecycleState { CreatingImage("CREATING_IMAGE"), Terminating("TERMINATING"), Terminated("TERMINATED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -202,7 +207,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -220,7 +227,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/InternetGateway.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/InternetGateway.java index fa44d4bf666..eaf61191e93 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/InternetGateway.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/InternetGateway.java @@ -112,12 +112,18 @@ public static Builder builder() { /** * The Internet Gateway's current state. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Provisioning("PROVISIONING"), Available("AVAILABLE"), Terminating("TERMINATING"), Terminated("TERMINATED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -125,7 +131,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -143,7 +151,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/LaunchInstanceDetails.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/LaunchInstanceDetails.java index 83d11809425..19f298809a7 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/LaunchInstanceDetails.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/LaunchInstanceDetails.java @@ -157,9 +157,9 @@ public static Builder builder() { * every time an instance boots; not only after the initial * LaunchInstance call. *

- * The default iPXE script connects to the instance\u2019s local boot + * The default iPXE script connects to the instance's local boot * volume over iSCSI and performs a network boot. If you use a custom iPXE - * script and want to network-boot from the instance\u2019s local boot volume + * script and want to network-boot from the instance's local boot volume * over iSCSI the same way as the default iPXE script, you should use the * following iSCSI IP address: 169.254.0.2, and boot volume IQN: * iqn.2015-02.oracle.boot. diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/RouteTable.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/RouteTable.java index 0954d01247c..a272ff1a1d5 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/RouteTable.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/RouteTable.java @@ -104,12 +104,18 @@ public static Builder builder() { /** * The route table's current state. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Provisioning("PROVISIONING"), Available("AVAILABLE"), Terminating("TERMINATING"), Terminated("TERMINATED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -117,7 +123,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -135,7 +143,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/SecurityList.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/SecurityList.java index 9d8b3059873..b196815b0c0 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/SecurityList.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/SecurityList.java @@ -139,12 +139,18 @@ public static Builder builder() { /** * The security list's current state. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Provisioning("PROVISIONING"), Available("AVAILABLE"), Terminating("TERMINATING"), Terminated("TERMINATED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -152,7 +158,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -170,7 +178,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/Subnet.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/Subnet.java index 25c454e3940..908d6dcc038 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/Subnet.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/Subnet.java @@ -204,12 +204,18 @@ public static Builder builder() { /** * The subnet's current state. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Provisioning("PROVISIONING"), Available("AVAILABLE"), Terminating("TERMINATING"), Terminated("TERMINATED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -217,7 +223,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -235,7 +243,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/TunnelStatus.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/TunnelStatus.java index 3883d49f562..bc0f9daa285 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/TunnelStatus.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/TunnelStatus.java @@ -72,11 +72,17 @@ public static Builder builder() { /** * The tunnel's current state. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Up("UP"), Down("DOWN"), DownForMaintenance("DOWN_FOR_MAINTENANCE"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -84,7 +90,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -102,7 +110,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/UpdateVirtualCircuitDetails.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/UpdateVirtualCircuitDetails.java new file mode 100644 index 00000000000..4b1f4e1544d --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/UpdateVirtualCircuitDetails.java @@ -0,0 +1,194 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Value +@JsonDeserialize(builder = UpdateVirtualCircuitDetails.Builder.class) +public class UpdateVirtualCircuitDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("bandwidthShapeName") + private String bandwidthShapeName; + + @JsonProperty("crossConnectMappings") + private List crossConnectMappings; + + @JsonProperty("customerBgpAsn") + private Integer customerBgpAsn; + + @JsonProperty("displayName") + private String displayName; + + @JsonProperty("gatewayId") + private String gatewayId; + + @JsonProperty("providerState") + private ProviderState providerState; + + @JsonProperty("referenceComment") + private String referenceComment; + + public UpdateVirtualCircuitDetails build() { + return new UpdateVirtualCircuitDetails( + bandwidthShapeName, + crossConnectMappings, + customerBgpAsn, + displayName, + gatewayId, + providerState, + referenceComment); + } + + @JsonIgnore + public Builder copy(UpdateVirtualCircuitDetails o) { + return bandwidthShapeName(o.getBandwidthShapeName()) + .crossConnectMappings(o.getCrossConnectMappings()) + .customerBgpAsn(o.getCustomerBgpAsn()) + .displayName(o.getDisplayName()) + .gatewayId(o.getGatewayId()) + .providerState(o.getProviderState()) + .referenceComment(o.getReferenceComment()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The provisioned data rate of the connection. To get a list of the + * available bandwidth levels (i.e., shapes), see + * {@link #listVirtualCircuitBandwidthShapes(ListVirtualCircuitBandwidthShapesRequest) listVirtualCircuitBandwidthShapes}. + *

+ * To be updated only by the customer who owns the virtual circuit. + * + **/ + @JsonProperty("bandwidthShapeName") + String bandwidthShapeName; + + /** + * An array of mappings, each containing properties for a cross-connect or + * cross-connect group associated with this virtual circuit. + *

+ * To be updated only by the provider. + * + **/ + @JsonProperty("crossConnectMappings") + List crossConnectMappings; + + /** + * The BGP ASN of the network at the other end of the BGP + * session from Oracle. + *

+ * If the BGP session is from the customer's CPE to Oracle, the + * required value is the customer's ASN, and it can be updated only + * by the customer. + *

+ * If the BGP session is from the provider's edge router to Oracle, the + * required value is the provider's ASN, and it can be updated only + * by the provider. + * + **/ + @JsonProperty("customerBgpAsn") + Integer customerBgpAsn; + + /** + * A user-friendly name. Does not have to be unique. + *

+ * To be updated only by the customer who owns the virtual circuit. + * + **/ + @JsonProperty("displayName") + @Size(min = 1, max = 255) + String displayName; + + /** + * The OCID of the customer's {@link Drg} + * that this virtual circuit uses. + *

+ * To be updated only by the customer who owns the virtual circuit. + * + **/ + @JsonProperty("gatewayId") + @Size(min = 1, max = 255) + String gatewayId; + /** + * The provider's state in relation to this virtual circuit. ACTIVE + * means the provider has provisioned the virtual circuit from their + * end. INACTIVE means the provider has not yet provisioned the virtual + * circuit, or has de-provisioned it. + *

+ * To be updated only by the provider. + * + **/ + public enum ProviderState { + Active("ACTIVE"), + Inactive("INACTIVE"), + ; + + private final String value; + private static Map map; + + static { + map = new HashMap<>(); + for (ProviderState v : ProviderState.values()) { + map.put(v.getValue(), v); + } + } + + ProviderState(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @JsonCreator + public static ProviderState create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + throw new RuntimeException("Invalid ProviderState: " + key); + } + }; + /** + * The provider's state in relation to this virtual circuit. ACTIVE + * means the provider has provisioned the virtual circuit from their + * end. INACTIVE means the provider has not yet provisioned the virtual + * circuit, or has de-provisioned it. + *

+ * To be updated only by the provider. + * + **/ + @JsonProperty("providerState") + ProviderState providerState; + + /** + * Provider-supplied reference information about this virtual circuit. + *

+ * To be updated only by the provider. + * + **/ + @JsonProperty("referenceComment") + String referenceComment; +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/Vcn.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/Vcn.java index c0d89500571..c0ce7c77f19 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/Vcn.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/Vcn.java @@ -183,12 +183,18 @@ public static Builder builder() { /** * The VCN's current state. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Provisioning("PROVISIONING"), Available("AVAILABLE"), Terminating("TERMINATING"), Terminated("TERMINATED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -196,7 +202,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -214,7 +222,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/VirtualCircuit.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/VirtualCircuit.java new file mode 100644 index 00000000000..0dc08c4c876 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/VirtualCircuit.java @@ -0,0 +1,479 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * An isolated network path that runs over one or more physical network connections + * to provide a single, logical connection between the Customer-Premises Equipment + * (CPE) on the edge of the customer's existing network and a DRG. + * A customer could have multiple virtual circuits, for example, to isolate traffic from + * different parts of their organization (one virtual circuit for 10.0.1.0/24; + * another for 172.16.0.0/16), or to provide redundancy. + *

+ * Each virtual circuit is made up of information shared between a customer, Oracle, + * and a provider. Who fills in a given property of a virtual circuit depends on whether + * the BGP session related to that virtual circuit goes from the customer's CPE to Oracle, + * or from the provider's router to Oracle. Also, values for some of the properties may not + * be present immediately, but may get filled in as the provider and Oracle each do their + * part to provision the virtual circuit. + *

+ * For more information, see [FastConnect](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + *

+ * To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, + * talk to an administrator. If you're an administrator who needs to write policies to give users access, see + * [Getting Started with Policies](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Value +@JsonDeserialize(builder = VirtualCircuit.Builder.class) +public class VirtualCircuit { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("bandwidthShapeName") + private String bandwidthShapeName; + + @JsonProperty("bgpSessionState") + private BgpSessionState bgpSessionState; + + @JsonProperty("compartmentId") + private String compartmentId; + + @JsonProperty("crossConnectMappings") + private List crossConnectMappings; + + @JsonProperty("customerBgpAsn") + private Integer customerBgpAsn; + + @JsonProperty("displayName") + private String displayName; + + @JsonProperty("gatewayId") + private String gatewayId; + + @JsonProperty("id") + private String id; + + @JsonProperty("lifecycleState") + private LifecycleState lifecycleState; + + @JsonProperty("oracleBgpAsn") + private Integer oracleBgpAsn; + + @JsonProperty("providerName") + private String providerName; + + @JsonProperty("providerServiceName") + private String providerServiceName; + + @JsonProperty("providerState") + private ProviderState providerState; + + @JsonProperty("referenceComment") + private String referenceComment; + + @JsonProperty("region") + private String region; + + @JsonProperty("timeCreated") + private Date timeCreated; + + @JsonProperty("type") + private Type type; + + public VirtualCircuit build() { + return new VirtualCircuit( + bandwidthShapeName, + bgpSessionState, + compartmentId, + crossConnectMappings, + customerBgpAsn, + displayName, + gatewayId, + id, + lifecycleState, + oracleBgpAsn, + providerName, + providerServiceName, + providerState, + referenceComment, + region, + timeCreated, + type); + } + + @JsonIgnore + public Builder copy(VirtualCircuit o) { + return bandwidthShapeName(o.getBandwidthShapeName()) + .bgpSessionState(o.getBgpSessionState()) + .compartmentId(o.getCompartmentId()) + .crossConnectMappings(o.getCrossConnectMappings()) + .customerBgpAsn(o.getCustomerBgpAsn()) + .displayName(o.getDisplayName()) + .gatewayId(o.getGatewayId()) + .id(o.getId()) + .lifecycleState(o.getLifecycleState()) + .oracleBgpAsn(o.getOracleBgpAsn()) + .providerName(o.getProviderName()) + .providerServiceName(o.getProviderServiceName()) + .providerState(o.getProviderState()) + .referenceComment(o.getReferenceComment()) + .region(o.getRegion()) + .timeCreated(o.getTimeCreated()) + .type(o.getType()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The provisioned data rate of the connection. + **/ + @JsonProperty("bandwidthShapeName") + String bandwidthShapeName; + /** + * The state of the BGP session associated with the virtual circuit. + **/ + @lombok.extern.slf4j.Slf4j + public enum BgpSessionState { + Up("UP"), + Down("DOWN"), + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); + + private final String value; + private static Map map; + + static { + map = new HashMap<>(); + for (BgpSessionState v : BgpSessionState.values()) { + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } + } + } + + BgpSessionState(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @JsonCreator + public static BgpSessionState create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + LOG.warn( + "Received unknown value '{}' for enum 'BgpSessionState', returning UnknownEnumValue", + key); + return UnknownEnumValue; + } + }; + /** + * The state of the BGP session associated with the virtual circuit. + **/ + @JsonProperty("bgpSessionState") + BgpSessionState bgpSessionState; + + /** + * The OCID of the compartment containing the virtual circuit. + **/ + @JsonProperty("compartmentId") + @Size(min = 1, max = 255) + String compartmentId; + + /** + * An array of mappings, each containing properties for a provider's + * cross-connect or cross-connect group that is associated with this + * virtual circuit. + * + **/ + @JsonProperty("crossConnectMappings") + List crossConnectMappings; + + /** + * The BGP ASN of the network at the other end of the BGP + * session from Oracle. If the session is between the customer's + * CPE and Oracle, the value is the customer's ASN. If the BGP + * session is between the provider's edge router and Oracle, the value + * is the provider's ASN. + * + **/ + @JsonProperty("customerBgpAsn") + Integer customerBgpAsn; + + /** + * A user-friendly name. Does not have to be unique, and it's changeable. + * + **/ + @JsonProperty("displayName") + @Size(min = 1, max = 255) + String displayName; + + /** + * The OCID of the customer's {@link Drg} + * that this virtual circuit uses. + * + **/ + @JsonProperty("gatewayId") + @Size(min = 1, max = 255) + String gatewayId; + + /** + * The virtual circuit's Oracle ID (OCID). + **/ + @JsonProperty("id") + @Size(min = 1, max = 255) + String id; + /** + * The virtual circuit's current state. For information about + * the different states, see + * [FastConnect](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + * + **/ + @lombok.extern.slf4j.Slf4j + public enum LifecycleState { + PendingProvider("PENDING_PROVIDER"), + Verifying("VERIFYING"), + Provisioning("PROVISIONING"), + Provisioned("PROVISIONED"), + Failed("FAILED"), + Inactive("INACTIVE"), + Terminating("TERMINATING"), + Terminated("TERMINATED"), + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); + + private final String value; + private static Map map; + + static { + map = new HashMap<>(); + for (LifecycleState v : LifecycleState.values()) { + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } + } + } + + LifecycleState(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @JsonCreator + public static LifecycleState create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; + } + }; + /** + * The virtual circuit's current state. For information about + * the different states, see + * [FastConnect](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm). + * + **/ + @JsonProperty("lifecycleState") + LifecycleState lifecycleState; + + /** + * The Oracle BGP ASN. + **/ + @JsonProperty("oracleBgpAsn") + Integer oracleBgpAsn; + + /** + * The name of the provider. + **/ + @JsonProperty("providerName") + @Size(min = 1, max = 255) + String providerName; + + /** + * The name of the service offered by the provider. + **/ + @JsonProperty("providerServiceName") + @Size(min = 1, max = 255) + String providerServiceName; + /** + * The provider's state in relation to this virtual circuit. ACTIVE means + * the provider has provisioned the virtual circuit from their end. + * INACTIVE means the provider has not yet provisioned the virtual + * circuit, or has de-provisioned it. + * + **/ + @lombok.extern.slf4j.Slf4j + public enum ProviderState { + Active("ACTIVE"), + Inactive("INACTIVE"), + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); + + private final String value; + private static Map map; + + static { + map = new HashMap<>(); + for (ProviderState v : ProviderState.values()) { + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } + } + } + + ProviderState(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @JsonCreator + public static ProviderState create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + LOG.warn( + "Received unknown value '{}' for enum 'ProviderState', returning UnknownEnumValue", + key); + return UnknownEnumValue; + } + }; + /** + * The provider's state in relation to this virtual circuit. ACTIVE means + * the provider has provisioned the virtual circuit from their end. + * INACTIVE means the provider has not yet provisioned the virtual + * circuit, or has de-provisioned it. + * + **/ + @JsonProperty("providerState") + ProviderState providerState; + + /** + * Provider-supplied reference information about this virtual circuit. + * + **/ + @JsonProperty("referenceComment") + String referenceComment; + + /** + * The Oracle Bare Metal Cloud Services region where this virtual + * circuit is located. + * + **/ + @JsonProperty("region") + @Size(min = 1, max = 255) + String region; + + /** + * The date and time the virtual circuit was created, + * in the format defined by RFC3339. + *

+ * Example: `2016-08-25T21:10:29.600Z` + * + **/ + @JsonProperty("timeCreated") + Date timeCreated; + /** + * The type of IP addresses used in this virtual circuit. PRIVATE means + * [RFC 1918](https://tools.ietf.org/html/rfc1918) addresses + * (10.0.0.0/8, 172.16/12, and 192.168/16). Only PRIVATE is supported. + * + **/ + @lombok.extern.slf4j.Slf4j + public enum Type { + Public("PUBLIC"), + Private("PRIVATE"), + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); + + private final String value; + private static Map map; + + static { + map = new HashMap<>(); + for (Type v : Type.values()) { + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } + } + } + + Type(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @JsonCreator + public static Type create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + LOG.warn( + "Received unknown value '{}' for enum 'Type', returning UnknownEnumValue", key); + return UnknownEnumValue; + } + }; + /** + * The type of IP addresses used in this virtual circuit. PRIVATE means + * [RFC 1918](https://tools.ietf.org/html/rfc1918) addresses + * (10.0.0.0/8, 172.16/12, and 192.168/16). Only PRIVATE is supported. + * + **/ + @JsonProperty("type") + Type type; +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/VirtualCircuitBandwidthShape.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/VirtualCircuitBandwidthShape.java new file mode 100644 index 00000000000..9b4935f7206 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/VirtualCircuitBandwidthShape.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * An individual bandwidth level for virtual circuits. + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Value +@JsonDeserialize(builder = VirtualCircuitBandwidthShape.Builder.class) +public class VirtualCircuitBandwidthShape { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("bandwidthInMbps") + private Integer bandwidthInMbps; + + @JsonProperty("name") + private String name; + + public VirtualCircuitBandwidthShape build() { + return new VirtualCircuitBandwidthShape(bandwidthInMbps, name); + } + + @JsonIgnore + public Builder copy(VirtualCircuitBandwidthShape o) { + return bandwidthInMbps(o.getBandwidthInMbps()).name(o.getName()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The bandwidth in Mbps. + *

+ * Example: `10000` + * + **/ + @JsonProperty("bandwidthInMbps") + Integer bandwidthInMbps; + + /** + * The name of the bandwidth shape. + *

+ * Example: `10 Gbps` + * + **/ + @JsonProperty("name") + @Valid + @NotNull + @Size(min = 1, max = 255) + String name; +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/Vnic.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/Vnic.java index ad09f622b49..0ac84f20389 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/Vnic.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/Vnic.java @@ -151,12 +151,18 @@ public static Builder builder() { /** * The current state of the VNIC. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Provisioning("PROVISIONING"), Available("AVAILABLE"), Terminating("TERMINATING"), Terminated("TERMINATED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -164,7 +170,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -182,7 +190,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/VnicAttachment.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/VnicAttachment.java index 7a052edcdcc..3e10abcf743 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/VnicAttachment.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/VnicAttachment.java @@ -136,12 +136,18 @@ public static Builder builder() { /** * The current state of the VNIC attachment. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Attaching("ATTACHING"), Attached("ATTACHED"), Detaching("DETACHING"), Detached("DETACHED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -149,7 +155,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -167,7 +175,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/Volume.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/Volume.java index 6382f05c324..e2623369528 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/Volume.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/Volume.java @@ -125,6 +125,7 @@ public static Builder builder() { /** * The current state of a volume. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Provisioning("PROVISIONING"), Restoring("RESTORING"), @@ -132,7 +133,12 @@ public enum LifecycleState { Terminating("TERMINATING"), Terminated("TERMINATED"), Faulty("FAULTY"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -140,7 +146,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -158,7 +166,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/VolumeAttachment.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/VolumeAttachment.java index d592a0493ff..b7d32e55749 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/VolumeAttachment.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/VolumeAttachment.java @@ -87,12 +87,18 @@ public class VolumeAttachment { /** * The current state of the volume attachment. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Attaching("ATTACHING"), Attached("ATTACHED"), Detaching("DETACHING"), Detached("DETACHED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -100,7 +106,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -118,7 +126,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/VolumeBackup.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/VolumeBackup.java index 33b022da26d..8442d340d78 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/VolumeBackup.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/VolumeBackup.java @@ -122,6 +122,7 @@ public static Builder builder() { /** * The current state of a volume backup. **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Creating("CREATING"), Available("AVAILABLE"), @@ -129,7 +130,12 @@ public enum LifecycleState { Terminated("TERMINATED"), Faulty("FAULTY"), RequestReceived("REQUEST_RECEIVED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -137,7 +143,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -155,7 +163,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/requests/CreateVirtualCircuitRequest.java b/bmc-core/src/main/java/com/oracle/bmc/core/requests/CreateVirtualCircuitRequest.java new file mode 100644 index 00000000000..e2d28ba3706 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/requests/CreateVirtualCircuitRequest.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class CreateVirtualCircuitRequest { + + /** + * Details to create a VirtualCircuit. + */ + private CreateVirtualCircuitDetails createVirtualCircuitDetails; + + /** + * A token that uniquely identifies a request so it can be retried in case of a timeout or + * server error without risk of executing that same action again. Retry tokens expire after 24 + * hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + * has been deleted and purged from the system, then a retry of the original creation request + * may be rejected). + * + */ + private String opcRetryToken; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateVirtualCircuitRequest o) { + createVirtualCircuitDetails(o.getCreateVirtualCircuitDetails()); + opcRetryToken(o.getOpcRetryToken()); + return this; + } + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/requests/DeleteVirtualCircuitRequest.java b/bmc-core/src/main/java/com/oracle/bmc/core/requests/DeleteVirtualCircuitRequest.java new file mode 100644 index 00000000000..ae0e4b68c89 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/requests/DeleteVirtualCircuitRequest.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class DeleteVirtualCircuitRequest { + + /** + * The OCID of the virtual circuit. + */ + private String virtualCircuitId; + + /** + * For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + * parameter to the value of the etag from a previous GET or POST response for that resource. The resource + * will be updated or deleted only if the etag you provide matches the resource's current etag value. + * + */ + private String ifMatch; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteVirtualCircuitRequest o) { + virtualCircuitId(o.getVirtualCircuitId()); + ifMatch(o.getIfMatch()); + return this; + } + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/requests/GetVirtualCircuitRequest.java b/bmc-core/src/main/java/com/oracle/bmc/core/requests/GetVirtualCircuitRequest.java new file mode 100644 index 00000000000..c936b40fa3b --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/requests/GetVirtualCircuitRequest.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class GetVirtualCircuitRequest { + + /** + * The OCID of the virtual circuit. + */ + private String virtualCircuitId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetVirtualCircuitRequest o) { + virtualCircuitId(o.getVirtualCircuitId()); + return this; + } + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/requests/ListFastConnectProviderServicesRequest.java b/bmc-core/src/main/java/com/oracle/bmc/core/requests/ListFastConnectProviderServicesRequest.java new file mode 100644 index 00000000000..22a2b604ec6 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/requests/ListFastConnectProviderServicesRequest.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class ListFastConnectProviderServicesRequest { + + /** + * The OCID of the compartment. + */ + private String compartmentId; + + /** + * The maximum number of items to return in a paginated \"List\" call. + *

+ * Example: `500` + * + */ + private Integer limit; + + /** + * The value of the `opc-next-page` response header from the previous \"List\" call. + * + */ + private String page; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListFastConnectProviderServicesRequest o) { + compartmentId(o.getCompartmentId()); + limit(o.getLimit()); + page(o.getPage()); + return this; + } + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/requests/ListVirtualCircuitBandwidthShapesRequest.java b/bmc-core/src/main/java/com/oracle/bmc/core/requests/ListVirtualCircuitBandwidthShapesRequest.java new file mode 100644 index 00000000000..0dba7ce1351 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/requests/ListVirtualCircuitBandwidthShapesRequest.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class ListVirtualCircuitBandwidthShapesRequest { + + /** + * The OCID of the compartment. + */ + private String compartmentId; + + /** + * The maximum number of items to return in a paginated \"List\" call. + *

+ * Example: `500` + * + */ + private Integer limit; + + /** + * The value of the `opc-next-page` response header from the previous \"List\" call. + * + */ + private String page; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListVirtualCircuitBandwidthShapesRequest o) { + compartmentId(o.getCompartmentId()); + limit(o.getLimit()); + page(o.getPage()); + return this; + } + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/requests/ListVirtualCircuitsRequest.java b/bmc-core/src/main/java/com/oracle/bmc/core/requests/ListVirtualCircuitsRequest.java new file mode 100644 index 00000000000..a6c1eac3cce --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/requests/ListVirtualCircuitsRequest.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class ListVirtualCircuitsRequest { + + /** + * The OCID of the compartment. + */ + private String compartmentId; + + /** + * The maximum number of items to return in a paginated \"List\" call. + *

+ * Example: `500` + * + */ + private Integer limit; + + /** + * The value of the `opc-next-page` response header from the previous \"List\" call. + * + */ + private String page; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListVirtualCircuitsRequest o) { + compartmentId(o.getCompartmentId()); + limit(o.getLimit()); + page(o.getPage()); + return this; + } + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/requests/UpdateVirtualCircuitRequest.java b/bmc-core/src/main/java/com/oracle/bmc/core/requests/UpdateVirtualCircuitRequest.java new file mode 100644 index 00000000000..019cd0bf562 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/requests/UpdateVirtualCircuitRequest.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class UpdateVirtualCircuitRequest { + + /** + * The OCID of the virtual circuit. + */ + private String virtualCircuitId; + + /** + * Update VirtualCircuit fields. + */ + private UpdateVirtualCircuitDetails updateVirtualCircuitDetails; + + /** + * For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + * parameter to the value of the etag from a previous GET or POST response for that resource. The resource + * will be updated or deleted only if the etag you provide matches the resource's current etag value. + * + */ + private String ifMatch; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateVirtualCircuitRequest o) { + virtualCircuitId(o.getVirtualCircuitId()); + updateVirtualCircuitDetails(o.getUpdateVirtualCircuitDetails()); + ifMatch(o.getIfMatch()); + return this; + } + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/responses/CreateVirtualCircuitResponse.java b/bmc-core/src/main/java/com/oracle/bmc/core/responses/CreateVirtualCircuitResponse.java new file mode 100644 index 00000000000..1cde493b57f --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/responses/CreateVirtualCircuitResponse.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class CreateVirtualCircuitResponse { + + /** + * For optimistic concurrency control. See `if-match`. + */ + private String etag; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned VirtualCircuit instance. + */ + private VirtualCircuit virtualCircuit; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateVirtualCircuitResponse o) { + etag(o.getEtag()); + opcRequestId(o.getOpcRequestId()); + virtualCircuit(o.getVirtualCircuit()); + + return this; + } + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/responses/DeleteVirtualCircuitResponse.java b/bmc-core/src/main/java/com/oracle/bmc/core/responses/DeleteVirtualCircuitResponse.java new file mode 100644 index 00000000000..17af3053b69 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/responses/DeleteVirtualCircuitResponse.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class DeleteVirtualCircuitResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteVirtualCircuitResponse o) { + opcRequestId(o.getOpcRequestId()); + + return this; + } + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/responses/GetVirtualCircuitResponse.java b/bmc-core/src/main/java/com/oracle/bmc/core/responses/GetVirtualCircuitResponse.java new file mode 100644 index 00000000000..0459c695965 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/responses/GetVirtualCircuitResponse.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class GetVirtualCircuitResponse { + + /** + * For optimistic concurrency control. See `if-match`. + */ + private String etag; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned VirtualCircuit instance. + */ + private VirtualCircuit virtualCircuit; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetVirtualCircuitResponse o) { + etag(o.getEtag()); + opcRequestId(o.getOpcRequestId()); + virtualCircuit(o.getVirtualCircuit()); + + return this; + } + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/responses/ListFastConnectProviderServicesResponse.java b/bmc-core/src/main/java/com/oracle/bmc/core/responses/ListFastConnectProviderServicesResponse.java new file mode 100644 index 00000000000..9b75e0ec5cd --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/responses/ListFastConnectProviderServicesResponse.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class ListFastConnectProviderServicesResponse { + + /** + * For pagination of a list of items. When paging through a list, if this header appears in the response, + * then a partial list might have been returned. Include this value as the `page` parameter for the + * subsequent GET request to get the next batch of items. + * + */ + private String opcNextPage; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of FastConnectProviderService instances. + */ + private List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListFastConnectProviderServicesResponse o) { + opcNextPage(o.getOpcNextPage()); + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/responses/ListVirtualCircuitBandwidthShapesResponse.java b/bmc-core/src/main/java/com/oracle/bmc/core/responses/ListVirtualCircuitBandwidthShapesResponse.java new file mode 100644 index 00000000000..26445362f11 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/responses/ListVirtualCircuitBandwidthShapesResponse.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class ListVirtualCircuitBandwidthShapesResponse { + + /** + * For pagination of a list of items. When paging through a list, if this header appears in the response, + * then a partial list might have been returned. Include this value as the `page` parameter for the + * subsequent GET request to get the next batch of items. + * + */ + private String opcNextPage; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of VirtualCircuitBandwidthShape instances. + */ + private List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListVirtualCircuitBandwidthShapesResponse o) { + opcNextPage(o.getOpcNextPage()); + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/responses/ListVirtualCircuitsResponse.java b/bmc-core/src/main/java/com/oracle/bmc/core/responses/ListVirtualCircuitsResponse.java new file mode 100644 index 00000000000..be829f68e07 --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/responses/ListVirtualCircuitsResponse.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class ListVirtualCircuitsResponse { + + /** + * For pagination of a list of items. When paging through a list, if this header appears in the response, + * then a partial list might have been returned. Include this value as the `page` parameter for the + * subsequent GET request to get the next batch of items. + * + */ + private String opcNextPage; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of VirtualCircuit instances. + */ + private List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListVirtualCircuitsResponse o) { + opcNextPage(o.getOpcNextPage()); + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/responses/UpdateVirtualCircuitResponse.java b/bmc-core/src/main/java/com/oracle/bmc/core/responses/UpdateVirtualCircuitResponse.java new file mode 100644 index 00000000000..579ac2534dc --- /dev/null +++ b/bmc-core/src/main/java/com/oracle/bmc/core/responses/UpdateVirtualCircuitResponse.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.core.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.core.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") +@Builder(builderClassName = "Builder") +@Getter +public class UpdateVirtualCircuitResponse { + + /** + * For optimistic concurrency control. See `if-match`. + */ + private String etag; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned VirtualCircuit instance. + */ + private VirtualCircuit virtualCircuit; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateVirtualCircuitResponse o) { + etag(o.getEtag()); + opcRequestId(o.getOpcRequestId()); + virtualCircuit(o.getVirtualCircuit()); + + return this; + } + } +} diff --git a/bmc-examples/pom.xml b/bmc-examples/pom.xml index 6ad76cef20c..d4430123850 100644 --- a/bmc-examples/pom.xml +++ b/bmc-examples/pom.xml @@ -5,7 +5,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk - 1.2.5 + 1.2.7 ../pom.xml @@ -19,7 +19,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk-bom - 1.2.5 + 1.2.7 pom import diff --git a/bmc-identity/pom.xml b/bmc-identity/pom.xml index 6a4ab49fe4a..2cae7fa80c5 100644 --- a/bmc-identity/pom.xml +++ b/bmc-identity/pom.xml @@ -5,7 +5,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk - 1.2.5 + 1.2.7 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk-common - 1.2.5 + 1.2.7 diff --git a/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityWaiters.java b/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityWaiters.java index 3ccf56262cc..8f32d14820b 100644 --- a/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityWaiters.java +++ b/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityWaiters.java @@ -3,7 +3,6 @@ */ package com.oracle.bmc.identity; -import com.oracle.bmc.identity.model.*; import com.oracle.bmc.identity.requests.*; import com.oracle.bmc.identity.responses.*; @@ -38,7 +37,8 @@ public class IdentityWaiters { * @return A new Waiter instance. */ public Waiter forCompartment( - GetCompartmentRequest request, Compartment.LifecycleState targetState) { + GetCompartmentRequest request, + com.oracle.bmc.identity.model.Compartment.LifecycleState targetState) { return forCompartment(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -53,7 +53,7 @@ public Waiter forCompartment( */ public Waiter forCompartment( GetCompartmentRequest request, - Compartment.LifecycleState targetState, + com.oracle.bmc.identity.model.Compartment.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forCompartment( @@ -64,7 +64,7 @@ public Waiter forCompartment( private Waiter forCompartment( BmcGenericWaiter waiter, final GetCompartmentRequest request, - final Compartment.LifecycleState targetState) { + final com.oracle.bmc.identity.model.Compartment.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -81,7 +81,9 @@ public boolean apply(GetCompartmentResponse response) { return response.getCompartment().getLifecycleState() == targetState; } }, - targetState == Compartment.LifecycleState.Deleted), + targetState + == com.oracle.bmc.identity.model.Compartment.LifecycleState + .Deleted), request); } @@ -93,7 +95,8 @@ public boolean apply(GetCompartmentResponse response) { * @return A new Waiter instance. */ public Waiter forGroup( - GetGroupRequest request, Group.LifecycleState targetState) { + GetGroupRequest request, + com.oracle.bmc.identity.model.Group.LifecycleState targetState) { return forGroup(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -108,7 +111,7 @@ public Waiter forGroup( */ public Waiter forGroup( GetGroupRequest request, - Group.LifecycleState targetState, + com.oracle.bmc.identity.model.Group.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forGroup( @@ -119,7 +122,7 @@ public Waiter forGroup( private Waiter forGroup( BmcGenericWaiter waiter, final GetGroupRequest request, - final Group.LifecycleState targetState) { + final com.oracle.bmc.identity.model.Group.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -136,7 +139,7 @@ public boolean apply(GetGroupResponse response) { return response.getGroup().getLifecycleState() == targetState; } }, - targetState == Group.LifecycleState.Deleted), + targetState == com.oracle.bmc.identity.model.Group.LifecycleState.Deleted), request); } @@ -148,7 +151,8 @@ public boolean apply(GetGroupResponse response) { * @return A new Waiter instance. */ public Waiter forPolicy( - GetPolicyRequest request, Policy.LifecycleState targetState) { + GetPolicyRequest request, + com.oracle.bmc.identity.model.Policy.LifecycleState targetState) { return forPolicy(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -163,7 +167,7 @@ public Waiter forPolicy( */ public Waiter forPolicy( GetPolicyRequest request, - Policy.LifecycleState targetState, + com.oracle.bmc.identity.model.Policy.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forPolicy( @@ -174,7 +178,7 @@ public Waiter forPolicy( private Waiter forPolicy( BmcGenericWaiter waiter, final GetPolicyRequest request, - final Policy.LifecycleState targetState) { + final com.oracle.bmc.identity.model.Policy.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -191,7 +195,7 @@ public boolean apply(GetPolicyResponse response) { return response.getPolicy().getLifecycleState() == targetState; } }, - targetState == Policy.LifecycleState.Deleted), + targetState == com.oracle.bmc.identity.model.Policy.LifecycleState.Deleted), request); } @@ -203,7 +207,7 @@ public boolean apply(GetPolicyResponse response) { * @return A new Waiter instance. */ public Waiter forUser( - GetUserRequest request, User.LifecycleState targetState) { + GetUserRequest request, com.oracle.bmc.identity.model.User.LifecycleState targetState) { return forUser(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -218,7 +222,7 @@ public Waiter forUser( */ public Waiter forUser( GetUserRequest request, - User.LifecycleState targetState, + com.oracle.bmc.identity.model.User.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forUser(Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); @@ -228,7 +232,7 @@ public Waiter forUser( private Waiter forUser( BmcGenericWaiter waiter, final GetUserRequest request, - final User.LifecycleState targetState) { + final com.oracle.bmc.identity.model.User.LifecycleState targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -245,7 +249,7 @@ public boolean apply(GetUserResponse response) { return response.getUser().getLifecycleState() == targetState; } }, - targetState == User.LifecycleState.Deleted), + targetState == com.oracle.bmc.identity.model.User.LifecycleState.Deleted), request); } @@ -259,7 +263,7 @@ public boolean apply(GetUserResponse response) { public Waiter forUserGroupMembership( GetUserGroupMembershipRequest request, - UserGroupMembership.LifecycleState targetState) { + com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState targetState) { return forUserGroupMembership(Waiters.DEFAULT_POLLING_WAITER, request, targetState); } @@ -275,7 +279,7 @@ public boolean apply(GetUserResponse response) { public Waiter forUserGroupMembership( GetUserGroupMembershipRequest request, - UserGroupMembership.LifecycleState targetState, + com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState targetState, TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { return forUserGroupMembership( @@ -287,7 +291,8 @@ public boolean apply(GetUserResponse response) { forUserGroupMembership( BmcGenericWaiter waiter, final GetUserGroupMembershipRequest request, - final UserGroupMembership.LifecycleState targetState) { + final com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState + targetState) { return new SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -307,7 +312,9 @@ public boolean apply(GetUserGroupMembershipResponse response) { == targetState; } }, - targetState == UserGroupMembership.LifecycleState.Deleted), + targetState + == com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState + .Deleted), request); } } diff --git a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/ApiKey.java b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/ApiKey.java index 8360f945cb5..25e98eda4a5 100644 --- a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/ApiKey.java +++ b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/ApiKey.java @@ -125,13 +125,19 @@ public static Builder builder() { * CREATING to ACTIVE before using it. * **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Creating("CREATING"), Active("ACTIVE"), Inactive("INACTIVE"), Deleting("DELETING"), Deleted("DELETED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -139,7 +145,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -157,7 +165,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/Compartment.java b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/Compartment.java index 4bcf6c2dc53..ab0346ca923 100644 --- a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/Compartment.java +++ b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/Compartment.java @@ -143,13 +143,19 @@ public static Builder builder() { * CREATING to ACTIVE before using it. * **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Creating("CREATING"), Active("ACTIVE"), Inactive("INACTIVE"), Deleting("DELETING"), Deleted("DELETED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -157,7 +163,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -175,7 +183,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/Group.java b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/Group.java index c181076007d..de963c05517 100644 --- a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/Group.java +++ b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/Group.java @@ -134,13 +134,19 @@ public static Builder builder() { * ACTIVE before using it. * **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Creating("CREATING"), Active("ACTIVE"), Inactive("INACTIVE"), Deleting("DELETING"), Deleted("DELETED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -148,7 +154,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -166,7 +174,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/Policy.java b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/Policy.java index 7bbcb2271de..5d4debf4abd 100644 --- a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/Policy.java +++ b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/Policy.java @@ -159,13 +159,19 @@ public static Builder builder() { * ACTIVE before using it. * **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Creating("CREATING"), Active("ACTIVE"), Inactive("INACTIVE"), Deleting("DELETING"), Deleted("DELETED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -173,7 +179,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -191,7 +199,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/SwiftPassword.java b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/SwiftPassword.java index 51b111b460e..38c8c3642dc 100644 --- a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/SwiftPassword.java +++ b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/SwiftPassword.java @@ -137,13 +137,19 @@ public static Builder builder() { * CREATING to ACTIVE before using it. * **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Creating("CREATING"), Active("ACTIVE"), Inactive("INACTIVE"), Deleting("DELETING"), Deleted("DELETED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -151,7 +157,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -169,7 +177,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/UIPassword.java b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/UIPassword.java index 65870cf8cc7..7e99bf08126 100644 --- a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/UIPassword.java +++ b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/UIPassword.java @@ -90,13 +90,19 @@ public static Builder builder() { * CREATING to ACTIVE before using it. * **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Creating("CREATING"), Active("ACTIVE"), Inactive("INACTIVE"), Deleting("DELETING"), Deleted("DELETED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -104,7 +110,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -122,7 +130,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/User.java b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/User.java index 1f1a6b03d22..7f28c08ae8d 100644 --- a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/User.java +++ b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/User.java @@ -138,13 +138,19 @@ public static Builder builder() { * ACTIVE before using it. * **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Creating("CREATING"), Active("ACTIVE"), Inactive("INACTIVE"), Deleting("DELETING"), Deleted("DELETED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -152,7 +158,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -170,7 +178,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/UserGroupMembership.java b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/UserGroupMembership.java index 4724587ff6b..2bdf91354fd 100644 --- a/bmc-identity/src/main/java/com/oracle/bmc/identity/model/UserGroupMembership.java +++ b/bmc-identity/src/main/java/com/oracle/bmc/identity/model/UserGroupMembership.java @@ -125,13 +125,19 @@ public static Builder builder() { * from CREATING to ACTIVE before using it. * **/ + @lombok.extern.slf4j.Slf4j public enum LifecycleState { Creating("CREATING"), Active("ACTIVE"), Inactive("INACTIVE"), Deleting("DELETING"), Deleted("DELETED"), - ; + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); private final String value; private static Map map; @@ -139,7 +145,9 @@ public enum LifecycleState { static { map = new HashMap<>(); for (LifecycleState v : LifecycleState.values()) { - map.put(v.getValue(), v); + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } } } @@ -157,7 +165,10 @@ public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } - throw new RuntimeException("Invalid LifecycleState: " + key); + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; } }; /** diff --git a/bmc-loadbalancer/pom.xml b/bmc-loadbalancer/pom.xml new file mode 100644 index 00000000000..ef8d9abe492 --- /dev/null +++ b/bmc-loadbalancer/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + + + com.oracle.bmc.sdk + oracle-bmc-java-sdk + 1.2.7 + ../pom.xml + + + oracle-bmc-java-sdk-loadbalancer + Oracle Bare Metal Cloud Services SDK - Load Balancer + This project contains the SDK used for Oracle Bare Metal Cloud Load Balancer Service + https://docs.us-phoenix-1.oraclecloud.com/Content/API/SDKDocs/javasdk.htm + + + + com.oracle.bmc.sdk + oracle-bmc-java-sdk-common + 1.2.7 + + + + diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancer.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancer.java new file mode 100644 index 00000000000..2c7163c38f8 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancer.java @@ -0,0 +1,332 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer; + +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.oracle.bmc.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +public interface LoadBalancer extends AutoCloseable { + + /** + * Sets the endpoint to call (ex, https://www.example.com). + * @param endpoint The endpoint of the service. + */ + void setEndpoint(String endpoint); + + /** + * Sets the region to call (ex, Region.US_PHOENIX_1). + *

+ * Note, this will call {@link #setEndpoint(String) setEndpoint} after resolving the endpoint. If the service is not available in this Region, however, an IllegalArgumentException will be raised. + * @param region The region of the service. + */ + void setRegion(Region region); + + /** + * Sets the region to call (ex, 'us-phoenix-1'). + *

+ * Note, this will first try to map the region ID to a known Region and call + * {@link #setRegion(Region) setRegion}. + *

+ * If no known Region could be determined, it will create an endpoint based on the + * default endpoint format ({@link Region#formatDefaultRegionEndpoint(Service, String)} + * and then call {@link #setEndpoint(String) setEndpoint}. + * @param regionId The public region ID. + */ + void setRegion(String regionId); + + /** + * Adds a backend server to a backend set. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + CreateBackendResponse createBackend(CreateBackendRequest request); + + /** + * Adds a backend set to a load balancer. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + CreateBackendSetResponse createBackendSet(CreateBackendSetRequest request); + + /** + * Creates an asynchronous request to add an SSL certificate. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + CreateCertificateResponse createCertificate(CreateCertificateRequest request); + + /** + * Adds a listener to a load balancer. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + CreateListenerResponse createListener(CreateListenerRequest request); + + /** + * Creates a new load balancer in the specified compartment. For general information about load balancers, + * see [Overview of the Load Balancing Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Concepts/balanceoverview.htm). + *

+ * For the purposes of access control, you must provide the OCID of the compartment where you want + * the load balancer to reside. Notice that the load balancer doesn't have to be in the same compartment as the VCN + * or backend set. If you're not sure which compartment to use, put the load balancer in the same compartment as the VCN. + * For information about access control and compartments, see + * [Overview of the IAM Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). + *

+ * You must specify a display name for the load balancer. It does not have to be unique, and you can change it. + *

+ * To successfully create a load balancer within your Virtual Cloud Network (VCN), you must specify two + * subnets. Each subnet must reside in a separate Availability Domain. + *

+ * For information about Availability Domains, see + * [Regions and Availability Domains](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). + * To get a list of Availability Domains, use the `ListAvailabilityDomains` operation + * in the Identity and Access Management Service API. + *

+ * All Oracle Bare Metal Cloud Services resources, including load balancers, get an Oracle-assigned, + * unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID + * in the response. You can also retrieve a resource's OCID by using a List API operation on that resource type, + * or by viewing the resource in the Console. Fore more information, see + * [Resource Identifiers](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + *

+ * After you send your request, the new object's state will temporarily be PROVISIONING. Before using the + * object, first make sure its state has changed to RUNNING. + *

+ * When you create a load balancer, the system issues a public IP address. + * To get the IP address, use the {@link #getLoadBalancer(GetLoadBalancerRequest) getLoadBalancer} operation. + * + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + CreateLoadBalancerResponse createLoadBalancer(CreateLoadBalancerRequest request); + + /** + * Removes a backend server from a given load balancer and backend set. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + DeleteBackendResponse deleteBackend(DeleteBackendRequest request); + + /** + * Deletes the specified backend set. Note that deleting a backend set removes its backend servers from the load balancer. + *

+ * Before you can delete a backend set, you must remove it from any active listeners. + * + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + DeleteBackendSetResponse deleteBackendSet(DeleteBackendSetRequest request); + + /** + * Deletes an SSL certificate from a load balancer. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + DeleteCertificateResponse deleteCertificate(DeleteCertificateRequest request); + + /** + * Deletes a listener from a load balancer. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + DeleteListenerResponse deleteListener(DeleteListenerRequest request); + + /** + * Stops a load balancer and removes it from service. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + DeleteLoadBalancerResponse deleteLoadBalancer(DeleteLoadBalancerRequest request); + + /** + * Gets the specified backend server's configuration information. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + GetBackendResponse getBackend(GetBackendRequest request); + + /** + * Gets the specified backend set's configuration information. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + GetBackendSetResponse getBackendSet(GetBackendSetRequest request); + + /** + * Gets the health check policy information for a given load balancer and backend set. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + GetHealthCheckerResponse getHealthChecker(GetHealthCheckerRequest request); + + /** + * Gets the specified load balancer's configuration information. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + GetLoadBalancerResponse getLoadBalancer(GetLoadBalancerRequest request); + + /** + * Gets the details of a work request. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + GetWorkRequestResponse getWorkRequest(GetWorkRequestRequest request); + + /** + * Lists all backend sets associated with a given load balancer. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListBackendSetsResponse listBackendSets(ListBackendSetsRequest request); + + /** + * Lists the backend servers for a given load balancer and backend set. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListBackendsResponse listBackends(ListBackendsRequest request); + + /** + * Lists all SSL certificates associated with a given load balancer. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListCertificatesResponse listCertificates(ListCertificatesRequest request); + + /** + * Lists all load balancers in the specified compartment. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListLoadBalancersResponse listLoadBalancers(ListLoadBalancersRequest request); + + /** + * Lists the available load balancer policies. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListPoliciesResponse listPolicies(ListPoliciesRequest request); + + /** + * Lists all supported traffic protocols. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListProtocolsResponse listProtocols(ListProtocolsRequest request); + + /** + * Lists the valid load balancer shapes. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListShapesResponse listShapes(ListShapesRequest request); + + /** + * Lists the work requests for a given load balancer. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListWorkRequestsResponse listWorkRequests(ListWorkRequestsRequest request); + + /** + * Updates the configuration of a backend server within the specified backend set. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + UpdateBackendResponse updateBackend(UpdateBackendRequest request); + + /** + * Updates a backend set. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + UpdateBackendSetResponse updateBackendSet(UpdateBackendSetRequest request); + + /** + * Updates the health check policy for a given load balancer and backend set. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + UpdateHealthCheckerResponse updateHealthChecker(UpdateHealthCheckerRequest request); + + /** + * Updates a listener for a given load balancer. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + UpdateListenerResponse updateListener(UpdateListenerRequest request); + + /** + * Updates a load balancer's configuration. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + UpdateLoadBalancerResponse updateLoadBalancer(UpdateLoadBalancerRequest request); + + /** + * Gets the pre-configured waiters available for resources for this service. + * + * @return The service waiters. + */ + LoadBalancerWaiters getWaiters(); +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsync.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsync.java new file mode 100644 index 00000000000..6e52bb07069 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsync.java @@ -0,0 +1,467 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer; + +import com.oracle.bmc.responses.AsyncHandler; + +import java.util.concurrent.Future; + +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.oracle.bmc.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +public interface LoadBalancerAsync extends AutoCloseable { + + /** + * Sets the endpoint to call (ex, https://www.example.com). + * @param endpoint The endpoint of the serice. + */ + void setEndpoint(String endpoint); + + /** + * Sets the region to call (ex, Region.US_PHOENIX_1). + *

+ * Note, this will call {@link #setEndpoint(String) setEndpoint} after resolving the endpoint. If the service is not available in this region, however, an IllegalArgumentException will be raised. + * @param region The region of the service. + */ + void setRegion(Region region); + + /** + * Sets the region to call (ex, 'us-phoenix-1'). + *

+ * Note, this will first try to map the region ID to a known Region and call + * {@link #setRegion(Region) setRegion}. + *

+ * If no known Region could be determined, it will create an endpoint based on the + * default endpoint format ({@link Region#formatDefaultRegionEndpoint(Service, String)} + * and then call {@link #setEndpoint(String) setEndpoint}. + * @param regionId The public region ID. + */ + void setRegion(String regionId); + + /** + * Adds a backend server to a backend set. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future createBackend( + CreateBackendRequest request, + AsyncHandler handler); + + /** + * Adds a backend set to a load balancer. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future createBackendSet( + CreateBackendSetRequest request, + AsyncHandler handler); + + /** + * Creates an asynchronous request to add an SSL certificate. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future createCertificate( + CreateCertificateRequest request, + AsyncHandler handler); + + /** + * Adds a listener to a load balancer. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future createListener( + CreateListenerRequest request, + AsyncHandler handler); + + /** + * Creates a new load balancer in the specified compartment. For general information about load balancers, + * see [Overview of the Load Balancing Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Concepts/balanceoverview.htm). + *

+ * For the purposes of access control, you must provide the OCID of the compartment where you want + * the load balancer to reside. Notice that the load balancer doesn't have to be in the same compartment as the VCN + * or backend set. If you're not sure which compartment to use, put the load balancer in the same compartment as the VCN. + * For information about access control and compartments, see + * [Overview of the IAM Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). + *

+ * You must specify a display name for the load balancer. It does not have to be unique, and you can change it. + *

+ * To successfully create a load balancer within your Virtual Cloud Network (VCN), you must specify two + * subnets. Each subnet must reside in a separate Availability Domain. + *

+ * For information about Availability Domains, see + * [Regions and Availability Domains](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). + * To get a list of Availability Domains, use the `ListAvailabilityDomains` operation + * in the Identity and Access Management Service API. + *

+ * All Oracle Bare Metal Cloud Services resources, including load balancers, get an Oracle-assigned, + * unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID + * in the response. You can also retrieve a resource's OCID by using a List API operation on that resource type, + * or by viewing the resource in the Console. Fore more information, see + * [Resource Identifiers](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + *

+ * After you send your request, the new object's state will temporarily be PROVISIONING. Before using the + * object, first make sure its state has changed to RUNNING. + *

+ * When you create a load balancer, the system issues a public IP address. + * To get the IP address, use the {@link #getLoadBalancer(GetLoadBalancerRequest, Consumer, Consumer) getLoadBalancer} operation. + * + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future createLoadBalancer( + CreateLoadBalancerRequest request, + AsyncHandler handler); + + /** + * Removes a backend server from a given load balancer and backend set. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future deleteBackend( + DeleteBackendRequest request, + AsyncHandler handler); + + /** + * Deletes the specified backend set. Note that deleting a backend set removes its backend servers from the load balancer. + *

+ * Before you can delete a backend set, you must remove it from any active listeners. + * + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future deleteBackendSet( + DeleteBackendSetRequest request, + AsyncHandler handler); + + /** + * Deletes an SSL certificate from a load balancer. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future deleteCertificate( + DeleteCertificateRequest request, + AsyncHandler handler); + + /** + * Deletes a listener from a load balancer. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future deleteListener( + DeleteListenerRequest request, + AsyncHandler handler); + + /** + * Stops a load balancer and removes it from service. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future deleteLoadBalancer( + DeleteLoadBalancerRequest request, + AsyncHandler handler); + + /** + * Gets the specified backend server's configuration information. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future getBackend( + GetBackendRequest request, AsyncHandler handler); + + /** + * Gets the specified backend set's configuration information. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future getBackendSet( + GetBackendSetRequest request, + AsyncHandler handler); + + /** + * Gets the health check policy information for a given load balancer and backend set. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future getHealthChecker( + GetHealthCheckerRequest request, + AsyncHandler handler); + + /** + * Gets the specified load balancer's configuration information. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future getLoadBalancer( + GetLoadBalancerRequest request, + AsyncHandler handler); + + /** + * Gets the details of a work request. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future getWorkRequest( + GetWorkRequestRequest request, + AsyncHandler handler); + + /** + * Lists all backend sets associated with a given load balancer. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future listBackendSets( + ListBackendSetsRequest request, + AsyncHandler handler); + + /** + * Lists the backend servers for a given load balancer and backend set. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future listBackends( + ListBackendsRequest request, + AsyncHandler handler); + + /** + * Lists all SSL certificates associated with a given load balancer. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future listCertificates( + ListCertificatesRequest request, + AsyncHandler handler); + + /** + * Lists all load balancers in the specified compartment. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future listLoadBalancers( + ListLoadBalancersRequest request, + AsyncHandler handler); + + /** + * Lists the available load balancer policies. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future listPolicies( + ListPoliciesRequest request, + AsyncHandler handler); + + /** + * Lists all supported traffic protocols. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future listProtocols( + ListProtocolsRequest request, + AsyncHandler handler); + + /** + * Lists the valid load balancer shapes. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future listShapes( + ListShapesRequest request, AsyncHandler handler); + + /** + * Lists the work requests for a given load balancer. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future listWorkRequests( + ListWorkRequestsRequest request, + AsyncHandler handler); + + /** + * Updates the configuration of a backend server within the specified backend set. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future updateBackend( + UpdateBackendRequest request, + AsyncHandler handler); + + /** + * Updates a backend set. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future updateBackendSet( + UpdateBackendSetRequest request, + AsyncHandler handler); + + /** + * Updates the health check policy for a given load balancer and backend set. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future updateHealthChecker( + UpdateHealthCheckerRequest request, + AsyncHandler handler); + + /** + * Updates a listener for a given load balancer. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future updateListener( + UpdateListenerRequest request, + AsyncHandler handler); + + /** + * Updates a load balancer's configuration. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + Future updateLoadBalancer( + UpdateLoadBalancerRequest request, + AsyncHandler handler); +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsyncClient.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsyncClient.java new file mode 100644 index 00000000000..586e8bfbbcc --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsyncClient.java @@ -0,0 +1,621 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer; + +import com.oracle.bmc.ClientConfiguration; +import com.oracle.bmc.auth.*; +import com.oracle.bmc.http.ClientConfigurator; +import com.oracle.bmc.http.internal.*; +import com.oracle.bmc.http.signing.*; +import com.oracle.bmc.http.signing.internal.*; +import com.oracle.bmc.responses.*; +import com.oracle.bmc.util.internal.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import java.util.concurrent.Future; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.loadbalancer.internal.http.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.oracle.bmc.*; + +import lombok.AccessLevel; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class LoadBalancerAsyncClient implements LoadBalancerAsync { + /** + * Service instance for LoadBalancer. + */ + public static final Service SERVICE = Services.create("LOADBALANCER", "iaas"); + + @Getter(value = AccessLevel.PACKAGE) + private final RestClient client; + + /** + * Creates a new service instance using the given authentication provider. + * @param authenticationDetailsProvider The authentication details provider, required. + */ + public LoadBalancerAsyncClient( + BasicAuthenticationDetailsProvider authenticationDetailsProvider) { + this(authenticationDetailsProvider, null); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + */ + public LoadBalancerAsyncClient( + BasicAuthenticationDetailsProvider authenticationDetailsProvider, + ClientConfiguration configuration) { + this(authenticationDetailsProvider, configuration, null); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + */ + public LoadBalancerAsyncClient( + BasicAuthenticationDetailsProvider authenticationDetailsProvider, + ClientConfiguration configuration, + ClientConfigurator clientConfigurator) { + this( + authenticationDetailsProvider, + configuration, + clientConfigurator, + new DefaultRequestSignerFactory(SigningStrategy.STANDARD)); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + *

+ * This is an advanced constructor for clients that want to take control over how requests are signed. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + * @param requestSignerFactory The request signer factory used to create the request signer for this service. + */ + public LoadBalancerAsyncClient( + AbstractAuthenticationDetailsProvider authenticationDetailsProvider, + ClientConfiguration configuration, + ClientConfigurator clientConfigurator, + RequestSignerFactory requestSignerFactory) { + RestClientFactory restClientFactory = + RestClientFactoryBuilder.builder().clientConfigurator(clientConfigurator).build(); + RequestSigner requestSigner = + requestSignerFactory.createRequestSigner(SERVICE, authenticationDetailsProvider); + this.client = restClientFactory.create(requestSigner, configuration); + } + + @Override + public void setEndpoint(String endpoint) { + LOG.info("Setting endpoint to {}", endpoint); + client.setEndpoint(endpoint); + } + + @Override + public void setRegion(Region region) { + Optional endpoint = region.getEndpoint(SERVICE); + if (endpoint.isPresent()) { + setEndpoint(endpoint.get()); + } else { + throw new IllegalArgumentException( + "Endpoint for " + SERVICE + " is not known in region " + region); + } + } + + @Override + public void setRegion(String regionId) { + regionId = regionId.toLowerCase(); + try { + Region region = Region.fromRegionId(regionId); + setRegion(region); + } catch (IllegalArgumentException e) { + LOG.info("Unknown regionId '{}', falling back to default endpoint format", regionId); + String endpoint = Region.formatDefaultRegionEndpoint(SERVICE, regionId); + setEndpoint(endpoint); + } + } + + @Override + public void close() { + client.close(); + } + + @Override + public Future createBackend( + CreateBackendRequest request, + AsyncHandler handler) { + LOG.trace("Called async createBackend"); + request = CreateBackendConverter.interceptRequest(request); + Invocation.Builder ib = CreateBackendConverter.fromRequest(client, request); + Function transformer = + CreateBackendConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = + client.post(ib, request.getCreateBackendDetails(), request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future createBackendSet( + CreateBackendSetRequest request, + AsyncHandler handler) { + LOG.trace("Called async createBackendSet"); + request = CreateBackendSetConverter.interceptRequest(request); + Invocation.Builder ib = CreateBackendSetConverter.fromRequest(client, request); + Function transformer = + CreateBackendSetConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = + client.post(ib, request.getCreateBackendSetDetails(), request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future createCertificate( + CreateCertificateRequest request, + AsyncHandler handler) { + LOG.trace("Called async createCertificate"); + request = CreateCertificateConverter.interceptRequest(request); + Invocation.Builder ib = CreateCertificateConverter.fromRequest(client, request); + Function transformer = + CreateCertificateConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = + client.post(ib, request.getCreateCertificateDetails(), request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future createListener( + CreateListenerRequest request, + AsyncHandler handler) { + LOG.trace("Called async createListener"); + request = CreateListenerConverter.interceptRequest(request); + Invocation.Builder ib = CreateListenerConverter.fromRequest(client, request); + Function transformer = + CreateListenerConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = + client.post(ib, request.getCreateListenerDetails(), request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future createLoadBalancer( + CreateLoadBalancerRequest request, + AsyncHandler handler) { + LOG.trace("Called async createLoadBalancer"); + request = CreateLoadBalancerConverter.interceptRequest(request); + Invocation.Builder ib = CreateLoadBalancerConverter.fromRequest(client, request); + Function transformer = + CreateLoadBalancerConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = + client.post( + ib, request.getCreateLoadBalancerDetails(), request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future deleteBackend( + DeleteBackendRequest request, + AsyncHandler handler) { + LOG.trace("Called async deleteBackend"); + request = DeleteBackendConverter.interceptRequest(request); + Invocation.Builder ib = DeleteBackendConverter.fromRequest(client, request); + Function transformer = + DeleteBackendConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.delete(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future deleteBackendSet( + DeleteBackendSetRequest request, + AsyncHandler handler) { + LOG.trace("Called async deleteBackendSet"); + request = DeleteBackendSetConverter.interceptRequest(request); + Invocation.Builder ib = DeleteBackendSetConverter.fromRequest(client, request); + Function transformer = + DeleteBackendSetConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.delete(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future deleteCertificate( + DeleteCertificateRequest request, + AsyncHandler handler) { + LOG.trace("Called async deleteCertificate"); + request = DeleteCertificateConverter.interceptRequest(request); + Invocation.Builder ib = DeleteCertificateConverter.fromRequest(client, request); + Function transformer = + DeleteCertificateConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.delete(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future deleteListener( + DeleteListenerRequest request, + AsyncHandler handler) { + LOG.trace("Called async deleteListener"); + request = DeleteListenerConverter.interceptRequest(request); + Invocation.Builder ib = DeleteListenerConverter.fromRequest(client, request); + Function transformer = + DeleteListenerConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.delete(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future deleteLoadBalancer( + DeleteLoadBalancerRequest request, + AsyncHandler handler) { + LOG.trace("Called async deleteLoadBalancer"); + request = DeleteLoadBalancerConverter.interceptRequest(request); + Invocation.Builder ib = DeleteLoadBalancerConverter.fromRequest(client, request); + Function transformer = + DeleteLoadBalancerConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.delete(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future getBackend( + GetBackendRequest request, + AsyncHandler handler) { + LOG.trace("Called async getBackend"); + request = GetBackendConverter.interceptRequest(request); + Invocation.Builder ib = GetBackendConverter.fromRequest(client, request); + Function transformer = GetBackendConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future getBackendSet( + GetBackendSetRequest request, + AsyncHandler handler) { + LOG.trace("Called async getBackendSet"); + request = GetBackendSetConverter.interceptRequest(request); + Invocation.Builder ib = GetBackendSetConverter.fromRequest(client, request); + Function transformer = + GetBackendSetConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future getHealthChecker( + GetHealthCheckerRequest request, + AsyncHandler handler) { + LOG.trace("Called async getHealthChecker"); + request = GetHealthCheckerConverter.interceptRequest(request); + Invocation.Builder ib = GetHealthCheckerConverter.fromRequest(client, request); + Function transformer = + GetHealthCheckerConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future getLoadBalancer( + GetLoadBalancerRequest request, + AsyncHandler handler) { + LOG.trace("Called async getLoadBalancer"); + request = GetLoadBalancerConverter.interceptRequest(request); + Invocation.Builder ib = GetLoadBalancerConverter.fromRequest(client, request); + Function transformer = + GetLoadBalancerConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future getWorkRequest( + GetWorkRequestRequest request, + AsyncHandler handler) { + LOG.trace("Called async getWorkRequest"); + request = GetWorkRequestConverter.interceptRequest(request); + Invocation.Builder ib = GetWorkRequestConverter.fromRequest(client, request); + Function transformer = + GetWorkRequestConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future listBackendSets( + ListBackendSetsRequest request, + AsyncHandler handler) { + LOG.trace("Called async listBackendSets"); + request = ListBackendSetsConverter.interceptRequest(request); + Invocation.Builder ib = ListBackendSetsConverter.fromRequest(client, request); + Function transformer = + ListBackendSetsConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future listBackends( + ListBackendsRequest request, + AsyncHandler handler) { + LOG.trace("Called async listBackends"); + request = ListBackendsConverter.interceptRequest(request); + Invocation.Builder ib = ListBackendsConverter.fromRequest(client, request); + Function transformer = ListBackendsConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future listCertificates( + ListCertificatesRequest request, + AsyncHandler handler) { + LOG.trace("Called async listCertificates"); + request = ListCertificatesConverter.interceptRequest(request); + Invocation.Builder ib = ListCertificatesConverter.fromRequest(client, request); + Function transformer = + ListCertificatesConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future listLoadBalancers( + ListLoadBalancersRequest request, + AsyncHandler handler) { + LOG.trace("Called async listLoadBalancers"); + request = ListLoadBalancersConverter.interceptRequest(request); + Invocation.Builder ib = ListLoadBalancersConverter.fromRequest(client, request); + Function transformer = + ListLoadBalancersConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future listPolicies( + ListPoliciesRequest request, + AsyncHandler handler) { + LOG.trace("Called async listPolicies"); + request = ListPoliciesConverter.interceptRequest(request); + Invocation.Builder ib = ListPoliciesConverter.fromRequest(client, request); + Function transformer = ListPoliciesConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future listProtocols( + ListProtocolsRequest request, + AsyncHandler handler) { + LOG.trace("Called async listProtocols"); + request = ListProtocolsConverter.interceptRequest(request); + Invocation.Builder ib = ListProtocolsConverter.fromRequest(client, request); + Function transformer = + ListProtocolsConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future listShapes( + ListShapesRequest request, + AsyncHandler handler) { + LOG.trace("Called async listShapes"); + request = ListShapesConverter.interceptRequest(request); + Invocation.Builder ib = ListShapesConverter.fromRequest(client, request); + Function transformer = ListShapesConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future listWorkRequests( + ListWorkRequestsRequest request, + AsyncHandler handler) { + LOG.trace("Called async listWorkRequests"); + request = ListWorkRequestsConverter.interceptRequest(request); + Invocation.Builder ib = ListWorkRequestsConverter.fromRequest(client, request); + Function transformer = + ListWorkRequestsConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = client.get(ib, request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future updateBackend( + UpdateBackendRequest request, + AsyncHandler handler) { + LOG.trace("Called async updateBackend"); + request = UpdateBackendConverter.interceptRequest(request); + Invocation.Builder ib = UpdateBackendConverter.fromRequest(client, request); + Function transformer = + UpdateBackendConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = + client.put(ib, request.getUpdateBackendDetails(), request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future updateBackendSet( + UpdateBackendSetRequest request, + AsyncHandler handler) { + LOG.trace("Called async updateBackendSet"); + request = UpdateBackendSetConverter.interceptRequest(request); + Invocation.Builder ib = UpdateBackendSetConverter.fromRequest(client, request); + Function transformer = + UpdateBackendSetConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = + client.put(ib, request.getUpdateBackendSetDetails(), request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future updateHealthChecker( + UpdateHealthCheckerRequest request, + AsyncHandler handler) { + LOG.trace("Called async updateHealthChecker"); + request = UpdateHealthCheckerConverter.interceptRequest(request); + Invocation.Builder ib = UpdateHealthCheckerConverter.fromRequest(client, request); + Function transformer = + UpdateHealthCheckerConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = + client.put(ib, request.getHealthChecker(), request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future updateListener( + UpdateListenerRequest request, + AsyncHandler handler) { + LOG.trace("Called async updateListener"); + request = UpdateListenerConverter.interceptRequest(request); + Invocation.Builder ib = UpdateListenerConverter.fromRequest(client, request); + Function transformer = + UpdateListenerConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = + client.put(ib, request.getUpdateListenerDetails(), request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } + + @Override + public Future updateLoadBalancer( + UpdateLoadBalancerRequest request, + AsyncHandler handler) { + LOG.trace("Called async updateLoadBalancer"); + request = UpdateLoadBalancerConverter.interceptRequest(request); + Invocation.Builder ib = UpdateLoadBalancerConverter.fromRequest(client, request); + Function transformer = + UpdateLoadBalancerConverter.fromResponse(); + + Consumer onSuccess = new SuccessConsumer<>(handler, transformer, request); + Consumer onError = new ErrorConsumer<>(handler, request); + + Future responseFuture = + client.put(ib, request.getUpdateLoadBalancerDetails(), request, onSuccess, onError); + return new TransformingFuture<>(responseFuture, transformer); + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerClient.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerClient.java new file mode 100644 index 00000000000..d2e8072a4ab --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerClient.java @@ -0,0 +1,478 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer; + +import com.oracle.bmc.ClientConfiguration; +import com.oracle.bmc.auth.*; +import com.oracle.bmc.http.ClientConfigurator; +import com.oracle.bmc.http.internal.*; +import com.oracle.bmc.http.signing.*; +import com.oracle.bmc.http.signing.internal.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.loadbalancer.internal.http.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.oracle.bmc.*; + +import lombok.AccessLevel; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class LoadBalancerClient implements LoadBalancer { + /** + * Service instance for LoadBalancer. + */ + public static final Service SERVICE = Services.create("LOADBALANCER", "iaas"); + + private final ExecutorService executorService = Executors.newFixedThreadPool(50); + private final LoadBalancerWaiters waiters; + + @Getter(value = AccessLevel.PACKAGE) + private final RestClient client; + + /** + * Creates a new service instance using the given authentication provider. + * @param authenticationDetailsProvider The authentication details provider, required. + */ + public LoadBalancerClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider) { + this(authenticationDetailsProvider, null); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + */ + public LoadBalancerClient( + BasicAuthenticationDetailsProvider authenticationDetailsProvider, + ClientConfiguration configuration) { + this(authenticationDetailsProvider, configuration, null); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + */ + public LoadBalancerClient( + BasicAuthenticationDetailsProvider authenticationDetailsProvider, + ClientConfiguration configuration, + ClientConfigurator clientConfigurator) { + this( + authenticationDetailsProvider, + configuration, + clientConfigurator, + new DefaultRequestSignerFactory(SigningStrategy.STANDARD)); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + *

+ * This is an advanced constructor for clients that want to take control over how requests are signed. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + * @param requestSignerFactory The request signer factory used to create the request signer for this service. + */ + public LoadBalancerClient( + AbstractAuthenticationDetailsProvider authenticationDetailsProvider, + ClientConfiguration configuration, + ClientConfigurator clientConfigurator, + RequestSignerFactory requestSignerFactory) { + RestClientFactory restClientFactory = + RestClientFactoryBuilder.builder().clientConfigurator(clientConfigurator).build(); + RequestSigner requestSigner = + requestSignerFactory.createRequestSigner(SERVICE, authenticationDetailsProvider); + this.client = restClientFactory.create(requestSigner, configuration); + + this.waiters = new LoadBalancerWaiters(executorService, this); + } + + @Override + public void setEndpoint(String endpoint) { + LOG.info("Setting endpoint to {}", endpoint); + client.setEndpoint(endpoint); + } + + @Override + public void setRegion(Region region) { + Optional endpoint = region.getEndpoint(SERVICE); + if (endpoint.isPresent()) { + setEndpoint(endpoint.get()); + } else { + throw new IllegalArgumentException( + "Endpoint for " + SERVICE + " is not known in region " + region); + } + } + + @Override + public void setRegion(String regionId) { + regionId = regionId.toLowerCase(); + try { + Region region = Region.fromRegionId(regionId); + setRegion(region); + } catch (IllegalArgumentException e) { + LOG.info("Unknown regionId '{}', falling back to default endpoint format", regionId); + String endpoint = Region.formatDefaultRegionEndpoint(SERVICE, regionId); + setEndpoint(endpoint); + } + } + + @Override + public void close() { + client.close(); + } + + @Override + public CreateBackendResponse createBackend(CreateBackendRequest request) { + LOG.trace("Called createBackend"); + request = CreateBackendConverter.interceptRequest(request); + Invocation.Builder ib = CreateBackendConverter.fromRequest(client, request); + Function transformer = + CreateBackendConverter.fromResponse(); + + Response response = client.post(ib, request.getCreateBackendDetails(), request); + return transformer.apply(response); + } + + @Override + public CreateBackendSetResponse createBackendSet(CreateBackendSetRequest request) { + LOG.trace("Called createBackendSet"); + request = CreateBackendSetConverter.interceptRequest(request); + Invocation.Builder ib = CreateBackendSetConverter.fromRequest(client, request); + Function transformer = + CreateBackendSetConverter.fromResponse(); + + Response response = client.post(ib, request.getCreateBackendSetDetails(), request); + return transformer.apply(response); + } + + @Override + public CreateCertificateResponse createCertificate(CreateCertificateRequest request) { + LOG.trace("Called createCertificate"); + request = CreateCertificateConverter.interceptRequest(request); + Invocation.Builder ib = CreateCertificateConverter.fromRequest(client, request); + Function transformer = + CreateCertificateConverter.fromResponse(); + + Response response = client.post(ib, request.getCreateCertificateDetails(), request); + return transformer.apply(response); + } + + @Override + public CreateListenerResponse createListener(CreateListenerRequest request) { + LOG.trace("Called createListener"); + request = CreateListenerConverter.interceptRequest(request); + Invocation.Builder ib = CreateListenerConverter.fromRequest(client, request); + Function transformer = + CreateListenerConverter.fromResponse(); + + Response response = client.post(ib, request.getCreateListenerDetails(), request); + return transformer.apply(response); + } + + @Override + public CreateLoadBalancerResponse createLoadBalancer(CreateLoadBalancerRequest request) { + LOG.trace("Called createLoadBalancer"); + request = CreateLoadBalancerConverter.interceptRequest(request); + Invocation.Builder ib = CreateLoadBalancerConverter.fromRequest(client, request); + Function transformer = + CreateLoadBalancerConverter.fromResponse(); + + Response response = client.post(ib, request.getCreateLoadBalancerDetails(), request); + return transformer.apply(response); + } + + @Override + public DeleteBackendResponse deleteBackend(DeleteBackendRequest request) { + LOG.trace("Called deleteBackend"); + request = DeleteBackendConverter.interceptRequest(request); + Invocation.Builder ib = DeleteBackendConverter.fromRequest(client, request); + Function transformer = + DeleteBackendConverter.fromResponse(); + + Response response = client.delete(ib, request); + return transformer.apply(response); + } + + @Override + public DeleteBackendSetResponse deleteBackendSet(DeleteBackendSetRequest request) { + LOG.trace("Called deleteBackendSet"); + request = DeleteBackendSetConverter.interceptRequest(request); + Invocation.Builder ib = DeleteBackendSetConverter.fromRequest(client, request); + Function transformer = + DeleteBackendSetConverter.fromResponse(); + + Response response = client.delete(ib, request); + return transformer.apply(response); + } + + @Override + public DeleteCertificateResponse deleteCertificate(DeleteCertificateRequest request) { + LOG.trace("Called deleteCertificate"); + request = DeleteCertificateConverter.interceptRequest(request); + Invocation.Builder ib = DeleteCertificateConverter.fromRequest(client, request); + Function transformer = + DeleteCertificateConverter.fromResponse(); + + Response response = client.delete(ib, request); + return transformer.apply(response); + } + + @Override + public DeleteListenerResponse deleteListener(DeleteListenerRequest request) { + LOG.trace("Called deleteListener"); + request = DeleteListenerConverter.interceptRequest(request); + Invocation.Builder ib = DeleteListenerConverter.fromRequest(client, request); + Function transformer = + DeleteListenerConverter.fromResponse(); + + Response response = client.delete(ib, request); + return transformer.apply(response); + } + + @Override + public DeleteLoadBalancerResponse deleteLoadBalancer(DeleteLoadBalancerRequest request) { + LOG.trace("Called deleteLoadBalancer"); + request = DeleteLoadBalancerConverter.interceptRequest(request); + Invocation.Builder ib = DeleteLoadBalancerConverter.fromRequest(client, request); + Function transformer = + DeleteLoadBalancerConverter.fromResponse(); + + Response response = client.delete(ib, request); + return transformer.apply(response); + } + + @Override + public GetBackendResponse getBackend(GetBackendRequest request) { + LOG.trace("Called getBackend"); + request = GetBackendConverter.interceptRequest(request); + Invocation.Builder ib = GetBackendConverter.fromRequest(client, request); + Function transformer = GetBackendConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public GetBackendSetResponse getBackendSet(GetBackendSetRequest request) { + LOG.trace("Called getBackendSet"); + request = GetBackendSetConverter.interceptRequest(request); + Invocation.Builder ib = GetBackendSetConverter.fromRequest(client, request); + Function transformer = + GetBackendSetConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public GetHealthCheckerResponse getHealthChecker(GetHealthCheckerRequest request) { + LOG.trace("Called getHealthChecker"); + request = GetHealthCheckerConverter.interceptRequest(request); + Invocation.Builder ib = GetHealthCheckerConverter.fromRequest(client, request); + Function transformer = + GetHealthCheckerConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public GetLoadBalancerResponse getLoadBalancer(GetLoadBalancerRequest request) { + LOG.trace("Called getLoadBalancer"); + request = GetLoadBalancerConverter.interceptRequest(request); + Invocation.Builder ib = GetLoadBalancerConverter.fromRequest(client, request); + Function transformer = + GetLoadBalancerConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public GetWorkRequestResponse getWorkRequest(GetWorkRequestRequest request) { + LOG.trace("Called getWorkRequest"); + request = GetWorkRequestConverter.interceptRequest(request); + Invocation.Builder ib = GetWorkRequestConverter.fromRequest(client, request); + Function transformer = + GetWorkRequestConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public ListBackendSetsResponse listBackendSets(ListBackendSetsRequest request) { + LOG.trace("Called listBackendSets"); + request = ListBackendSetsConverter.interceptRequest(request); + Invocation.Builder ib = ListBackendSetsConverter.fromRequest(client, request); + Function transformer = + ListBackendSetsConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public ListBackendsResponse listBackends(ListBackendsRequest request) { + LOG.trace("Called listBackends"); + request = ListBackendsConverter.interceptRequest(request); + Invocation.Builder ib = ListBackendsConverter.fromRequest(client, request); + Function transformer = ListBackendsConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public ListCertificatesResponse listCertificates(ListCertificatesRequest request) { + LOG.trace("Called listCertificates"); + request = ListCertificatesConverter.interceptRequest(request); + Invocation.Builder ib = ListCertificatesConverter.fromRequest(client, request); + Function transformer = + ListCertificatesConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public ListLoadBalancersResponse listLoadBalancers(ListLoadBalancersRequest request) { + LOG.trace("Called listLoadBalancers"); + request = ListLoadBalancersConverter.interceptRequest(request); + Invocation.Builder ib = ListLoadBalancersConverter.fromRequest(client, request); + Function transformer = + ListLoadBalancersConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public ListPoliciesResponse listPolicies(ListPoliciesRequest request) { + LOG.trace("Called listPolicies"); + request = ListPoliciesConverter.interceptRequest(request); + Invocation.Builder ib = ListPoliciesConverter.fromRequest(client, request); + Function transformer = ListPoliciesConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public ListProtocolsResponse listProtocols(ListProtocolsRequest request) { + LOG.trace("Called listProtocols"); + request = ListProtocolsConverter.interceptRequest(request); + Invocation.Builder ib = ListProtocolsConverter.fromRequest(client, request); + Function transformer = + ListProtocolsConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public ListShapesResponse listShapes(ListShapesRequest request) { + LOG.trace("Called listShapes"); + request = ListShapesConverter.interceptRequest(request); + Invocation.Builder ib = ListShapesConverter.fromRequest(client, request); + Function transformer = ListShapesConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public ListWorkRequestsResponse listWorkRequests(ListWorkRequestsRequest request) { + LOG.trace("Called listWorkRequests"); + request = ListWorkRequestsConverter.interceptRequest(request); + Invocation.Builder ib = ListWorkRequestsConverter.fromRequest(client, request); + Function transformer = + ListWorkRequestsConverter.fromResponse(); + + Response response = client.get(ib, request); + return transformer.apply(response); + } + + @Override + public UpdateBackendResponse updateBackend(UpdateBackendRequest request) { + LOG.trace("Called updateBackend"); + request = UpdateBackendConverter.interceptRequest(request); + Invocation.Builder ib = UpdateBackendConverter.fromRequest(client, request); + Function transformer = + UpdateBackendConverter.fromResponse(); + + Response response = client.put(ib, request.getUpdateBackendDetails(), request); + return transformer.apply(response); + } + + @Override + public UpdateBackendSetResponse updateBackendSet(UpdateBackendSetRequest request) { + LOG.trace("Called updateBackendSet"); + request = UpdateBackendSetConverter.interceptRequest(request); + Invocation.Builder ib = UpdateBackendSetConverter.fromRequest(client, request); + Function transformer = + UpdateBackendSetConverter.fromResponse(); + + Response response = client.put(ib, request.getUpdateBackendSetDetails(), request); + return transformer.apply(response); + } + + @Override + public UpdateHealthCheckerResponse updateHealthChecker(UpdateHealthCheckerRequest request) { + LOG.trace("Called updateHealthChecker"); + request = UpdateHealthCheckerConverter.interceptRequest(request); + Invocation.Builder ib = UpdateHealthCheckerConverter.fromRequest(client, request); + Function transformer = + UpdateHealthCheckerConverter.fromResponse(); + + Response response = client.put(ib, request.getHealthChecker(), request); + return transformer.apply(response); + } + + @Override + public UpdateListenerResponse updateListener(UpdateListenerRequest request) { + LOG.trace("Called updateListener"); + request = UpdateListenerConverter.interceptRequest(request); + Invocation.Builder ib = UpdateListenerConverter.fromRequest(client, request); + Function transformer = + UpdateListenerConverter.fromResponse(); + + Response response = client.put(ib, request.getUpdateListenerDetails(), request); + return transformer.apply(response); + } + + @Override + public UpdateLoadBalancerResponse updateLoadBalancer(UpdateLoadBalancerRequest request) { + LOG.trace("Called updateLoadBalancer"); + request = UpdateLoadBalancerConverter.interceptRequest(request); + Invocation.Builder ib = UpdateLoadBalancerConverter.fromRequest(client, request); + Function transformer = + UpdateLoadBalancerConverter.fromResponse(); + + Response response = client.put(ib, request.getUpdateLoadBalancerDetails(), request); + return transformer.apply(response); + } + + @Override + public LoadBalancerWaiters getWaiters() { + return waiters; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerWaiters.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerWaiters.java new file mode 100644 index 00000000000..47520527e03 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerWaiters.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer; + +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.oracle.bmc.waiter.*; +import com.oracle.bmc.waiter.internal.SimpleWaiterImpl; + +import java.util.concurrent.ExecutorService; + +import com.google.common.base.Function; +import com.google.common.base.Predicate; +import com.google.common.base.Suppliers; + +import lombok.RequiredArgsConstructor; + +/** + * Collection of helper methods to produce {@link Waiter}s for different + * resources of LoadBalancer. + *

+ * The default configuration used is defined by {@link Waiters#DEFAULT_POLLING_WAITER}. + */ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@RequiredArgsConstructor +public class LoadBalancerWaiters { + private final ExecutorService executorService; + private final LoadBalancer client; + + /** + * Creates a new {@link Waiter} using default configuration. + * + * @param request The request to send. + * @param targetState The desired state to wait for. + * @return A new Waiter instance. + */ + public Waiter forLoadBalancer( + GetLoadBalancerRequest request, + com.oracle.bmc.loadbalancer.model.LoadBalancer.LifecycleState targetState) { + return forLoadBalancer(Waiters.DEFAULT_POLLING_WAITER, request, targetState); + } + + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request The request to send. + * @param targetState The desired state to wait for. + * @param terminationStrategy The {@link TerminationStrategy} to use. + * @param delayStrategy The {@link DelayStrategy} to use. + * @return A new Waiter instance. + */ + public Waiter forLoadBalancer( + GetLoadBalancerRequest request, + com.oracle.bmc.loadbalancer.model.LoadBalancer.LifecycleState targetState, + TerminationStrategy terminationStrategy, + DelayStrategy delayStrategy) { + return forLoadBalancer( + Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); + } + + // Helper method to create a new Waiter for LoadBalancer. + private Waiter forLoadBalancer( + BmcGenericWaiter waiter, + final GetLoadBalancerRequest request, + final com.oracle.bmc.loadbalancer.model.LoadBalancer.LifecycleState targetState) { + return new SimpleWaiterImpl<>( + executorService, + waiter.toCallable( + Suppliers.ofInstance(request), + new Function() { + @Override + public GetLoadBalancerResponse apply(GetLoadBalancerRequest request) { + return client.getLoadBalancer(request); + } + }, + new Predicate() { + @Override + public boolean apply(GetLoadBalancerResponse response) { + return response.getLoadBalancer().getLifecycleState() + == targetState; + } + }, + targetState + == com.oracle.bmc.loadbalancer.model.LoadBalancer.LifecycleState + .Deleted), + request); + } + + /** + * Creates a new {@link Waiter} using default configuration. + * + * @param request The request to send. + * @return A new Waiter instance. + */ + public Waiter forWorkRequest( + GetWorkRequestRequest request) { + return forWorkRequest(Waiters.DEFAULT_POLLING_WAITER, request); + } + + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request The request to send. + * @param terminationStrategy The {@link TerminationStrategy} to use. + * @param delayStrategy The {@link DelayStrategy} to use. + * @return A new Waiter instance. + */ + public Waiter forWorkRequest( + GetWorkRequestRequest request, + TerminationStrategy terminationStrategy, + DelayStrategy delayStrategy) { + return forWorkRequest(Waiters.newWaiter(terminationStrategy, delayStrategy), request); + } + + // Helper method to create a new Waiter for WorkRequest. + private Waiter forWorkRequest( + BmcGenericWaiter waiter, final GetWorkRequestRequest request) { + return new SimpleWaiterImpl<>( + executorService, + waiter.toCallable( + Suppliers.ofInstance(request), + new Function() { + @Override + public GetWorkRequestResponse apply(GetWorkRequestRequest request) { + return client.getWorkRequest(request); + } + }, + new Predicate() { + @Override + public boolean apply(GetWorkRequestResponse response) { + // work requests are complete once the time finished is available + return response.getWorkRequest().getTimeFinished() != null; + } + }, + false), + request); + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateBackendConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateBackendConverter.java new file mode 100644 index 00000000000..69fdf95a469 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateBackendConverter.java @@ -0,0 +1,120 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class CreateBackendConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static CreateBackendRequest interceptRequest(CreateBackendRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest(RestClient client, CreateBackendRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getCreateBackendDetails() == null) { + throw new NullPointerException("createBackendDetails is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + if (request.getBackendSetName() == null) { + throw new NullPointerException("backendSetName is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("backendSets") + .path(encodePathSegment(request.getBackendSetName())) + .path("backends"); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public CreateBackendResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for CreateBackendResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + CreateBackendResponse.Builder builder = CreateBackendResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + CreateBackendResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateBackendSetConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateBackendSetConverter.java new file mode 100644 index 00000000000..fb9b1b6a6b7 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateBackendSetConverter.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class CreateBackendSetConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static CreateBackendSetRequest interceptRequest(CreateBackendSetRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, CreateBackendSetRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getCreateBackendSetDetails() == null) { + throw new NullPointerException("createBackendSetDetails is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("backendSets"); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public CreateBackendSetResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for CreateBackendSetResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + CreateBackendSetResponse.Builder builder = + CreateBackendSetResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + CreateBackendSetResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateCertificateConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateCertificateConverter.java new file mode 100644 index 00000000000..516962af69f --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateCertificateConverter.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class CreateCertificateConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static CreateCertificateRequest interceptRequest(CreateCertificateRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, CreateCertificateRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getCreateCertificateDetails() == null) { + throw new NullPointerException("createCertificateDetails is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("certificates"); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public CreateCertificateResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for CreateCertificateResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + CreateCertificateResponse.Builder builder = + CreateCertificateResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + CreateCertificateResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateListenerConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateListenerConverter.java new file mode 100644 index 00000000000..4dcf8a718ef --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateListenerConverter.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class CreateListenerConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static CreateListenerRequest interceptRequest(CreateListenerRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest(RestClient client, CreateListenerRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getCreateListenerDetails() == null) { + throw new NullPointerException("createListenerDetails is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("listeners"); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public CreateListenerResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for CreateListenerResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + CreateListenerResponse.Builder builder = CreateListenerResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + CreateListenerResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateLoadBalancerConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateLoadBalancerConverter.java new file mode 100644 index 00000000000..30d94e0df51 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateLoadBalancerConverter.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class CreateLoadBalancerConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static CreateLoadBalancerRequest interceptRequest(CreateLoadBalancerRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, CreateLoadBalancerRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getCreateLoadBalancerDetails() == null) { + throw new NullPointerException("createLoadBalancerDetails is required"); + } + + WebTarget target = client.getBaseTarget().path("/20170115").path("loadBalancers"); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public CreateLoadBalancerResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for CreateLoadBalancerResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + CreateLoadBalancerResponse.Builder builder = + CreateLoadBalancerResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + CreateLoadBalancerResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteBackendConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteBackendConverter.java new file mode 100644 index 00000000000..a2b271c929b --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteBackendConverter.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class DeleteBackendConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static DeleteBackendRequest interceptRequest(DeleteBackendRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest(RestClient client, DeleteBackendRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + if (request.getBackendSetName() == null) { + throw new NullPointerException("backendSetName is required"); + } + + if (request.getBackendName() == null) { + throw new NullPointerException("backendName is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("backendSets") + .path(encodePathSegment(request.getBackendSetName())) + .path("backends") + .path(encodePathSegment(request.getBackendName())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public DeleteBackendResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for DeleteBackendResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + DeleteBackendResponse.Builder builder = DeleteBackendResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + DeleteBackendResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteBackendSetConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteBackendSetConverter.java new file mode 100644 index 00000000000..671c6b47bb6 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteBackendSetConverter.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class DeleteBackendSetConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static DeleteBackendSetRequest interceptRequest(DeleteBackendSetRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, DeleteBackendSetRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + if (request.getBackendSetName() == null) { + throw new NullPointerException("backendSetName is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("backendSets") + .path(encodePathSegment(request.getBackendSetName())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public DeleteBackendSetResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for DeleteBackendSetResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + DeleteBackendSetResponse.Builder builder = + DeleteBackendSetResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + DeleteBackendSetResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteCertificateConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteCertificateConverter.java new file mode 100644 index 00000000000..8f94e29e0af --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteCertificateConverter.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class DeleteCertificateConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static DeleteCertificateRequest interceptRequest(DeleteCertificateRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, DeleteCertificateRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + if (request.getCertificateName() == null) { + throw new NullPointerException("certificateName is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("certificates") + .path(encodePathSegment(request.getCertificateName())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public DeleteCertificateResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for DeleteCertificateResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + DeleteCertificateResponse.Builder builder = + DeleteCertificateResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + DeleteCertificateResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteListenerConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteListenerConverter.java new file mode 100644 index 00000000000..619e7b191c4 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteListenerConverter.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class DeleteListenerConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static DeleteListenerRequest interceptRequest(DeleteListenerRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest(RestClient client, DeleteListenerRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + if (request.getListenerName() == null) { + throw new NullPointerException("listenerName is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("listeners") + .path(encodePathSegment(request.getListenerName())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public DeleteListenerResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for DeleteListenerResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + DeleteListenerResponse.Builder builder = DeleteListenerResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + DeleteListenerResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteLoadBalancerConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteLoadBalancerConverter.java new file mode 100644 index 00000000000..9d26b398b7e --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteLoadBalancerConverter.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class DeleteLoadBalancerConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static DeleteLoadBalancerRequest interceptRequest(DeleteLoadBalancerRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, DeleteLoadBalancerRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public DeleteLoadBalancerResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for DeleteLoadBalancerResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + DeleteLoadBalancerResponse.Builder builder = + DeleteLoadBalancerResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + DeleteLoadBalancerResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetBackendConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetBackendConverter.java new file mode 100644 index 00000000000..8f2d1cacf1d --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetBackendConverter.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class GetBackendConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static GetBackendRequest interceptRequest(GetBackendRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest(RestClient client, GetBackendRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + if (request.getBackendSetName() == null) { + throw new NullPointerException("backendSetName is required"); + } + + if (request.getBackendName() == null) { + throw new NullPointerException("backendName is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("backendSets") + .path(encodePathSegment(request.getBackendSetName())) + .path("backends") + .path(encodePathSegment(request.getBackendName())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public GetBackendResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for GetBackendResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(Backend.class); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + GetBackendResponse.Builder builder = GetBackendResponse.builder(); + + builder.backend(response.getItem()); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + GetBackendResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetBackendSetConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetBackendSetConverter.java new file mode 100644 index 00000000000..9d30b5bfb41 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetBackendSetConverter.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class GetBackendSetConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static GetBackendSetRequest interceptRequest(GetBackendSetRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest(RestClient client, GetBackendSetRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + if (request.getBackendSetName() == null) { + throw new NullPointerException("backendSetName is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("backendSets") + .path(encodePathSegment(request.getBackendSetName())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public GetBackendSetResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for GetBackendSetResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(BackendSet.class); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + GetBackendSetResponse.Builder builder = GetBackendSetResponse.builder(); + + builder.backendSet(response.getItem()); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + GetBackendSetResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetHealthCheckerConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetHealthCheckerConverter.java new file mode 100644 index 00000000000..9350aad4499 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetHealthCheckerConverter.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class GetHealthCheckerConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static GetHealthCheckerRequest interceptRequest(GetHealthCheckerRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, GetHealthCheckerRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + if (request.getBackendSetName() == null) { + throw new NullPointerException("backendSetName is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("backendSets") + .path(encodePathSegment(request.getBackendSetName())) + .path("healthChecker"); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public GetHealthCheckerResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for GetHealthCheckerResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(HealthChecker.class); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + GetHealthCheckerResponse.Builder builder = + GetHealthCheckerResponse.builder(); + + builder.healthChecker(response.getItem()); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + GetHealthCheckerResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetLoadBalancerConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetLoadBalancerConverter.java new file mode 100644 index 00000000000..5e515761d2d --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetLoadBalancerConverter.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class GetLoadBalancerConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static GetLoadBalancerRequest interceptRequest(GetLoadBalancerRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, GetLoadBalancerRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public GetLoadBalancerResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for GetLoadBalancerResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(LoadBalancer.class); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + GetLoadBalancerResponse.Builder builder = GetLoadBalancerResponse.builder(); + + builder.loadBalancer(response.getItem()); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + GetLoadBalancerResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetWorkRequestConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetWorkRequestConverter.java new file mode 100644 index 00000000000..4ebc2f6c3fd --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetWorkRequestConverter.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class GetWorkRequestConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static GetWorkRequestRequest interceptRequest(GetWorkRequestRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest(RestClient client, GetWorkRequestRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getWorkRequestId() == null) { + throw new NullPointerException("workRequestId is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancerWorkRequests") + .path(encodePathSegment(request.getWorkRequestId())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public GetWorkRequestResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for GetWorkRequestResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(WorkRequest.class); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + GetWorkRequestResponse.Builder builder = GetWorkRequestResponse.builder(); + + builder.workRequest(response.getItem()); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + GetWorkRequestResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListBackendSetsConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListBackendSetsConverter.java new file mode 100644 index 00000000000..61638102f21 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListBackendSetsConverter.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class ListBackendSetsConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static ListBackendSetsRequest interceptRequest(ListBackendSetsRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, ListBackendSetsRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("backendSets"); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public ListBackendSetsResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for ListBackendSetsResponse"); + Function>> responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new GenericType>() {}); + + WithHeaders> response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + ListBackendSetsResponse.Builder builder = ListBackendSetsResponse.builder(); + + builder.items(response.getItem()); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListBackendSetsResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListBackendsConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListBackendsConverter.java new file mode 100644 index 00000000000..050b4e1b3cb --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListBackendsConverter.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class ListBackendsConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static ListBackendsRequest interceptRequest(ListBackendsRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest(RestClient client, ListBackendsRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + if (request.getBackendSetName() == null) { + throw new NullPointerException("backendSetName is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("backendSets") + .path(encodePathSegment(request.getBackendSetName())) + .path("backends"); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public ListBackendsResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for ListBackendsResponse"); + Function>> responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new GenericType>() {}); + + WithHeaders> response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + ListBackendsResponse.Builder builder = ListBackendsResponse.builder(); + + builder.items(response.getItem()); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListBackendsResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListCertificatesConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListCertificatesConverter.java new file mode 100644 index 00000000000..8c69303c381 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListCertificatesConverter.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class ListCertificatesConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static ListCertificatesRequest interceptRequest(ListCertificatesRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, ListCertificatesRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("certificates"); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public ListCertificatesResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for ListCertificatesResponse"); + Function>> responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new GenericType>() {}); + + WithHeaders> response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + ListCertificatesResponse.Builder builder = + ListCertificatesResponse.builder(); + + builder.items(response.getItem()); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListCertificatesResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListLoadBalancersConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListLoadBalancersConverter.java new file mode 100644 index 00000000000..d523351157e --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListLoadBalancersConverter.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class ListLoadBalancersConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static ListLoadBalancersRequest interceptRequest(ListLoadBalancersRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, ListLoadBalancersRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getCompartmentId() == null) { + throw new NullPointerException("compartmentId is required"); + } + + WebTarget target = client.getBaseTarget().path("/20170115").path("loadBalancers"); + + if (request.getLimit() != null) { + target = target.queryParam("limit", attemptEncodeQueryParam(request.getLimit())); + } + + if (request.getPage() != null) { + target = target.queryParam("page", attemptEncodeQueryParam(request.getPage())); + } + + target = + target.queryParam( + "compartmentId", attemptEncodeQueryParam(request.getCompartmentId())); + + if (request.getDetail() != null) { + target = target.queryParam("detail", attemptEncodeQueryParam(request.getDetail())); + } + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public ListLoadBalancersResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for ListLoadBalancersResponse"); + Function>> responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new GenericType>() {}); + + WithHeaders> response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + ListLoadBalancersResponse.Builder builder = + ListLoadBalancersResponse.builder(); + + builder.items(response.getItem()); + + Optional> opcNextPageHeader = + HeaderUtils.get(headers, "opc-next-page"); + if (opcNextPageHeader.isPresent()) { + builder.opcNextPage( + HeaderUtils.toValue( + "opc-next-page", + opcNextPageHeader.get().get(0), + String.class)); + } + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListLoadBalancersResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListPoliciesConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListPoliciesConverter.java new file mode 100644 index 00000000000..7a69b8776a0 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListPoliciesConverter.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class ListPoliciesConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static ListPoliciesRequest interceptRequest(ListPoliciesRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest(RestClient client, ListPoliciesRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getCompartmentId() == null) { + throw new NullPointerException("compartmentId is required"); + } + + WebTarget target = client.getBaseTarget().path("/20170115").path("loadBalancerPolicies"); + + target = + target.queryParam( + "compartmentId", attemptEncodeQueryParam(request.getCompartmentId())); + + if (request.getLimit() != null) { + target = target.queryParam("limit", attemptEncodeQueryParam(request.getLimit())); + } + + if (request.getPage() != null) { + target = target.queryParam("page", attemptEncodeQueryParam(request.getPage())); + } + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public ListPoliciesResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for ListPoliciesResponse"); + Function>> responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new GenericType>() {}); + + WithHeaders> response = + responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + ListPoliciesResponse.Builder builder = ListPoliciesResponse.builder(); + + builder.items(response.getItem()); + + Optional> opcNextPageHeader = + HeaderUtils.get(headers, "opc-next-page"); + if (opcNextPageHeader.isPresent()) { + builder.opcNextPage( + HeaderUtils.toValue( + "opc-next-page", + opcNextPageHeader.get().get(0), + String.class)); + } + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListPoliciesResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListProtocolsConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListProtocolsConverter.java new file mode 100644 index 00000000000..f5d3c4acd6a --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListProtocolsConverter.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class ListProtocolsConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static ListProtocolsRequest interceptRequest(ListProtocolsRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest(RestClient client, ListProtocolsRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getCompartmentId() == null) { + throw new NullPointerException("compartmentId is required"); + } + + WebTarget target = client.getBaseTarget().path("/20170115").path("loadBalancerProtocols"); + + target = + target.queryParam( + "compartmentId", attemptEncodeQueryParam(request.getCompartmentId())); + + if (request.getLimit() != null) { + target = target.queryParam("limit", attemptEncodeQueryParam(request.getLimit())); + } + + if (request.getPage() != null) { + target = target.queryParam("page", attemptEncodeQueryParam(request.getPage())); + } + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public ListProtocolsResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for ListProtocolsResponse"); + Function>> responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new GenericType>() {}); + + WithHeaders> response = + responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + ListProtocolsResponse.Builder builder = ListProtocolsResponse.builder(); + + builder.items(response.getItem()); + + Optional> opcNextPageHeader = + HeaderUtils.get(headers, "opc-next-page"); + if (opcNextPageHeader.isPresent()) { + builder.opcNextPage( + HeaderUtils.toValue( + "opc-next-page", + opcNextPageHeader.get().get(0), + String.class)); + } + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListProtocolsResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListShapesConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListShapesConverter.java new file mode 100644 index 00000000000..ad743052d44 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListShapesConverter.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class ListShapesConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static ListShapesRequest interceptRequest(ListShapesRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest(RestClient client, ListShapesRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getCompartmentId() == null) { + throw new NullPointerException("compartmentId is required"); + } + + WebTarget target = client.getBaseTarget().path("/20170115").path("loadBalancerShapes"); + + target = + target.queryParam( + "compartmentId", attemptEncodeQueryParam(request.getCompartmentId())); + + if (request.getLimit() != null) { + target = target.queryParam("limit", attemptEncodeQueryParam(request.getLimit())); + } + + if (request.getPage() != null) { + target = target.queryParam("page", attemptEncodeQueryParam(request.getPage())); + } + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public ListShapesResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for ListShapesResponse"); + Function>> responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new GenericType>() {}); + + WithHeaders> response = + responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + ListShapesResponse.Builder builder = ListShapesResponse.builder(); + + builder.items(response.getItem()); + + Optional> opcNextPageHeader = + HeaderUtils.get(headers, "opc-next-page"); + if (opcNextPageHeader.isPresent()) { + builder.opcNextPage( + HeaderUtils.toValue( + "opc-next-page", + opcNextPageHeader.get().get(0), + String.class)); + } + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListShapesResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListWorkRequestsConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListWorkRequestsConverter.java new file mode 100644 index 00000000000..ae6a5c337c2 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListWorkRequestsConverter.java @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class ListWorkRequestsConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static ListWorkRequestsRequest interceptRequest(ListWorkRequestsRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, ListWorkRequestsRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("workRequests"); + + if (request.getLimit() != null) { + target = target.queryParam("limit", attemptEncodeQueryParam(request.getLimit())); + } + + if (request.getPage() != null) { + target = target.queryParam("page", attemptEncodeQueryParam(request.getPage())); + } + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public ListWorkRequestsResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for ListWorkRequestsResponse"); + Function>> responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new GenericType>() {}); + + WithHeaders> response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + ListWorkRequestsResponse.Builder builder = + ListWorkRequestsResponse.builder(); + + builder.items(response.getItem()); + + Optional> opcNextPageHeader = + HeaderUtils.get(headers, "opc-next-page"); + if (opcNextPageHeader.isPresent()) { + builder.opcNextPage( + HeaderUtils.toValue( + "opc-next-page", + opcNextPageHeader.get().get(0), + String.class)); + } + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListWorkRequestsResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateBackendConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateBackendConverter.java new file mode 100644 index 00000000000..2fb082c7600 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateBackendConverter.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class UpdateBackendConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static UpdateBackendRequest interceptRequest(UpdateBackendRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest(RestClient client, UpdateBackendRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getUpdateBackendDetails() == null) { + throw new NullPointerException("updateBackendDetails is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + if (request.getBackendSetName() == null) { + throw new NullPointerException("backendSetName is required"); + } + + if (request.getBackendName() == null) { + throw new NullPointerException("backendName is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("backendSets") + .path(encodePathSegment(request.getBackendSetName())) + .path("backends") + .path(encodePathSegment(request.getBackendName())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public UpdateBackendResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for UpdateBackendResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + UpdateBackendResponse.Builder builder = UpdateBackendResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + UpdateBackendResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateBackendSetConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateBackendSetConverter.java new file mode 100644 index 00000000000..7036abdae16 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateBackendSetConverter.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class UpdateBackendSetConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static UpdateBackendSetRequest interceptRequest(UpdateBackendSetRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, UpdateBackendSetRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getUpdateBackendSetDetails() == null) { + throw new NullPointerException("updateBackendSetDetails is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + if (request.getBackendSetName() == null) { + throw new NullPointerException("backendSetName is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("backendSets") + .path(encodePathSegment(request.getBackendSetName())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public UpdateBackendSetResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for UpdateBackendSetResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + UpdateBackendSetResponse.Builder builder = + UpdateBackendSetResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + UpdateBackendSetResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateHealthCheckerConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateHealthCheckerConverter.java new file mode 100644 index 00000000000..c3491e5c2bc --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateHealthCheckerConverter.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class UpdateHealthCheckerConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static UpdateHealthCheckerRequest interceptRequest(UpdateHealthCheckerRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, UpdateHealthCheckerRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getHealthChecker() == null) { + throw new NullPointerException("healthChecker is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + if (request.getBackendSetName() == null) { + throw new NullPointerException("backendSetName is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("backendSets") + .path(encodePathSegment(request.getBackendSetName())) + .path("healthChecker"); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public UpdateHealthCheckerResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for UpdateHealthCheckerResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + UpdateHealthCheckerResponse.Builder builder = + UpdateHealthCheckerResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + UpdateHealthCheckerResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateListenerConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateListenerConverter.java new file mode 100644 index 00000000000..2c08d2a2383 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateListenerConverter.java @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class UpdateListenerConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static UpdateListenerRequest interceptRequest(UpdateListenerRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest(RestClient client, UpdateListenerRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getUpdateListenerDetails() == null) { + throw new NullPointerException("updateListenerDetails is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + if (request.getListenerName() == null) { + throw new NullPointerException("listenerName is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())) + .path("listeners") + .path(encodePathSegment(request.getListenerName())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public UpdateListenerResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for UpdateListenerResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + UpdateListenerResponse.Builder builder = UpdateListenerResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + UpdateListenerResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateLoadBalancerConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateLoadBalancerConverter.java new file mode 100644 index 00000000000..c477a0dfda6 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateLoadBalancerConverter.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.ws.rs.client.*; +import javax.ws.rs.core.*; + +import com.oracle.bmc.http.internal.*; +import static com.oracle.bmc.util.internal.HttpUtils.*; +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; + +import com.google.common.base.Function; +import com.google.common.base.Optional; + +import lombok.extern.slf4j.Slf4j; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Slf4j +public class UpdateLoadBalancerConverter { + private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY = + new ResponseConversionFunctionFactory(); + + public static UpdateLoadBalancerRequest interceptRequest(UpdateLoadBalancerRequest request) { + + return request; + } + + public static Invocation.Builder fromRequest( + RestClient client, UpdateLoadBalancerRequest request) { + if (request == null) { + throw new NullPointerException("request instance is required"); + } + + if (request.getUpdateLoadBalancerDetails() == null) { + throw new NullPointerException("updateLoadBalancerDetails is required"); + } + + if (request.getLoadBalancerId() == null) { + throw new NullPointerException("loadBalancerId is required"); + } + + WebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path(encodePathSegment(request.getLoadBalancerId())); + + Invocation.Builder ib = target.request(); + + ib.accept(MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + return ib; + } + + public static Function fromResponse() { + final Function transformer = + new Function() { + @Override + public UpdateLoadBalancerResponse apply(Response rawResponse) { + LOG.trace("Transform function invoked for UpdateLoadBalancerResponse"); + Function> responseFn = + RESPONSE_CONVERSION_FACTORY.create(); + + WithHeaders response = responseFn.apply(rawResponse); + MultivaluedMap headers = response.getHeaders(); + + UpdateLoadBalancerResponse.Builder builder = + UpdateLoadBalancerResponse.builder(); + + Optional> opcRequestIdHeader = + HeaderUtils.get(headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + Optional> opcWorkRequestIdHeader = + HeaderUtils.get(headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + UpdateLoadBalancerResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Backend.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Backend.java new file mode 100644 index 00000000000..df4a53f82d2 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Backend.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The configuration of a backend server that is a member of a load balancer backend set. + * For more information, see [Managing Backend Servers](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingbackendservers.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = Backend.Builder.class) +public class Backend { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("backup") + private Boolean backup; + + @JsonProperty("drain") + private Boolean drain; + + @JsonProperty("ipAddress") + private String ipAddress; + + @JsonProperty("name") + private String name; + + @JsonProperty("offline") + private Boolean offline; + + @JsonProperty("port") + private Integer port; + + @JsonProperty("weight") + private Integer weight; + + public Backend build() { + return new Backend(backup, drain, ipAddress, name, offline, port, weight); + } + + @JsonIgnore + public Builder copy(Backend o) { + return backup(o.getBackup()) + .drain(o.getDrain()) + .ipAddress(o.getIpAddress()) + .name(o.getName()) + .offline(o.getOffline()) + .port(o.getPort()) + .weight(o.getWeight()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress + * traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy. + *

+ * Example: `true` + * + **/ + @JsonProperty("backup") + @Valid + @NotNull + Boolean backup; + + /** + * Whether the load balancer should drain this server. Servers marked \"drain\" receive no new + * incoming traffic. + *

+ * Example: `true` + * + **/ + @JsonProperty("drain") + @Valid + @NotNull + Boolean drain; + + /** + * The IP address of the backend server. + *

+ * Example: `10.10.10.4` + * + **/ + @JsonProperty("ipAddress") + @Valid + @NotNull + String ipAddress; + + /** + * A name to uniquely identify this backend server in the backend set. + *

+ * Example: `My first backend server` + * + **/ + @JsonProperty("name") + @Valid + @NotNull + String name; + + /** + * Whether the load balancer should treat this server as offline. Offline servers receive no incoming + * traffic. + *

+ * Example: `true` + * + **/ + @JsonProperty("offline") + @Valid + @NotNull + Boolean offline; + + /** + * The communication port for the backend server. + *

+ * Example: `8080` + * + **/ + @JsonProperty("port") + @Valid + @NotNull + Integer port; + + /** + * The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger + * proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections + * as a server weighted '1'. + * For more information on load balancing policies, see + * [How Load Balancing Policies Work](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm). + *

+ * Example: `3` + * + **/ + @JsonProperty("weight") + @Valid + @NotNull + Integer weight; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendDetails.java new file mode 100644 index 00000000000..9c2c01136f2 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendDetails.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The load balancing configuration details of a backend server. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = BackendDetails.Builder.class) +public class BackendDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("backup") + private Boolean backup; + + @JsonProperty("drain") + private Boolean drain; + + @JsonProperty("ipAddress") + private String ipAddress; + + @JsonProperty("offline") + private Boolean offline; + + @JsonProperty("port") + private Integer port; + + @JsonProperty("weight") + private Integer weight; + + public BackendDetails build() { + return new BackendDetails(backup, drain, ipAddress, offline, port, weight); + } + + @JsonIgnore + public Builder copy(BackendDetails o) { + return backup(o.getBackup()) + .drain(o.getDrain()) + .ipAddress(o.getIpAddress()) + .offline(o.getOffline()) + .port(o.getPort()) + .weight(o.getWeight()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress + * traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy. + *

+ * Example: `true` + * + **/ + @JsonProperty("backup") + Boolean backup; + + /** + * Whether the load balancer should drain this server. Servers marked \"drain\" receive no new + * incoming traffic. + *

+ * Example: `true` + * + **/ + @JsonProperty("drain") + Boolean drain; + + /** + * The IP address of the backend server. + *

+ * Example: `10.10.10.4` + * + **/ + @JsonProperty("ipAddress") + @Valid + @NotNull + String ipAddress; + + /** + * Whether the load balancer should treat this server as offline. Offline servers receive no incoming + * traffic. + *

+ * Example: `true` + * + **/ + @JsonProperty("offline") + Boolean offline; + + /** + * The communication port for the backend server. + *

+ * Example: `8080` + * + **/ + @JsonProperty("port") + @Valid + @NotNull + @Min(1) + @Max(65535) + Integer port; + + /** + * The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger + * proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections + * as a server weighted '1'. + * For more information on load balancing policies, see + * [How Load Balancing Policies Work](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm). + *

+ * Example: `3` + * + **/ + @JsonProperty("weight") + Integer weight; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSet.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSet.java new file mode 100644 index 00000000000..edfefb82ba4 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSet.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The configuration of a load balancer backend set. + * For more information on backend set configuration, see + * [Managing Backend Sets](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managingbackendsets.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = BackendSet.Builder.class) +public class BackendSet { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("backends") + private List backends; + + @JsonProperty("healthChecker") + private HealthChecker healthChecker; + + @JsonProperty("name") + private String name; + + @JsonProperty("policy") + private String policy; + + @JsonProperty("sslConfiguration") + private SSLConfiguration sslConfiguration; + + public BackendSet build() { + return new BackendSet(backends, healthChecker, name, policy, sslConfiguration); + } + + @JsonIgnore + public Builder copy(BackendSet o) { + return backends(o.getBackends()) + .healthChecker(o.getHealthChecker()) + .name(o.getName()) + .policy(o.getPolicy()) + .sslConfiguration(o.getSslConfiguration()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + @JsonProperty("backends") + @Valid + @NotNull + List backends; + + @JsonProperty("healthChecker") + @Valid + @NotNull + HealthChecker healthChecker; + + /** + * A friendly name for the backend set. It must be unique and it cannot be changed. + *

+ * Example: `My backend set` + * + **/ + @JsonProperty("name") + @Valid + @NotNull + String name; + + /** + * The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN' + * To get a list of available policies, use the {@link #listPolicies(ListPoliciesRequest) listPolicies} + * operation. + *

+ * Example: `LEAST_CONNECTIONS` + * + **/ + @JsonProperty("policy") + @Valid + @NotNull + String policy; + + @JsonProperty("sslConfiguration") + SSLConfiguration sslConfiguration; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSetDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSetDetails.java new file mode 100644 index 00000000000..1e6027f5d2c --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSetDetails.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The configuration details for a load balancer backend set. + * For more information on backend set configuration, see + * [Managing Backend Sets](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managingbackendsets.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = BackendSetDetails.Builder.class) +public class BackendSetDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("backends") + private List backends; + + @JsonProperty("healthChecker") + private HealthCheckerDetails healthChecker; + + @JsonProperty("policy") + private String policy; + + @JsonProperty("sslConfiguration") + private SSLConfigurationDetails sslConfiguration; + + public BackendSetDetails build() { + return new BackendSetDetails(backends, healthChecker, policy, sslConfiguration); + } + + @JsonIgnore + public Builder copy(BackendSetDetails o) { + return backends(o.getBackends()) + .healthChecker(o.getHealthChecker()) + .policy(o.getPolicy()) + .sslConfiguration(o.getSslConfiguration()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + @JsonProperty("backends") + List backends; + + @JsonProperty("healthChecker") + @Valid + @NotNull + HealthCheckerDetails healthChecker; + + /** + * The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN' + * To get a list of available policies, use the {@link #listPolicies(ListPoliciesRequest) listPolicies} + * operation. + *

+ * Example: `LEAST_CONNECTIONS` + * + **/ + @JsonProperty("policy") + @Valid + @NotNull + String policy; + + @JsonProperty("sslConfiguration") + SSLConfigurationDetails sslConfiguration; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Certificate.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Certificate.java new file mode 100644 index 00000000000..bcf9e3525c6 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Certificate.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The configuration details of a listener certificate bundle. + * For more information on SSL certficate configuration, see + * [Managing SSL Certificates](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingcertificates.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = Certificate.Builder.class) +public class Certificate { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("caCertificate") + private String caCertificate; + + @JsonProperty("certificateName") + private String certificateName; + + @JsonProperty("publicCertificate") + private String publicCertificate; + + public Certificate build() { + return new Certificate(caCertificate, certificateName, publicCertificate); + } + + @JsonIgnore + public Builder copy(Certificate o) { + return caCertificate(o.getCaCertificate()) + .certificateName(o.getCertificateName()) + .publicCertificate(o.getPublicCertificate()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. + *

+ * Example: + *

+ * -----BEGIN CERTIFICATE----- + * MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix + * EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD + * VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y + * aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy + * ... + * -----END CERTIFICATE----- + * + **/ + @JsonProperty("caCertificate") + @Valid + @NotNull + String caCertificate; + + /** + * A friendly name for the certificate bundle. It must be unique and it cannot be changed. + *

+ * Example: `My certificate bundle` + * + **/ + @JsonProperty("certificateName") + @Valid + @NotNull + String certificateName; + + /** + * The public certificate, in PEM format, that you received from your SSL certificate provider. + *

+ * Example: + *

+ * -----BEGIN CERTIFICATE----- + * MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG + * A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNERE + * MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdl + * YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIw + * ... + * -----END CERTIFICATE----- + * + **/ + @JsonProperty("publicCertificate") + @Valid + @NotNull + String publicCertificate; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CertificateDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CertificateDetails.java new file mode 100644 index 00000000000..1dae0b715cd --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CertificateDetails.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The configuration details for a listener certificate bundle. + * For more information on SSL certficate configuration, see + * [Managing SSL Certificates](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingcertificates.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = CertificateDetails.Builder.class) +public class CertificateDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("caCertificate") + private String caCertificate; + + @JsonProperty("certificateName") + private String certificateName; + + @JsonProperty("passphrase") + private String passphrase; + + @JsonProperty("privateKey") + private String privateKey; + + @JsonProperty("publicCertificate") + private String publicCertificate; + + public CertificateDetails build() { + return new CertificateDetails( + caCertificate, certificateName, passphrase, privateKey, publicCertificate); + } + + @JsonIgnore + public Builder copy(CertificateDetails o) { + return caCertificate(o.getCaCertificate()) + .certificateName(o.getCertificateName()) + .passphrase(o.getPassphrase()) + .privateKey(o.getPrivateKey()) + .publicCertificate(o.getPublicCertificate()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. + *

+ * Example: + *

+ * -----BEGIN CERTIFICATE----- + * MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix + * EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD + * VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y + * aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy + * ... + * -----END CERTIFICATE----- + * + **/ + @JsonProperty("caCertificate") + String caCertificate; + + /** + * A friendly name for the certificate bundle. It must be unique and it cannot be changed. + *

+ * Example: `My certificate bundle` + * + **/ + @JsonProperty("certificateName") + @Valid + @NotNull + String certificateName; + + /** + * A passphrase for encrypted private keys. This is needed only if you created your certificate with a passphrase. + *

+ * Example: `Mysecretunlockingcode42!1!` + * + **/ + @JsonProperty("passphrase") + String passphrase; + + /** + * The SSL private key for your certificate, in PEM format. + *

+ * Example: + *

+ * -----BEGIN RSA PRIVATE KEY----- + * jO1O1v2ftXMsawM90tnXwc6xhOAT1gDBC9S8DKeca..JZNUgYYwNS0dP2UK + * tmyN+XqVcAKw4HqVmChXy5b5msu8eIq3uc2NqNVtR..2ksSLukP8pxXcHyb + * +sEwvM4uf8qbnHAqwnOnP9+KV9vds6BaH1eRA4CHz..n+NVZlzBsTxTlS16 + * /Umr7wJzVrMqK5sDiSu4WuaaBdqMGfL5hLsTjcBFD..Da2iyQmSKuVD4lIZ + * ... + * -----END RSA PRIVATE KEY----- + * + **/ + @JsonProperty("privateKey") + String privateKey; + + /** + * The public certificate, in PEM format, that you received from your SSL certificate provider. + *

+ * Example: + *

+ * -----BEGIN CERTIFICATE----- + * MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG + * A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNERE + * MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdl + * YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIw + * ... + * -----END CERTIFICATE----- + * + **/ + @JsonProperty("publicCertificate") + String publicCertificate; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendDetails.java new file mode 100644 index 00000000000..beb5ba6403d --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendDetails.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The configuration details for creating a backend server in a backend set. + * For more information on backend server configuration, see + * [Managing Backend Servers](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managingbackendservers.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = CreateBackendDetails.Builder.class) +public class CreateBackendDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("backup") + private Boolean backup; + + @JsonProperty("drain") + private Boolean drain; + + @JsonProperty("ipAddress") + private String ipAddress; + + @JsonProperty("offline") + private Boolean offline; + + @JsonProperty("port") + private Integer port; + + @JsonProperty("weight") + private Integer weight; + + public CreateBackendDetails build() { + return new CreateBackendDetails(backup, drain, ipAddress, offline, port, weight); + } + + @JsonIgnore + public Builder copy(CreateBackendDetails o) { + return backup(o.getBackup()) + .drain(o.getDrain()) + .ipAddress(o.getIpAddress()) + .offline(o.getOffline()) + .port(o.getPort()) + .weight(o.getWeight()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress + * traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy. + *

+ * Example: `true` + * + **/ + @JsonProperty("backup") + Boolean backup; + + /** + * Whether the load balancer should drain this server. Servers marked \"drain\" receive no new + * incoming traffic. + *

+ * Example: `true` + * + **/ + @JsonProperty("drain") + Boolean drain; + + /** + * The IP address of the backend server. + *

+ * Example: `10.10.10.4` + * + **/ + @JsonProperty("ipAddress") + @Valid + @NotNull + String ipAddress; + + /** + * Whether the load balancer should treat this server as offline. Offline servers receive no incoming + * traffic. + *

+ * Example: `true` + * + **/ + @JsonProperty("offline") + Boolean offline; + + /** + * The communication port for the backend server. + *

+ * Example: `8080` + * + **/ + @JsonProperty("port") + @Valid + @NotNull + @Min(1) + @Max(65535) + Integer port; + + /** + * The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger + * proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections + * as a server weighted '1'. + * For more information on load balancing policies, see + * [How Load Balancing Policies Work](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm). + *

+ * Example: `3` + * + **/ + @JsonProperty("weight") + Integer weight; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendSetDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendSetDetails.java new file mode 100644 index 00000000000..dcec4a05abc --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendSetDetails.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The configuration details for creating a backend set in a load balancer. + * For more information on backend set configuration, see + * [Managing Backend Sets](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managingbackendsets.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = CreateBackendSetDetails.Builder.class) +public class CreateBackendSetDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("backends") + private List backends; + + @JsonProperty("healthChecker") + private HealthCheckerDetails healthChecker; + + @JsonProperty("name") + private String name; + + @JsonProperty("policy") + private String policy; + + @JsonProperty("sslConfiguration") + private SSLConfigurationDetails sslConfiguration; + + public CreateBackendSetDetails build() { + return new CreateBackendSetDetails( + backends, healthChecker, name, policy, sslConfiguration); + } + + @JsonIgnore + public Builder copy(CreateBackendSetDetails o) { + return backends(o.getBackends()) + .healthChecker(o.getHealthChecker()) + .name(o.getName()) + .policy(o.getPolicy()) + .sslConfiguration(o.getSslConfiguration()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + @JsonProperty("backends") + List backends; + + @JsonProperty("healthChecker") + @Valid + @NotNull + HealthCheckerDetails healthChecker; + + /** + * A friendly name for the backend set. It must be unique and it cannot be changed. + *

+ * Example: `My backend set` + * + **/ + @JsonProperty("name") + @Valid + @NotNull + String name; + + /** + * The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN' + * To get a list of available policies, use the {@link #listPolicies(ListPoliciesRequest) listPolicies} operation. + *

+ * Example: `LEAST_CONNECTIONS` + * + **/ + @JsonProperty("policy") + @Valid + @NotNull + String policy; + + @JsonProperty("sslConfiguration") + SSLConfigurationDetails sslConfiguration; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateCertificateDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateCertificateDetails.java new file mode 100644 index 00000000000..36f3a2c65d6 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateCertificateDetails.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The configuration details for adding a certificate bundle to a listener. + * For more information on SSL certficate configuration, see + * [Managing SSL Certificates](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingcertificates.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = CreateCertificateDetails.Builder.class) +public class CreateCertificateDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("caCertificate") + private String caCertificate; + + @JsonProperty("certificateName") + private String certificateName; + + @JsonProperty("passphrase") + private String passphrase; + + @JsonProperty("privateKey") + private String privateKey; + + @JsonProperty("publicCertificate") + private String publicCertificate; + + public CreateCertificateDetails build() { + return new CreateCertificateDetails( + caCertificate, certificateName, passphrase, privateKey, publicCertificate); + } + + @JsonIgnore + public Builder copy(CreateCertificateDetails o) { + return caCertificate(o.getCaCertificate()) + .certificateName(o.getCertificateName()) + .passphrase(o.getPassphrase()) + .privateKey(o.getPrivateKey()) + .publicCertificate(o.getPublicCertificate()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. + *

+ * Example: + *

+ * -----BEGIN CERTIFICATE----- + * MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix + * EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD + * VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y + * aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy + * ... + * -----END CERTIFICATE----- + * + **/ + @JsonProperty("caCertificate") + String caCertificate; + + /** + * A friendly name for the certificate bundle. It must be unique and it cannot be changed. + *

+ * Example: `My certificate bundle` + * + **/ + @JsonProperty("certificateName") + @Valid + @NotNull + String certificateName; + + /** + * A passphrase for encrypted private keys. This is needed only if you created your certificate with a passphrase. + *

+ * Example: `Mysecretunlockingcode42!1!` + * + **/ + @JsonProperty("passphrase") + String passphrase; + + /** + * The SSL private key for your certificate, in PEM format. + *

+ * Example: + *

+ * -----BEGIN RSA PRIVATE KEY----- + * jO1O1v2ftXMsawM90tnXwc6xhOAT1gDBC9S8DKeca..JZNUgYYwNS0dP2UK + * tmyN+XqVcAKw4HqVmChXy5b5msu8eIq3uc2NqNVtR..2ksSLukP8pxXcHyb + * +sEwvM4uf8qbnHAqwnOnP9+KV9vds6BaH1eRA4CHz..n+NVZlzBsTxTlS16 + * /Umr7wJzVrMqK5sDiSu4WuaaBdqMGfL5hLsTjcBFD..Da2iyQmSKuVD4lIZ + * ... + * -----END RSA PRIVATE KEY----- + * + **/ + @JsonProperty("privateKey") + String privateKey; + + /** + * The public certificate, in PEM format, that you received from your SSL certificate provider. + *

+ * Example: + *

+ * -----BEGIN CERTIFICATE----- + * MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG + * A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNERE + * MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdl + * YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIw + * ... + * -----END CERTIFICATE----- + * + **/ + @JsonProperty("publicCertificate") + String publicCertificate; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateListenerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateListenerDetails.java new file mode 100644 index 00000000000..3dc5d666a9b --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateListenerDetails.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The configuration details for adding a listener to a backend set. + * For more information on listener configuration, see + * [Managing Load Balancer Listeners](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managinglisteners.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = CreateListenerDetails.Builder.class) +public class CreateListenerDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("defaultBackendSetName") + private String defaultBackendSetName; + + @JsonProperty("name") + private String name; + + @JsonProperty("port") + private Integer port; + + @JsonProperty("protocol") + private String protocol; + + @JsonProperty("sslConfiguration") + private SSLConfigurationDetails sslConfiguration; + + public CreateListenerDetails build() { + return new CreateListenerDetails( + defaultBackendSetName, name, port, protocol, sslConfiguration); + } + + @JsonIgnore + public Builder copy(CreateListenerDetails o) { + return defaultBackendSetName(o.getDefaultBackendSetName()) + .name(o.getName()) + .port(o.getPort()) + .protocol(o.getProtocol()) + .sslConfiguration(o.getSslConfiguration()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The name of the associated backend set. + **/ + @JsonProperty("defaultBackendSetName") + @Valid + @NotNull + String defaultBackendSetName; + + /** + * A friendly name for the listener. It must be unique and it cannot be changed. + *

+ * Example: `My listener` + * + **/ + @JsonProperty("name") + @Valid + @NotNull + String name; + + /** + * The communication port for the listener. + *

+ * Example: `80` + * + **/ + @JsonProperty("port") + @Valid + @NotNull + @Min(1) + @Max(65535) + Integer port; + + /** + * The protocol on which the listener accepts connection requests. + * To get a list of valid protocols, use the {@link #listProtocols(ListProtocolsRequest) listProtocols} + * operation. + *

+ * Example: `HTTP` + * + **/ + @JsonProperty("protocol") + @Valid + @NotNull + String protocol; + + @JsonProperty("sslConfiguration") + SSLConfigurationDetails sslConfiguration; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateLoadBalancerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateLoadBalancerDetails.java new file mode 100644 index 00000000000..d61d84977b8 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateLoadBalancerDetails.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The configuration details for creating a load balancer. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = CreateLoadBalancerDetails.Builder.class) +public class CreateLoadBalancerDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("backendSets") + private Map backendSets; + + @JsonProperty("certificates") + private Map certificates; + + @JsonProperty("compartmentId") + private String compartmentId; + + @JsonProperty("displayName") + private String displayName; + + @JsonProperty("listeners") + private Map listeners; + + @JsonProperty("shapeName") + private String shapeName; + + @JsonProperty("subnetIds") + private List subnetIds; + + public CreateLoadBalancerDetails build() { + return new CreateLoadBalancerDetails( + backendSets, + certificates, + compartmentId, + displayName, + listeners, + shapeName, + subnetIds); + } + + @JsonIgnore + public Builder copy(CreateLoadBalancerDetails o) { + return backendSets(o.getBackendSets()) + .certificates(o.getCertificates()) + .compartmentId(o.getCompartmentId()) + .displayName(o.getDisplayName()) + .listeners(o.getListeners()) + .shapeName(o.getShapeName()) + .subnetIds(o.getSubnetIds()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + @JsonProperty("backendSets") + Map backendSets; + + @JsonProperty("certificates") + Map certificates; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment in which to create the load balancer. + **/ + @JsonProperty("compartmentId") + @Valid + @NotNull + String compartmentId; + + /** + * A user-friendly name. It does not have to be unique, and it is changeable. + *

+ * Example: `My load balancer` + * + **/ + @JsonProperty("displayName") + @Valid + @NotNull + String displayName; + + @JsonProperty("listeners") + Map listeners; + + /** + * A template that determines the total pre-provisioned bandwidth (ingress plus egress). + * To get a list of available shapes, use the {@link #listShapes(ListShapesRequest) listShapes} + * operation. + *

+ * Example: `100Mbps` + * + **/ + @JsonProperty("shapeName") + @Valid + @NotNull + String shapeName; + + /** + * An array of subnet [OCIDs](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + **/ + @JsonProperty("subnetIds") + @Valid + @NotNull + List subnetIds; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthChecker.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthChecker.java new file mode 100644 index 00000000000..562af02c4d5 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthChecker.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The health check policy configuration. + * For more information, see [Editing Health Check Policies](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/editinghealthcheck.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = HealthChecker.Builder.class) +public class HealthChecker { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("intervalInMillis") + private Integer intervalInMillis; + + @JsonProperty("port") + private Integer port; + + @JsonProperty("protocol") + private String protocol; + + @JsonProperty("responseBodyRegex") + private String responseBodyRegex; + + @JsonProperty("retries") + private Integer retries; + + @JsonProperty("returnCode") + private Integer returnCode; + + @JsonProperty("timeoutInMillis") + private Integer timeoutInMillis; + + @JsonProperty("urlPath") + private String urlPath; + + public HealthChecker build() { + return new HealthChecker( + intervalInMillis, + port, + protocol, + responseBodyRegex, + retries, + returnCode, + timeoutInMillis, + urlPath); + } + + @JsonIgnore + public Builder copy(HealthChecker o) { + return intervalInMillis(o.getIntervalInMillis()) + .port(o.getPort()) + .protocol(o.getProtocol()) + .responseBodyRegex(o.getResponseBodyRegex()) + .retries(o.getRetries()) + .returnCode(o.getReturnCode()) + .timeoutInMillis(o.getTimeoutInMillis()) + .urlPath(o.getUrlPath()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The interval between health checks, in milliseconds. The default is 10000 (10 seconds). + *

+ * Example: `30000` + * + **/ + @JsonProperty("intervalInMillis") + Integer intervalInMillis; + + /** + * The backend server port against which to run the health check. If the port is not specified, the load balancer uses the + * port information from the `Backend` object. + *

+ * Example: `8080` + * + **/ + @JsonProperty("port") + @Valid + @NotNull + Integer port; + + /** + * The protocol the health check must use; either HTTP or TCP. + *

+ * Example: `HTTP` + * + **/ + @JsonProperty("protocol") + @Valid + @NotNull + String protocol; + + /** + * A regular expression for parsing the response body from the backend server. + *

+ * Example: `^(500|40[1348])$` + * + **/ + @JsonProperty("responseBodyRegex") + @Valid + @NotNull + String responseBodyRegex; + + /** + * The number of retries to attempt before a backend server is considered \"unhealthy\". Defaults to 3. + *

+ * Example: `3` + * + **/ + @JsonProperty("retries") + Integer retries; + + /** + * The status code a healthy backend server should return. If you configure the health check policy to use the HTTP protocol, + * you can use common HTTP status codes such as \"200\". + *

+ * Example: `200` + * + **/ + @JsonProperty("returnCode") + @Valid + @NotNull + Integer returnCode; + + /** + * The maximum timeout before a retry, in milliseconds. Defaults to 3000 (3 seconds). + *

+ * Example: `6000` + * + **/ + @JsonProperty("timeoutInMillis") + Integer timeoutInMillis; + + /** + * The path against which to run the health check. + *

+ * Example: `/healthcheck` + * + **/ + @JsonProperty("urlPath") + @Valid + @NotNull + String urlPath; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthCheckerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthCheckerDetails.java new file mode 100644 index 00000000000..b37eb32f7ea --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthCheckerDetails.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The health check policy's configuration details. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = HealthCheckerDetails.Builder.class) +public class HealthCheckerDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("intervalInMillis") + private Integer intervalInMillis; + + @JsonProperty("port") + private Integer port; + + @JsonProperty("protocol") + private String protocol; + + @JsonProperty("responseBodyRegex") + private String responseBodyRegex; + + @JsonProperty("retries") + private Integer retries; + + @JsonProperty("returnCode") + private Integer returnCode; + + @JsonProperty("timeoutInMillis") + private Integer timeoutInMillis; + + @JsonProperty("urlPath") + private String urlPath; + + public HealthCheckerDetails build() { + return new HealthCheckerDetails( + intervalInMillis, + port, + protocol, + responseBodyRegex, + retries, + returnCode, + timeoutInMillis, + urlPath); + } + + @JsonIgnore + public Builder copy(HealthCheckerDetails o) { + return intervalInMillis(o.getIntervalInMillis()) + .port(o.getPort()) + .protocol(o.getProtocol()) + .responseBodyRegex(o.getResponseBodyRegex()) + .retries(o.getRetries()) + .returnCode(o.getReturnCode()) + .timeoutInMillis(o.getTimeoutInMillis()) + .urlPath(o.getUrlPath()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The interval between health checks, in milliseconds. + *

+ * Example: `30000` + * + **/ + @JsonProperty("intervalInMillis") + @Min(1000) + @Max(1800000) + Integer intervalInMillis; + + /** + * The backend server port against which to run the health check. If the port is not specified, the load balancer uses the + * port information from the `Backend` object. + *

+ * Example: `8080` + * + **/ + @JsonProperty("port") + @Min(0) + @Max(65535) + Integer port; + + /** + * The protocol the health check must use; either HTTP or TCP. + *

+ * Example: `HTTP` + * + **/ + @JsonProperty("protocol") + @Valid + @NotNull + String protocol; + + /** + * A regular expression for parsing the response body from the backend server. + *

+ * Example: `^(500|40[1348])$` + * + **/ + @JsonProperty("responseBodyRegex") + String responseBodyRegex; + + /** + * The number of retries to attempt before a backend server is considered \"unhealthy\". + *

+ * Example: `3` + * + **/ + @JsonProperty("retries") + Integer retries; + + /** + * The status code a healthy backend server should return. + *

+ * Example: `200` + * + **/ + @JsonProperty("returnCode") + Integer returnCode; + + /** + * The maximum timeout in milliseconds before a retry. + *

+ * Example: `6000` + * + **/ + @JsonProperty("timeoutInMillis") + @Min(1) + @Max(600000) + Integer timeoutInMillis; + + /** + * The path against which to run the health check. + *

+ * Example: `/healthcheck` + * + **/ + @JsonProperty("urlPath") + String urlPath; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/IpAddress.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/IpAddress.java new file mode 100644 index 00000000000..a325e16af29 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/IpAddress.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * A load balancer public IP address. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = IpAddress.Builder.class) +public class IpAddress { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("ipAddress") + private String ipAddress; + + public IpAddress build() { + return new IpAddress(ipAddress); + } + + @JsonIgnore + public Builder copy(IpAddress o) { + return ipAddress(o.getIpAddress()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * An IP address. + *

+ * Example: `128.148.10.20` + * + **/ + @JsonProperty("ipAddress") + @Valid + @NotNull + String ipAddress; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Listener.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Listener.java new file mode 100644 index 00000000000..030e9f283e5 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Listener.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The listener's configuration. + * For more information on backend set configuration, see + * [Managing Load Balancer Listeners](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managinglisteners.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = Listener.Builder.class) +public class Listener { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("defaultBackendSetName") + private String defaultBackendSetName; + + @JsonProperty("name") + private String name; + + @JsonProperty("port") + private Integer port; + + @JsonProperty("protocol") + private String protocol; + + @JsonProperty("sslConfiguration") + private SSLConfiguration sslConfiguration; + + public Listener build() { + return new Listener(defaultBackendSetName, name, port, protocol, sslConfiguration); + } + + @JsonIgnore + public Builder copy(Listener o) { + return defaultBackendSetName(o.getDefaultBackendSetName()) + .name(o.getName()) + .port(o.getPort()) + .protocol(o.getProtocol()) + .sslConfiguration(o.getSslConfiguration()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The name of the associated backend set. + **/ + @JsonProperty("defaultBackendSetName") + @Valid + @NotNull + String defaultBackendSetName; + + /** + * A friendly name for the listener. It must be unique and it cannot be changed. + *

+ * Example: `My listener` + * + **/ + @JsonProperty("name") + @Valid + @NotNull + String name; + + /** + * The communication port for the listener. + *

+ * Example: `80` + * + **/ + @JsonProperty("port") + @Valid + @NotNull + Integer port; + + /** + * The protocol on which the listener accepts connection requests. + * To get a list of valid protocols, use the {@link #listProtocols(ListProtocolsRequest) listProtocols} + * operation. + *

+ * Example: `HTTP` + * + **/ + @JsonProperty("protocol") + @Valid + @NotNull + String protocol; + + @JsonProperty("sslConfiguration") + SSLConfiguration sslConfiguration; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/ListenerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/ListenerDetails.java new file mode 100644 index 00000000000..1035721725d --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/ListenerDetails.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The listener's configuration details. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = ListenerDetails.Builder.class) +public class ListenerDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("defaultBackendSetName") + private String defaultBackendSetName; + + @JsonProperty("port") + private Integer port; + + @JsonProperty("protocol") + private String protocol; + + @JsonProperty("sslConfiguration") + private SSLConfigurationDetails sslConfiguration; + + public ListenerDetails build() { + return new ListenerDetails(defaultBackendSetName, port, protocol, sslConfiguration); + } + + @JsonIgnore + public Builder copy(ListenerDetails o) { + return defaultBackendSetName(o.getDefaultBackendSetName()) + .port(o.getPort()) + .protocol(o.getProtocol()) + .sslConfiguration(o.getSslConfiguration()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The name of the associated backend set. + **/ + @JsonProperty("defaultBackendSetName") + @Valid + @NotNull + String defaultBackendSetName; + + /** + * The communication port for the listener. + *

+ * Example: `80` + * + **/ + @JsonProperty("port") + @Valid + @NotNull + @Min(1) + @Max(65535) + Integer port; + + /** + * The protocol on which the listener accepts connection requests. + * To get a list of valid protocols, use the {@link #listProtocols(ListProtocolsRequest) listProtocols} + * operation. + *

+ * Example: `HTTP` + * + **/ + @JsonProperty("protocol") + @Valid + @NotNull + String protocol; + + @JsonProperty("sslConfiguration") + SSLConfigurationDetails sslConfiguration; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancer.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancer.java new file mode 100644 index 00000000000..ce3cda44fb7 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancer.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The properties that define a load balancer. For more information, see + * [Managing a Load Balancer](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingloadbalancer.htm). + *

+ * To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, + * talk to an administrator. If you're an administrator who needs to write policies to give users access, see + * [Getting Started with Policies](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm). + * + * For information about endpoints and signing API requests, see + * [About the API](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/usingapi.htm). For information about available SDKs and tools, see + * [SDKS and Other Tools](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdks.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = LoadBalancer.Builder.class) +public class LoadBalancer { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("backendSets") + private Map backendSets; + + @JsonProperty("certificates") + private Map certificates; + + @JsonProperty("compartmentId") + private String compartmentId; + + @JsonProperty("displayName") + private String displayName; + + @JsonProperty("id") + private String id; + + @JsonProperty("ipAddresses") + private List ipAddresses; + + @JsonProperty("lifecycleState") + private LifecycleState lifecycleState; + + @JsonProperty("listeners") + private Map listeners; + + @JsonProperty("shapeName") + private String shapeName; + + @JsonProperty("subnetIds") + private List subnetIds; + + @JsonProperty("timeCreated") + private Date timeCreated; + + public LoadBalancer build() { + return new LoadBalancer( + backendSets, + certificates, + compartmentId, + displayName, + id, + ipAddresses, + lifecycleState, + listeners, + shapeName, + subnetIds, + timeCreated); + } + + @JsonIgnore + public Builder copy(LoadBalancer o) { + return backendSets(o.getBackendSets()) + .certificates(o.getCertificates()) + .compartmentId(o.getCompartmentId()) + .displayName(o.getDisplayName()) + .id(o.getId()) + .ipAddresses(o.getIpAddresses()) + .lifecycleState(o.getLifecycleState()) + .listeners(o.getListeners()) + .shapeName(o.getShapeName()) + .subnetIds(o.getSubnetIds()) + .timeCreated(o.getTimeCreated()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + @JsonProperty("backendSets") + Map backendSets; + + @JsonProperty("certificates") + Map certificates; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancer. + **/ + @JsonProperty("compartmentId") + @Valid + @NotNull + String compartmentId; + + /** + * A user-friendly name. It does not have to be unique, and it is changeable. + *

+ * Example: `My load balancer` + * + **/ + @JsonProperty("displayName") + @Valid + @NotNull + String displayName; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer. + **/ + @JsonProperty("id") + @Valid + @NotNull + String id; + + /** + * An array of IP addresses. + * + **/ + @JsonProperty("ipAddresses") + List ipAddresses; + /** + **/ + @lombok.extern.slf4j.Slf4j + public enum LifecycleState { + Creating("CREATING"), + Failed("FAILED"), + Active("ACTIVE"), + Deleting("DELETING"), + Deleted("DELETED"), + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); + + private final String value; + private static Map map; + + static { + map = new HashMap<>(); + for (LifecycleState v : LifecycleState.values()) { + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } + } + } + + LifecycleState(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @JsonCreator + public static LifecycleState create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; + } + }; + + @JsonProperty("lifecycleState") + @Valid + @NotNull + LifecycleState lifecycleState; + + @JsonProperty("listeners") + Map listeners; + + /** + * A template that determines the total pre-provisioned bandwidth (ingress plus egress). + * To get a list of available shapes, use the {@link #listShapes(ListShapesRequest) listShapes} + * operation. + *

+ * Example: `100Mbps` + * + **/ + @JsonProperty("shapeName") + @Valid + @NotNull + String shapeName; + + /** + * An array of subnet [OCIDs](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm). + **/ + @JsonProperty("subnetIds") + List subnetIds; + + /** + * The date and time the load balancer was created, in the format defined by RFC3339. + *

+ * Example: `2016-08-25T21:10:29.600Z` + * + **/ + @JsonProperty("timeCreated") + @Valid + @NotNull + Date timeCreated; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerPolicy.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerPolicy.java new file mode 100644 index 00000000000..1fca99bc648 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerPolicy.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * A policy that determines how traffic is distributed among backend servers. + * For more information on load balancing policies, see + * [How Load Balancing Policies Work](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = LoadBalancerPolicy.Builder.class) +public class LoadBalancerPolicy { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("name") + private String name; + + public LoadBalancerPolicy build() { + return new LoadBalancerPolicy(name); + } + + @JsonIgnore + public Builder copy(LoadBalancerPolicy o) { + return name(o.getName()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The name of the load balancing policy. + **/ + @JsonProperty("name") + @Valid + @NotNull + String name; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerProtocol.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerProtocol.java new file mode 100644 index 00000000000..25034575e91 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerProtocol.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The protocol that defines the type of traffic accepted by a listener. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = LoadBalancerProtocol.Builder.class) +public class LoadBalancerProtocol { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("name") + private String name; + + public LoadBalancerProtocol build() { + return new LoadBalancerProtocol(name); + } + + @JsonIgnore + public Builder copy(LoadBalancerProtocol o) { + return name(o.getName()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The name of the protocol. + **/ + @JsonProperty("name") + @Valid + @NotNull + String name; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerShape.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerShape.java new file mode 100644 index 00000000000..49ef81ceb94 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerShape.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * A shape is a template that determines the total pre-provisioned bandwidth (ingress plus egress) for the + * load balancer. + *

+ * Note that the pre-provisioned maximum capacity applies to aggregated connections, not to a single client + * attempting to use the full bandwidth. + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = LoadBalancerShape.Builder.class) +public class LoadBalancerShape { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("name") + private String name; + + public LoadBalancerShape build() { + return new LoadBalancerShape(name); + } + + @JsonIgnore + public Builder copy(LoadBalancerShape o) { + return name(o.getName()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The name of the shape. + **/ + @JsonProperty("name") + @Valid + @NotNull + String name; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfiguration.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfiguration.java new file mode 100644 index 00000000000..31b4a464c15 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfiguration.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * A listener's SSL handling configuration. + *

+ * To use SSL, a listener must be associated with a {@link Certificate}. + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = SSLConfiguration.Builder.class) +public class SSLConfiguration { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("certificateName") + private String certificateName; + + @JsonProperty("verifyDepth") + private Integer verifyDepth; + + @JsonProperty("verifyPeerCertificate") + private Boolean verifyPeerCertificate; + + public SSLConfiguration build() { + return new SSLConfiguration(certificateName, verifyDepth, verifyPeerCertificate); + } + + @JsonIgnore + public Builder copy(SSLConfiguration o) { + return certificateName(o.getCertificateName()) + .verifyDepth(o.getVerifyDepth()) + .verifyPeerCertificate(o.getVerifyPeerCertificate()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * A friendly name for the certificate bundle. It must be unique and it cannot be changed. + *

+ * Example: `My certificate bundle` + * + **/ + @JsonProperty("certificateName") + @Valid + @NotNull + String certificateName; + + /** + * The maximum depth for peer certificate chain verification. + *

+ * Example: `3` + * + **/ + @JsonProperty("verifyDepth") + @Valid + @NotNull + Integer verifyDepth; + + /** + * Whether the load balancer listener should verify peer certificates. + *

+ * Example: `true` + * + **/ + @JsonProperty("verifyPeerCertificate") + @Valid + @NotNull + Boolean verifyPeerCertificate; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfigurationDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfigurationDetails.java new file mode 100644 index 00000000000..254285fab25 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfigurationDetails.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The load balancer's SSL handling configuration details. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = SSLConfigurationDetails.Builder.class) +public class SSLConfigurationDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("certificateName") + private String certificateName; + + @JsonProperty("verifyDepth") + private Integer verifyDepth; + + @JsonProperty("verifyPeerCertificate") + private Boolean verifyPeerCertificate; + + public SSLConfigurationDetails build() { + return new SSLConfigurationDetails(certificateName, verifyDepth, verifyPeerCertificate); + } + + @JsonIgnore + public Builder copy(SSLConfigurationDetails o) { + return certificateName(o.getCertificateName()) + .verifyDepth(o.getVerifyDepth()) + .verifyPeerCertificate(o.getVerifyPeerCertificate()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * A friendly name for the certificate bundle. It must be unique and it cannot be changed. + *

+ * Example: `My certificate bundle` + * + **/ + @JsonProperty("certificateName") + @Valid + @NotNull + String certificateName; + + /** + * The maximum depth for peer certificate chain verification. + *

+ * Example: `3` + * + **/ + @JsonProperty("verifyDepth") + Integer verifyDepth; + + /** + * Whether the load balancer listener should verify peer certificates. + *

+ * Example: `true` + * + **/ + @JsonProperty("verifyPeerCertificate") + Boolean verifyPeerCertificate; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateBackendDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateBackendDetails.java new file mode 100644 index 00000000000..876ab3d9e03 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateBackendDetails.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The configuration details for updating a backend server. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = UpdateBackendDetails.Builder.class) +public class UpdateBackendDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("backup") + private Boolean backup; + + @JsonProperty("drain") + private Boolean drain; + + @JsonProperty("offline") + private Boolean offline; + + @JsonProperty("weight") + private Integer weight; + + public UpdateBackendDetails build() { + return new UpdateBackendDetails(backup, drain, offline, weight); + } + + @JsonIgnore + public Builder copy(UpdateBackendDetails o) { + return backup(o.getBackup()) + .drain(o.getDrain()) + .offline(o.getOffline()) + .weight(o.getWeight()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress + * traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy. + *

+ * Example: `true` + * + **/ + @JsonProperty("backup") + @Valid + @NotNull + Boolean backup; + + /** + * Whether the load balancer should drain this server. Servers marked \"drain\" receive no new + * incoming traffic. + *

+ * Example: `true` + * + **/ + @JsonProperty("drain") + @Valid + @NotNull + Boolean drain; + + /** + * Whether the load balancer should treat this server as offline. Offline servers receive no incoming + * traffic. + *

+ * Example: `true` + * + **/ + @JsonProperty("offline") + @Valid + @NotNull + Boolean offline; + + /** + * The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger + * proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections + * as a server weighted '1'. + * For more information on load balancing policies, see + * [How Load Balancing Policies Work](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm). + *

+ * Example: `3` + * + **/ + @JsonProperty("weight") + @Valid + @NotNull + Integer weight; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateBackendSetDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateBackendSetDetails.java new file mode 100644 index 00000000000..2b2970a5ce0 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateBackendSetDetails.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The configuration details for updating a load balancer backend set. + * For more information on backend set configuration, see + * [Managing Backend Sets](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managingbackendsets.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = UpdateBackendSetDetails.Builder.class) +public class UpdateBackendSetDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("backends") + private List backends; + + @JsonProperty("healthChecker") + private HealthCheckerDetails healthChecker; + + @JsonProperty("policy") + private String policy; + + @JsonProperty("sslConfiguration") + private SSLConfigurationDetails sslConfiguration; + + public UpdateBackendSetDetails build() { + return new UpdateBackendSetDetails(backends, healthChecker, policy, sslConfiguration); + } + + @JsonIgnore + public Builder copy(UpdateBackendSetDetails o) { + return backends(o.getBackends()) + .healthChecker(o.getHealthChecker()) + .policy(o.getPolicy()) + .sslConfiguration(o.getSslConfiguration()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + @JsonProperty("backends") + @Valid + @NotNull + List backends; + + @JsonProperty("healthChecker") + @Valid + @NotNull + HealthCheckerDetails healthChecker; + + /** + * The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN' + * To get a list of available policies, use the {@link #listPolicies(ListPoliciesRequest) listPolicies} + * operation. + *

+ * Example: `LEAST_CONNECTIONS` + * + **/ + @JsonProperty("policy") + @Valid + @NotNull + String policy; + + @JsonProperty("sslConfiguration") + SSLConfigurationDetails sslConfiguration; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateHealthCheckerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateHealthCheckerDetails.java new file mode 100644 index 00000000000..3bc89086249 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateHealthCheckerDetails.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The health checker's configuration details. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = UpdateHealthCheckerDetails.Builder.class) +public class UpdateHealthCheckerDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("intervalInMillis") + private Integer intervalInMillis; + + @JsonProperty("port") + private Integer port; + + @JsonProperty("protocol") + private String protocol; + + @JsonProperty("responseBodyRegex") + private String responseBodyRegex; + + @JsonProperty("retries") + private Integer retries; + + @JsonProperty("returnCode") + private Integer returnCode; + + @JsonProperty("timeoutInMillis") + private Integer timeoutInMillis; + + @JsonProperty("urlPath") + private String urlPath; + + public UpdateHealthCheckerDetails build() { + return new UpdateHealthCheckerDetails( + intervalInMillis, + port, + protocol, + responseBodyRegex, + retries, + returnCode, + timeoutInMillis, + urlPath); + } + + @JsonIgnore + public Builder copy(UpdateHealthCheckerDetails o) { + return intervalInMillis(o.getIntervalInMillis()) + .port(o.getPort()) + .protocol(o.getProtocol()) + .responseBodyRegex(o.getResponseBodyRegex()) + .retries(o.getRetries()) + .returnCode(o.getReturnCode()) + .timeoutInMillis(o.getTimeoutInMillis()) + .urlPath(o.getUrlPath()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The interval between health checks, in milliseconds. + *

+ * Example: `30000` + * + **/ + @JsonProperty("intervalInMillis") + @Valid + @NotNull + @Min(1000) + @Max(1800000) + Integer intervalInMillis; + + /** + * The backend server port against which to run the health check. + *

+ * Example: `8080` + * + **/ + @JsonProperty("port") + @Valid + @NotNull + @Min(0) + @Max(65535) + Integer port; + + /** + * The protocol the health check must use; either HTTP or TCP. + *

+ * Example: `HTTP` + * + **/ + @JsonProperty("protocol") + @Valid + @NotNull + String protocol; + + /** + * A regular expression for parsing the response body from the backend server. + *

+ * Example: `^(500|40[1348])$` + * + **/ + @JsonProperty("responseBodyRegex") + @Valid + @NotNull + String responseBodyRegex; + + /** + * The number of retries to attempt before a backend server is considered \"unhealthy\". + *

+ * Example: `3` + * + **/ + @JsonProperty("retries") + @Valid + @NotNull + Integer retries; + + /** + * The status code a healthy backend server should return. + *

+ * Example: `200` + * + **/ + @JsonProperty("returnCode") + @Valid + @NotNull + Integer returnCode; + + /** + * The maximum timeout in milliseconds before a retry. + *

+ * Example: `6000` + * + **/ + @JsonProperty("timeoutInMillis") + @Valid + @NotNull + @Min(1) + @Max(600000) + Integer timeoutInMillis; + + /** + * The path against which to run the health check. + *

+ * Example: `/healthcheck` + * + **/ + @JsonProperty("urlPath") + @Valid + @NotNull + String urlPath; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateListenerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateListenerDetails.java new file mode 100644 index 00000000000..7e332fb44a7 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateListenerDetails.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * The configuration details for updating a listener. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = UpdateListenerDetails.Builder.class) +public class UpdateListenerDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("defaultBackendSetName") + private String defaultBackendSetName; + + @JsonProperty("port") + private Integer port; + + @JsonProperty("protocol") + private String protocol; + + @JsonProperty("sslConfiguration") + private SSLConfigurationDetails sslConfiguration; + + public UpdateListenerDetails build() { + return new UpdateListenerDetails( + defaultBackendSetName, port, protocol, sslConfiguration); + } + + @JsonIgnore + public Builder copy(UpdateListenerDetails o) { + return defaultBackendSetName(o.getDefaultBackendSetName()) + .port(o.getPort()) + .protocol(o.getProtocol()) + .sslConfiguration(o.getSslConfiguration()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The name of the associated backend set. + **/ + @JsonProperty("defaultBackendSetName") + @Valid + @NotNull + String defaultBackendSetName; + + /** + * The communication port for the listener. + *

+ * Example: `80` + * + **/ + @JsonProperty("port") + @Valid + @NotNull + @Min(1) + @Max(65535) + Integer port; + + /** + * The protocol on which the listener accepts connection requests. + * To get a list of valid protocols, use the {@link #listProtocols(ListProtocolsRequest) listProtocols} + * operation. + *

+ * Example: `HTTP` + * + **/ + @JsonProperty("protocol") + @Valid + @NotNull + String protocol; + + @JsonProperty("sslConfiguration") + SSLConfigurationDetails sslConfiguration; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateLoadBalancerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateLoadBalancerDetails.java new file mode 100644 index 00000000000..a9b7212b1f7 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateLoadBalancerDetails.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * Configuration details to update a load balancer. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = UpdateLoadBalancerDetails.Builder.class) +public class UpdateLoadBalancerDetails { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("displayName") + private String displayName; + + public UpdateLoadBalancerDetails build() { + return new UpdateLoadBalancerDetails(displayName); + } + + @JsonIgnore + public Builder copy(UpdateLoadBalancerDetails o) { + return displayName(o.getDisplayName()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The user-friendly display name for the load balancer. It does not have to be unique, and it is changeable. + *

+ * Example: `My load balancer` + * + **/ + @JsonProperty("displayName") + @Valid + @NotNull + String displayName; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/WorkRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/WorkRequest.java new file mode 100644 index 00000000000..2c041ced925 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/WorkRequest.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * Many of the API requests you use to create and configure load balancing do not take effect immediately. + * In these cases, the request spawns an asynchronous work flow to fulfill the request. WorkRequest objects provide visibility + * for in-progress work flows. + * For more information about work requests, see [Viewing the State of a Work Request](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/viewingworkrequest.htm). + * + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = WorkRequest.Builder.class) +public class WorkRequest { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("errorDetails") + private List errorDetails; + + @JsonProperty("id") + private String id; + + @JsonProperty("lifecycleState") + private LifecycleState lifecycleState; + + @JsonProperty("loadBalancerId") + private String loadBalancerId; + + @JsonProperty("message") + private String message; + + @JsonProperty("timeAccepted") + private Date timeAccepted; + + @JsonProperty("timeFinished") + private Date timeFinished; + + @JsonProperty("type") + private String type; + + public WorkRequest build() { + return new WorkRequest( + errorDetails, + id, + lifecycleState, + loadBalancerId, + message, + timeAccepted, + timeFinished, + type); + } + + @JsonIgnore + public Builder copy(WorkRequest o) { + return errorDetails(o.getErrorDetails()) + .id(o.getId()) + .lifecycleState(o.getLifecycleState()) + .loadBalancerId(o.getLoadBalancerId()) + .message(o.getMessage()) + .timeAccepted(o.getTimeAccepted()) + .timeFinished(o.getTimeFinished()) + .type(o.getType()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + @JsonProperty("errorDetails") + @Valid + @NotNull + List errorDetails; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + **/ + @JsonProperty("id") + @Valid + @NotNull + String id; + /** + **/ + @lombok.extern.slf4j.Slf4j + public enum LifecycleState { + Accepted("ACCEPTED"), + InProgress("IN_PROGRESS"), + Failed("FAILED"), + Succeeded("SUCCEEDED"), + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); + + private final String value; + private static Map map; + + static { + map = new HashMap<>(); + for (LifecycleState v : LifecycleState.values()) { + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } + } + } + + LifecycleState(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @JsonCreator + public static LifecycleState create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; + } + }; + + @JsonProperty("lifecycleState") + @Valid + @NotNull + LifecycleState lifecycleState; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer with which the work request + * is associated. + * + **/ + @JsonProperty("loadBalancerId") + @Valid + @NotNull + String loadBalancerId; + + /** + * A collection of data, related to the load balancer provisioning process, that helps with debugging in the event of failure. + * Possible data elements include: + *

+ * - workflow name + * - event ID + * - work request ID + * - load balancer ID + * - workflow completion message + * + **/ + @JsonProperty("message") + @Valid + @NotNull + String message; + + /** + * The date and time the work request was created, in the format defined by RFC3339. + *

+ * Example: `2016-08-25T21:10:29.600Z` + * + **/ + @JsonProperty("timeAccepted") + @Valid + @NotNull + Date timeAccepted; + + /** + * The date and time the work request was completed, in the format defined by RFC3339. + *

+ * Example: `2016-08-25T21:10:29.600Z` + * + **/ + @JsonProperty("timeFinished") + Date timeFinished; + + /** + * The type of action the work request represents. + * + **/ + @JsonProperty("type") + @Valid + @NotNull + String type; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/WorkRequestError.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/WorkRequestError.java new file mode 100644 index 00000000000..5c99e896fb9 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/WorkRequestError.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import java.util.*; +import javax.validation.*; +import javax.validation.constraints.*; + +import lombok.Value; +import lombok.*; +import lombok.experimental.*; + +/** + * An object returned in the event of a work request error. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Value +@JsonDeserialize(builder = WorkRequestError.Builder.class) +public class WorkRequestError { + @JsonPOJOBuilder(withPrefix = "") + @Accessors(fluent = true) + @Setter + public static class Builder { + @JsonProperty("errorCode") + private ErrorCode errorCode; + + @JsonProperty("message") + private String message; + + public WorkRequestError build() { + return new WorkRequestError(errorCode, message); + } + + @JsonIgnore + public Builder copy(WorkRequestError o) { + return errorCode(o.getErrorCode()).message(o.getMessage()); + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + **/ + @lombok.extern.slf4j.Slf4j + public enum ErrorCode { + BadInput("BAD_INPUT"), + InternalError("INTERNAL_ERROR"), + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); + + private final String value; + private static Map map; + + static { + map = new HashMap<>(); + for (ErrorCode v : ErrorCode.values()) { + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } + } + } + + ErrorCode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @JsonCreator + public static ErrorCode create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + LOG.warn( + "Received unknown value '{}' for enum 'ErrorCode', returning UnknownEnumValue", + key); + return UnknownEnumValue; + } + }; + + @JsonProperty("errorCode") + @Valid + @NotNull + ErrorCode errorCode; + + /** + * A human-readable error string. + **/ + @JsonProperty("message") + @Valid + @NotNull + String message; +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateBackendRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateBackendRequest.java new file mode 100644 index 00000000000..1f5e68d6a62 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateBackendRequest.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class CreateBackendRequest { + + /** + * The details to add a backend server to a backend set. + */ + private CreateBackendDetails createBackendDetails; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and servers. + */ + private String loadBalancerId; + + /** + * The name of the backend set to add the backend server to. + *

+ * Example: `My backend set` + * + */ + private String backendSetName; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A token that uniquely identifies a request so it can be retried in case of a timeout or + * server error without risk of executing that same action again. Retry tokens expire after 24 + * hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + * has been deleted and purged from the system, then a retry of the original creation request + * may be rejected). + * + */ + private String opcRetryToken; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateBackendRequest o) { + createBackendDetails(o.getCreateBackendDetails()); + loadBalancerId(o.getLoadBalancerId()); + backendSetName(o.getBackendSetName()); + opcRequestId(o.getOpcRequestId()); + opcRetryToken(o.getOpcRetryToken()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateBackendSetRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateBackendSetRequest.java new file mode 100644 index 00000000000..0902f698f76 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateBackendSetRequest.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class CreateBackendSetRequest { + + /** + * The details for adding a backend set. + */ + private CreateBackendSetDetails createBackendSetDetails; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer on which to add a backend set. + */ + private String loadBalancerId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A token that uniquely identifies a request so it can be retried in case of a timeout or + * server error without risk of executing that same action again. Retry tokens expire after 24 + * hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + * has been deleted and purged from the system, then a retry of the original creation request + * may be rejected). + * + */ + private String opcRetryToken; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateBackendSetRequest o) { + createBackendSetDetails(o.getCreateBackendSetDetails()); + loadBalancerId(o.getLoadBalancerId()); + opcRequestId(o.getOpcRequestId()); + opcRetryToken(o.getOpcRetryToken()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateCertificateRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateCertificateRequest.java new file mode 100644 index 00000000000..f499902e875 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateCertificateRequest.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class CreateCertificateRequest { + + /** + * The details of the certificate to add. + */ + private CreateCertificateDetails createCertificateDetails; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer on which to add the certificate. + */ + private String loadBalancerId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A token that uniquely identifies a request so it can be retried in case of a timeout or + * server error without risk of executing that same action again. Retry tokens expire after 24 + * hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + * has been deleted and purged from the system, then a retry of the original creation request + * may be rejected). + * + */ + private String opcRetryToken; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateCertificateRequest o) { + createCertificateDetails(o.getCreateCertificateDetails()); + loadBalancerId(o.getLoadBalancerId()); + opcRequestId(o.getOpcRequestId()); + opcRetryToken(o.getOpcRetryToken()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateListenerRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateListenerRequest.java new file mode 100644 index 00000000000..22df5bb80ae --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateListenerRequest.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class CreateListenerRequest { + + /** + * Details to add a listener. + */ + private CreateListenerDetails createListenerDetails; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer on which to add a listener. + */ + private String loadBalancerId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A token that uniquely identifies a request so it can be retried in case of a timeout or + * server error without risk of executing that same action again. Retry tokens expire after 24 + * hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + * has been deleted and purged from the system, then a retry of the original creation request + * may be rejected). + * + */ + private String opcRetryToken; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateListenerRequest o) { + createListenerDetails(o.getCreateListenerDetails()); + loadBalancerId(o.getLoadBalancerId()); + opcRequestId(o.getOpcRequestId()); + opcRetryToken(o.getOpcRetryToken()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateLoadBalancerRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateLoadBalancerRequest.java new file mode 100644 index 00000000000..954de51efd1 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateLoadBalancerRequest.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class CreateLoadBalancerRequest { + + /** + * The configuration details for creating a load balancer. + */ + private CreateLoadBalancerDetails createLoadBalancerDetails; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A token that uniquely identifies a request so it can be retried in case of a timeout or + * server error without risk of executing that same action again. Retry tokens expire after 24 + * hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + * has been deleted and purged from the system, then a retry of the original creation request + * may be rejected). + * + */ + private String opcRetryToken; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateLoadBalancerRequest o) { + createLoadBalancerDetails(o.getCreateLoadBalancerDetails()); + opcRequestId(o.getOpcRequestId()); + opcRetryToken(o.getOpcRetryToken()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendRequest.java new file mode 100644 index 00000000000..cca43b52b2c --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendRequest.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class DeleteBackendRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and server. + */ + private String loadBalancerId; + + /** + * The name of the backend set associated with the backend server. + *

+ * Example: `My backend set` + * + */ + private String backendSetName; + + /** + * The name of the backend server to remove. + *

+ * Example: `My backend server` + * + */ + private String backendName; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteBackendRequest o) { + loadBalancerId(o.getLoadBalancerId()); + backendSetName(o.getBackendSetName()); + backendName(o.getBackendName()); + opcRequestId(o.getOpcRequestId()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendSetRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendSetRequest.java new file mode 100644 index 00000000000..86b80987e2d --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendSetRequest.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class DeleteBackendSetRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set. + */ + private String loadBalancerId; + + /** + * The name of the backend set to delete. + *

+ * Example: `My backend set` + * + */ + private String backendSetName; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteBackendSetRequest o) { + loadBalancerId(o.getLoadBalancerId()); + backendSetName(o.getBackendSetName()); + opcRequestId(o.getOpcRequestId()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteCertificateRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteCertificateRequest.java new file mode 100644 index 00000000000..f995737392b --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteCertificateRequest.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class DeleteCertificateRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the certificate to be deleted. + */ + private String loadBalancerId; + + /** + * The name of the certificate to delete. + *

+ * Example: `My certificate` + * + */ + private String certificateName; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteCertificateRequest o) { + loadBalancerId(o.getLoadBalancerId()); + certificateName(o.getCertificateName()); + opcRequestId(o.getOpcRequestId()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteListenerRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteListenerRequest.java new file mode 100644 index 00000000000..f94626db95e --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteListenerRequest.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class DeleteListenerRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the listener to delete. + */ + private String loadBalancerId; + + /** + * The name of the listener to delete. + *

+ * Example: `My listener` + * + */ + private String listenerName; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteListenerRequest o) { + loadBalancerId(o.getLoadBalancerId()); + listenerName(o.getListenerName()); + opcRequestId(o.getOpcRequestId()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteLoadBalancerRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteLoadBalancerRequest.java new file mode 100644 index 00000000000..5969fbdcbd9 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteLoadBalancerRequest.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class DeleteLoadBalancerRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer to delete. + */ + private String loadBalancerId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteLoadBalancerRequest o) { + loadBalancerId(o.getLoadBalancerId()); + opcRequestId(o.getOpcRequestId()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendRequest.java new file mode 100644 index 00000000000..a4a92da2464 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendRequest.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class GetBackendRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and server. + */ + private String loadBalancerId; + + /** + * The name of the backend set that includes the backend server. + *

+ * Example: `My backend set` + * + */ + private String backendSetName; + + /** + * The name of the backend server to retrieve. + *

+ * Example: `My backend server` + * + */ + private String backendName; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetBackendRequest o) { + loadBalancerId(o.getLoadBalancerId()); + backendSetName(o.getBackendSetName()); + backendName(o.getBackendName()); + opcRequestId(o.getOpcRequestId()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendSetRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendSetRequest.java new file mode 100644 index 00000000000..aaf6bced763 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendSetRequest.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class GetBackendSetRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the specified load balancer. + */ + private String loadBalancerId; + + /** + * The name of the backend set to retrieve. + *

+ * Example: `My backend set` + * + */ + private String backendSetName; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetBackendSetRequest o) { + loadBalancerId(o.getLoadBalancerId()); + backendSetName(o.getBackendSetName()); + opcRequestId(o.getOpcRequestId()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetHealthCheckerRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetHealthCheckerRequest.java new file mode 100644 index 00000000000..ca2219255bb --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetHealthCheckerRequest.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class GetHealthCheckerRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the health check policy to be retrieved. + */ + private String loadBalancerId; + + /** + * The name of the backend associated with the health check policy to be retrieved. + *

+ * Example: `My backend set` + * + */ + private String backendSetName; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetHealthCheckerRequest o) { + loadBalancerId(o.getLoadBalancerId()); + backendSetName(o.getBackendSetName()); + opcRequestId(o.getOpcRequestId()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetLoadBalancerRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetLoadBalancerRequest.java new file mode 100644 index 00000000000..3a96b357455 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetLoadBalancerRequest.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class GetLoadBalancerRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer to retrieve. + */ + private String loadBalancerId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetLoadBalancerRequest o) { + loadBalancerId(o.getLoadBalancerId()); + opcRequestId(o.getOpcRequestId()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetWorkRequestRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetWorkRequestRequest.java new file mode 100644 index 00000000000..d37fc1e8342 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetWorkRequestRequest.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class GetWorkRequestRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request to retrieve. + */ + private String workRequestId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetWorkRequestRequest o) { + workRequestId(o.getWorkRequestId()); + opcRequestId(o.getOpcRequestId()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListBackendSetsRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListBackendSetsRequest.java new file mode 100644 index 00000000000..276f2b60d1e --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListBackendSetsRequest.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListBackendSetsRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend sets to retrieve. + */ + private String loadBalancerId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListBackendSetsRequest o) { + loadBalancerId(o.getLoadBalancerId()); + opcRequestId(o.getOpcRequestId()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListBackendsRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListBackendsRequest.java new file mode 100644 index 00000000000..9769ad81be2 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListBackendsRequest.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListBackendsRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and servers. + */ + private String loadBalancerId; + + /** + * The name of the backend set associated with the backend servers. + *

+ * Example: `My backend set` + * + */ + private String backendSetName; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListBackendsRequest o) { + loadBalancerId(o.getLoadBalancerId()); + backendSetName(o.getBackendSetName()); + opcRequestId(o.getOpcRequestId()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListCertificatesRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListCertificatesRequest.java new file mode 100644 index 00000000000..a30398ee9aa --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListCertificatesRequest.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListCertificatesRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the certificates to be listed. + */ + private String loadBalancerId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListCertificatesRequest o) { + loadBalancerId(o.getLoadBalancerId()); + opcRequestId(o.getOpcRequestId()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListLoadBalancersRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListLoadBalancersRequest.java new file mode 100644 index 00000000000..e4bec5683dd --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListLoadBalancersRequest.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListLoadBalancersRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancers to list. + */ + private String compartmentId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The maximum number of items to return in a paginated \"List\" call. + *

+ * Example: `500` + * + */ + private Long limit; + + /** + * The value of the `opc-next-page` response header from the previous \"List\" call. + *

+ * Example: `3` + * + */ + private String page; + + /** + * The level of detail to return for each result. Can be `full` or `simple`. + *

+ * Example: `full` + * + */ + private String detail; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListLoadBalancersRequest o) { + compartmentId(o.getCompartmentId()); + opcRequestId(o.getOpcRequestId()); + limit(o.getLimit()); + page(o.getPage()); + detail(o.getDetail()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListPoliciesRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListPoliciesRequest.java new file mode 100644 index 00000000000..a7ce957a202 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListPoliciesRequest.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListPoliciesRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancer policies to list. + */ + private String compartmentId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The maximum number of items to return in a paginated \"List\" call. + *

+ * Example: `500` + * + */ + private Long limit; + + /** + * The value of the `opc-next-page` response header from the previous \"List\" call. + *

+ * Example: `3` + * + */ + private String page; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListPoliciesRequest o) { + compartmentId(o.getCompartmentId()); + opcRequestId(o.getOpcRequestId()); + limit(o.getLimit()); + page(o.getPage()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListProtocolsRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListProtocolsRequest.java new file mode 100644 index 00000000000..78cd52a93ef --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListProtocolsRequest.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListProtocolsRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancer protocols to list. + */ + private String compartmentId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The maximum number of items to return in a paginated \"List\" call. + *

+ * Example: `500` + * + */ + private Long limit; + + /** + * The value of the `opc-next-page` response header from the previous \"List\" call. + *

+ * Example: `3` + * + */ + private String page; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListProtocolsRequest o) { + compartmentId(o.getCompartmentId()); + opcRequestId(o.getOpcRequestId()); + limit(o.getLimit()); + page(o.getPage()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListShapesRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListShapesRequest.java new file mode 100644 index 00000000000..e691fd3fd39 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListShapesRequest.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListShapesRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment containing the load balancer shapes to list. + */ + private String compartmentId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The maximum number of items to return in a paginated \"List\" call. + *

+ * Example: `500` + * + */ + private Long limit; + + /** + * The value of the `opc-next-page` response header from the previous \"List\" call. + *

+ * Example: `3` + * + */ + private String page; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListShapesRequest o) { + compartmentId(o.getCompartmentId()); + opcRequestId(o.getOpcRequestId()); + limit(o.getLimit()); + page(o.getPage()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListWorkRequestsRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListWorkRequestsRequest.java new file mode 100644 index 00000000000..a114ae1a344 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListWorkRequestsRequest.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListWorkRequestsRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the work requests to retrieve. + */ + private String loadBalancerId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The maximum number of items to return in a paginated \"List\" call. + *

+ * Example: `500` + * + */ + private Long limit; + + /** + * The value of the `opc-next-page` response header from the previous \"List\" call. + *

+ * Example: `3` + * + */ + private String page; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListWorkRequestsRequest o) { + loadBalancerId(o.getLoadBalancerId()); + opcRequestId(o.getOpcRequestId()); + limit(o.getLimit()); + page(o.getPage()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendRequest.java new file mode 100644 index 00000000000..a6d3aac9459 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendRequest.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class UpdateBackendRequest { + + /** + * Details for updating a backend server. + */ + private UpdateBackendDetails updateBackendDetails; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set and server. + */ + private String loadBalancerId; + + /** + * The name of the backend set associated with the backend server. + *

+ * Example: `My backend set` + * + */ + private String backendSetName; + + /** + * The name of the backend server to update. + *

+ * Example: `My backend server` + * + */ + private String backendName; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A token that uniquely identifies a request so it can be retried in case of a timeout or + * server error without risk of executing that same action again. Retry tokens expire after 24 + * hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + * has been deleted and purged from the system, then a retry of the original creation request + * may be rejected). + * + */ + private String opcRetryToken; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateBackendRequest o) { + updateBackendDetails(o.getUpdateBackendDetails()); + loadBalancerId(o.getLoadBalancerId()); + backendSetName(o.getBackendSetName()); + backendName(o.getBackendName()); + opcRequestId(o.getOpcRequestId()); + opcRetryToken(o.getOpcRetryToken()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendSetRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendSetRequest.java new file mode 100644 index 00000000000..82230561977 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendSetRequest.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class UpdateBackendSetRequest { + + /** + * The details to update a backend set. + */ + private UpdateBackendSetDetails updateBackendSetDetails; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the backend set. + */ + private String loadBalancerId; + + /** + * The name of the backend set to update. + *

+ * Example: `My backend set` + * + */ + private String backendSetName; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A token that uniquely identifies a request so it can be retried in case of a timeout or + * server error without risk of executing that same action again. Retry tokens expire after 24 + * hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + * has been deleted and purged from the system, then a retry of the original creation request + * may be rejected). + * + */ + private String opcRetryToken; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateBackendSetRequest o) { + updateBackendSetDetails(o.getUpdateBackendSetDetails()); + loadBalancerId(o.getLoadBalancerId()); + backendSetName(o.getBackendSetName()); + opcRequestId(o.getOpcRequestId()); + opcRetryToken(o.getOpcRetryToken()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateHealthCheckerRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateHealthCheckerRequest.java new file mode 100644 index 00000000000..e6f857e9fb0 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateHealthCheckerRequest.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class UpdateHealthCheckerRequest { + + /** + * The health check policy configuration details. + */ + private UpdateHealthCheckerDetails healthChecker; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the health check policy to be updated. + */ + private String loadBalancerId; + + /** + * The name of the backend set associated with the health check policy to be retrieved. + *

+ * Example: `My backend set` + * + */ + private String backendSetName; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A token that uniquely identifies a request so it can be retried in case of a timeout or + * server error without risk of executing that same action again. Retry tokens expire after 24 + * hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + * has been deleted and purged from the system, then a retry of the original creation request + * may be rejected). + * + */ + private String opcRetryToken; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateHealthCheckerRequest o) { + healthChecker(o.getHealthChecker()); + loadBalancerId(o.getLoadBalancerId()); + backendSetName(o.getBackendSetName()); + opcRequestId(o.getOpcRequestId()); + opcRetryToken(o.getOpcRetryToken()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateListenerRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateListenerRequest.java new file mode 100644 index 00000000000..0fe30a15fb1 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateListenerRequest.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class UpdateListenerRequest { + + /** + * Details to update a listener. + */ + private UpdateListenerDetails updateListenerDetails; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the listener to update. + */ + private String loadBalancerId; + + /** + * The name of the listener to update. + *

+ * Example: `My listener` + * + */ + private String listenerName; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A token that uniquely identifies a request so it can be retried in case of a timeout or + * server error without risk of executing that same action again. Retry tokens expire after 24 + * hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + * has been deleted and purged from the system, then a retry of the original creation request + * may be rejected). + * + */ + private String opcRetryToken; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateListenerRequest o) { + updateListenerDetails(o.getUpdateListenerDetails()); + loadBalancerId(o.getLoadBalancerId()); + listenerName(o.getListenerName()); + opcRequestId(o.getOpcRequestId()); + opcRetryToken(o.getOpcRetryToken()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateLoadBalancerRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateLoadBalancerRequest.java new file mode 100644 index 00000000000..aab513bd475 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateLoadBalancerRequest.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import java.io.*; +import java.util.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.model.*; +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class UpdateLoadBalancerRequest { + + /** + * The details for updating a load balancer's configuration. + */ + private UpdateLoadBalancerDetails updateLoadBalancerDetails; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer to update. + */ + private String loadBalancerId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A token that uniquely identifies a request so it can be retried in case of a timeout or + * server error without risk of executing that same action again. Retry tokens expire after 24 + * hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + * has been deleted and purged from the system, then a retry of the original creation request + * may be rejected). + * + */ + private String opcRetryToken; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateLoadBalancerRequest o) { + updateLoadBalancerDetails(o.getUpdateLoadBalancerDetails()); + loadBalancerId(o.getLoadBalancerId()); + opcRequestId(o.getOpcRequestId()); + opcRetryToken(o.getOpcRetryToken()); + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateBackendResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateBackendResponse.java new file mode 100644 index 00000000000..32cfbd5e81c --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateBackendResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class CreateBackendResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateBackendResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateBackendSetResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateBackendSetResponse.java new file mode 100644 index 00000000000..848a17f6425 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateBackendSetResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class CreateBackendSetResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateBackendSetResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateCertificateResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateCertificateResponse.java new file mode 100644 index 00000000000..d82ba94b5e9 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateCertificateResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class CreateCertificateResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateCertificateResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateListenerResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateListenerResponse.java new file mode 100644 index 00000000000..26f2cc5d654 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateListenerResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class CreateListenerResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateListenerResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateLoadBalancerResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateLoadBalancerResponse.java new file mode 100644 index 00000000000..9940a2011e3 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateLoadBalancerResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class CreateLoadBalancerResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateLoadBalancerResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteBackendResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteBackendResponse.java new file mode 100644 index 00000000000..fda664bf432 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteBackendResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class DeleteBackendResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteBackendResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteBackendSetResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteBackendSetResponse.java new file mode 100644 index 00000000000..ab7b2267759 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteBackendSetResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class DeleteBackendSetResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteBackendSetResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteCertificateResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteCertificateResponse.java new file mode 100644 index 00000000000..312a3c65128 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteCertificateResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class DeleteCertificateResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteCertificateResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteListenerResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteListenerResponse.java new file mode 100644 index 00000000000..6c5ee3e5264 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteListenerResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class DeleteListenerResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteListenerResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteLoadBalancerResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteLoadBalancerResponse.java new file mode 100644 index 00000000000..89d1ab1c845 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteLoadBalancerResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class DeleteLoadBalancerResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteLoadBalancerResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetBackendResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetBackendResponse.java new file mode 100644 index 00000000000..16a77a385d5 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetBackendResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class GetBackendResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned Backend instance. + */ + private Backend backend; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetBackendResponse o) { + opcRequestId(o.getOpcRequestId()); + backend(o.getBackend()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetBackendSetResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetBackendSetResponse.java new file mode 100644 index 00000000000..ba4d4cc7a17 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetBackendSetResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class GetBackendSetResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned BackendSet instance. + */ + private BackendSet backendSet; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetBackendSetResponse o) { + opcRequestId(o.getOpcRequestId()); + backendSet(o.getBackendSet()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetHealthCheckerResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetHealthCheckerResponse.java new file mode 100644 index 00000000000..7e695f27c38 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetHealthCheckerResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class GetHealthCheckerResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned HealthChecker instance. + */ + private HealthChecker healthChecker; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetHealthCheckerResponse o) { + opcRequestId(o.getOpcRequestId()); + healthChecker(o.getHealthChecker()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetLoadBalancerResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetLoadBalancerResponse.java new file mode 100644 index 00000000000..a7dc693e7e9 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetLoadBalancerResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class GetLoadBalancerResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned LoadBalancer instance. + */ + private LoadBalancer loadBalancer; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetLoadBalancerResponse o) { + opcRequestId(o.getOpcRequestId()); + loadBalancer(o.getLoadBalancer()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetWorkRequestResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetWorkRequestResponse.java new file mode 100644 index 00000000000..04597dfada5 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetWorkRequestResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class GetWorkRequestResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned WorkRequest instance. + */ + private WorkRequest workRequest; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetWorkRequestResponse o) { + opcRequestId(o.getOpcRequestId()); + workRequest(o.getWorkRequest()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListBackendSetsResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListBackendSetsResponse.java new file mode 100644 index 00000000000..257d724f0ee --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListBackendSetsResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListBackendSetsResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of BackendSet instances. + */ + private List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListBackendSetsResponse o) { + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListBackendsResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListBackendsResponse.java new file mode 100644 index 00000000000..485a1318313 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListBackendsResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListBackendsResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of Backend instances. + */ + private List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListBackendsResponse o) { + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListCertificatesResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListCertificatesResponse.java new file mode 100644 index 00000000000..3e443d67b4e --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListCertificatesResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListCertificatesResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of Certificate instances. + */ + private List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListCertificatesResponse o) { + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListLoadBalancersResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListLoadBalancersResponse.java new file mode 100644 index 00000000000..96cb8a94bfc --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListLoadBalancersResponse.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListLoadBalancersResponse { + + /** + * For pagination of a list of items. When paging through a list, if this header appears in the response, + * then a partial list might have been returned. Include this value as the `page` parameter for the + * subsequent GET request to get the next batch of items. + * + */ + private String opcNextPage; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of LoadBalancer instances. + */ + private List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListLoadBalancersResponse o) { + opcNextPage(o.getOpcNextPage()); + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListPoliciesResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListPoliciesResponse.java new file mode 100644 index 00000000000..8475ee61129 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListPoliciesResponse.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListPoliciesResponse { + + /** + * For pagination of a list of items. When paging through a list, if this header appears in the response, + * then a partial list might have been returned. Include this value as the `page` parameter for the + * subsequent GET request to get the next batch of items. + * + */ + private String opcNextPage; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of LoadBalancerPolicy instances. + */ + private List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListPoliciesResponse o) { + opcNextPage(o.getOpcNextPage()); + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListProtocolsResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListProtocolsResponse.java new file mode 100644 index 00000000000..a442b9b6868 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListProtocolsResponse.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListProtocolsResponse { + + /** + * For pagination of a list of items. When paging through a list, if this header appears in the response, + * then a partial list might have been returned. Include this value as the `page` parameter for the + * subsequent GET request to get the next batch of items. + * + */ + private String opcNextPage; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of LoadBalancerProtocol instances. + */ + private List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListProtocolsResponse o) { + opcNextPage(o.getOpcNextPage()); + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListShapesResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListShapesResponse.java new file mode 100644 index 00000000000..c19d1f389d9 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListShapesResponse.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListShapesResponse { + + /** + * For pagination of a list of items. When paging through a list, if this header appears in the response, + * then a partial list might have been returned. Include this value as the `page` parameter for the + * subsequent GET request to get the next batch of items. + * + */ + private String opcNextPage; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of LoadBalancerShape instances. + */ + private List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListShapesResponse o) { + opcNextPage(o.getOpcNextPage()); + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListWorkRequestsResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListWorkRequestsResponse.java new file mode 100644 index 00000000000..dfa19b545af --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListWorkRequestsResponse.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class ListWorkRequestsResponse { + + /** + * For pagination of a list of items. When paging through a list, if this header appears in the response, + * then a partial list might have been returned. Include this value as the `page` parameter for the + * subsequent GET request to get the next batch of items. + * + */ + private String opcNextPage; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of WorkRequest instances. + */ + private List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListWorkRequestsResponse o) { + opcNextPage(o.getOpcNextPage()); + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateBackendResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateBackendResponse.java new file mode 100644 index 00000000000..963ff89a334 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateBackendResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class UpdateBackendResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateBackendResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateBackendSetResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateBackendSetResponse.java new file mode 100644 index 00000000000..cbe5f031ae5 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateBackendSetResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class UpdateBackendSetResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateBackendSetResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateHealthCheckerResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateHealthCheckerResponse.java new file mode 100644 index 00000000000..7e97fef540d --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateHealthCheckerResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class UpdateHealthCheckerResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateHealthCheckerResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateListenerResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateListenerResponse.java new file mode 100644 index 00000000000..ed81aab7473 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateListenerResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class UpdateListenerResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateListenerResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateLoadBalancerResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateLoadBalancerResponse.java new file mode 100644 index 00000000000..6aac98f89c0 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateLoadBalancerResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import java.io.*; +import java.util.*; + +import com.oracle.bmc.model.*; +import javax.ws.rs.core.*; + +import lombok.Builder; +import lombok.Getter; +import lombok.experimental.Accessors; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@Builder(builderClassName = "Builder") +@Getter +public class UpdateLoadBalancerResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateLoadBalancerResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-objectstorage/pom.xml b/bmc-objectstorage/pom.xml index b0cb5fd855f..590692c3d06 100644 --- a/bmc-objectstorage/pom.xml +++ b/bmc-objectstorage/pom.xml @@ -5,7 +5,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk - 1.2.5 + 1.2.7 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk-common - 1.2.5 + 1.2.7 diff --git a/bmc-objectstorage/src/main/java/com/oracle/bmc/objectstorage/transfer/MultipartObjectAssembler.java b/bmc-objectstorage/src/main/java/com/oracle/bmc/objectstorage/transfer/MultipartObjectAssembler.java index 2e2fe1cdcc6..21799077e1a 100644 --- a/bmc-objectstorage/src/main/java/com/oracle/bmc/objectstorage/transfer/MultipartObjectAssembler.java +++ b/bmc-objectstorage/src/main/java/com/oracle/bmc/objectstorage/transfer/MultipartObjectAssembler.java @@ -123,7 +123,7 @@ public synchronized MultipartManifest newRequest( .build()) .opcClientRequestId(createClientRequestId("-create")) .build()); - + this.manifest = new MultipartManifestImpl(createUploadResponse.getMultipartUpload().getUploadId()); this.transferManager = @@ -372,7 +372,7 @@ private synchronized void validateState(boolean allowAborted) { private synchronized void validateState() { validateState(false); } - + // client request ID is limited to 40 chars private String createClientRequestId(String suffix) { if (opcClientRequestId == null) { @@ -380,7 +380,9 @@ private String createClientRequestId(String suffix) { } if (opcClientRequestId.length() > MAX_CLIENT_REQUEST_ID_LENGTH) { String truncatedUserId = opcClientRequestId.substring(0, MAX_CLIENT_REQUEST_ID_LENGTH); - LOG.debug("Client request ID too long, truncating to '{}' to avoid errors", truncatedUserId); + LOG.debug( + "Client request ID too long, truncating to '{}' to avoid errors", + truncatedUserId); return truncatedUserId; } String newClientRequestId = opcClientRequestId + suffix; diff --git a/pom.xml b/pom.xml index 60f94334eeb..8be980a0de5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.oracle.bmc.sdk oracle-bmc-java-sdk - 1.2.5 + 1.2.7 pom Oracle Bare Metal Cloud Services SDK @@ -431,6 +431,7 @@ bmc-core bmc-examples bmc-identity + bmc-loadbalancer bmc-objectstorage