diff --git a/CHANGELOG.md b/CHANGELOG.md index dd1d60e04..cf06d948d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,21 @@ - `postgresflex`: [v1.3.0](services/postgresflex/CHANGELOG.md#v130) - **Breaking Change:** The attribute type for `PartialUpdateInstancePayload` and `UpdateInstancePayload` changed from `Storage` to `StorageUpdate`. - **Deprecation:** `StorageUpdate`: updating the performance class field is not possible. +- `iaas`: [v1.0.0](services/iaas/CHANGELOG.md#v100) + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + - **Feature:** Add new methods to manage routing tables: `AddRoutingTableToArea`, `DeleteRoutingTableFromArea`, `GetRoutingTableOfArea`, `ListRoutingTablesOfArea`, `UpdateRoutingTableOfArea` + - **Feature:** Add new methods to manage routes in routing tables: `AddRoutesToRoutingTable`, `DeleteRouteFromRoutingTable`, `GetRouteOfRoutingTable`, `ListRoutesOfRoutingTable`, `UpdateRouteOfRoutingTable` + - **Breaking Change:** Add new method to manage network area regions: `CreateNetworkAreaRegion`, `DeleteNetworkAreaRegion`, `GetNetworkAreaRegion`, `ListNetworkAreaRegions`, `UpdateNetworkAreaRegion` + - **Feature:** Add new wait handler for network area region: `CreateNetworkAreaRegionWaitHandler` and `DeleteRegionalNetworkAreaConfigurationWaitHandler` + - **Breaking Change:** Wait handler which relates to region-specific services, got an additional param for the region: `CreateNetworkWaitHandler`, `UpdateNetworkWaitHandler`, `DeleteNetworkWaitHandler`, `CreateVolumeWaitHandler`, `DeleteVolumeWaitHandler`, `CreateServerWaitHandler`, `ResizeServerWaitHandler`, `DeleteServerWaitHandler`, `StartServerWaitHandler`, `StopServerWaitHandler`, `DeallocateServerWaitHandler`, `RescueServerWaitHandler`, `UnrescueServerWaitHandler`, `ProjectRequestWaitHandler`, `AddVolumeToServerWaitHandler`, `RemoveVolumeFromServerWaitHandler`, `UploadImageWaitHandler`, `DeleteImageWaitHandler`, `CreateBackupWaitHandler`, `DeleteBackupWaitHandler`, `RestoreBackupWaitHandler`, `CreateSnapshotWaitHandler`, `DeleteSnapshotWaitHandler` + - **Breaking Change:** `Network` model has changed: + - `NetworkId` has been renamed to `Id` + - `Gateway`, `Nameservers`, `Prefixes` and `PublicIp` has been moved to new model `NetworkIPv4`, and can be accessed in the new property `IPv4` + - Properties `Gatewayv6`, `Nameserversv6` and `Prefixesv6` moved to new model `NetworkIPv6`, and can be accessed in the new property `IPv6` + - **Breaking Change:** `CreateServerPayload` model has changed: + - Model `CreateServerPayloadBootVolume` of `BootVolume` property changed to `ServerBootVolume` + - Property `Networking` in `CreateServerPayload` is required now + - **Deprecated:** Deprecated wait handler and will be removed after April 2026: `CreateNetworkAreaWaitHandler`, `UpdateNetworkAreaWaitHandler` and `DeleteNetworkAreaWaitHandler` ## Release (2025-10-13) - `observability`: [v0.15.0](services/observability/CHANGELOG.md#v0150) diff --git a/examples/iaas/attach_nic/attach_nic.go b/examples/iaas/attach_nic/attach_nic.go index f793b92ac..a0f5a1a24 100644 --- a/examples/iaas/attach_nic/attach_nic.go +++ b/examples/iaas/attach_nic/attach_nic.go @@ -6,22 +6,20 @@ import ( "net/http" "os" - "github.com/stackitcloud/stackit-sdk-go/core/config" "github.com/stackitcloud/stackit-sdk-go/core/runtime" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" ) func main() { - // Specify the organization ID and project ID + // Specify the project ID, server ID, nic ID and region projectId := "PROJECT_ID" // the uuid of your STACKIT project serverId := "SERVER_ID" nicId := "NIC_ID" + region := "eu01" // Create a new API client, that uses default authentication and configuration - iaasClient, err := iaas.NewAPIClient( - config.WithRegion("eu01"), - ) + iaasClient, err := iaas.NewAPIClient() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Creating API client: %v\n", err) os.Exit(1) @@ -30,7 +28,7 @@ func main() { // Attach an existing network interface to an existing server var httpResp *http.Response ctxWithHTTPResp := runtime.WithCaptureHTTPResponse(context.Background(), &httpResp) - err = iaasClient.AddNicToServer(ctxWithHTTPResp, projectId, serverId, nicId).Execute() + err = iaasClient.AddNicToServer(ctxWithHTTPResp, projectId, region, serverId, nicId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `AddNICToServer`: %v\n", err) } else { @@ -39,7 +37,7 @@ func main() { requestId := httpResp.Header[wait.XRequestIDHeader][0] // Wait for attachment of the nic - _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, requestId).WaitWithContext(context.Background()) + _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, region, requestId).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for attachment: %v\n", err) os.Exit(1) @@ -47,7 +45,7 @@ func main() { fmt.Printf("[iaas API] Nic %q has been successfully attached to the server %s.\n", nicId, serverId) - err = iaasClient.RemoveNicFromServer(ctxWithHTTPResp, projectId, serverId, nicId).Execute() + err = iaasClient.RemoveNicFromServer(ctxWithHTTPResp, projectId, region, serverId, nicId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `RemoveNICFromServer`: %v\n", err) } else { @@ -57,7 +55,7 @@ func main() { requestId = httpResp.Header[wait.XRequestIDHeader][0] // Wait for dettachment of the nic - _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, requestId).WaitWithContext(context.Background()) + _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, region, requestId).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for removal of attachment of NIC: %v\n", err) os.Exit(1) diff --git a/examples/iaas/attach_public_ip/attach_public_ip.go b/examples/iaas/attach_public_ip/attach_public_ip.go index e24bd539c..b757b730b 100644 --- a/examples/iaas/attach_public_ip/attach_public_ip.go +++ b/examples/iaas/attach_public_ip/attach_public_ip.go @@ -6,22 +6,20 @@ import ( "net/http" "os" - "github.com/stackitcloud/stackit-sdk-go/core/config" "github.com/stackitcloud/stackit-sdk-go/core/runtime" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" ) func main() { - // Specify the organization ID and project ID + // Specify the project ID, server ID, public ip ID and region projectId := "PROJECT_ID" // the uuid of your STACKIT project serverId := "SERVER_ID" publicIpId := "PUBLIC_IP_ID" + region := "eu01" // Create a new API client, that uses default authentication and configuration - iaasClient, err := iaas.NewAPIClient( - config.WithRegion("eu01"), - ) + iaasClient, err := iaas.NewAPIClient() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Creating API client: %v\n", err) os.Exit(1) @@ -30,7 +28,7 @@ func main() { // Attach an existing network interface to an existing server var httpResp *http.Response ctxWithHTTPResp := runtime.WithCaptureHTTPResponse(context.Background(), &httpResp) - err = iaasClient.AddPublicIpToServer(ctxWithHTTPResp, projectId, serverId, publicIpId).Execute() + err = iaasClient.AddPublicIpToServer(ctxWithHTTPResp, projectId, region, serverId, publicIpId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `AddPublicIpToServer`: %v\n", err) } else { @@ -39,7 +37,7 @@ func main() { requestId := httpResp.Header[wait.XRequestIDHeader][0] // Wait for attachment of the public ip - _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, requestId).WaitWithContext(context.Background()) + _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, region, requestId).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for attachment: %v\n", err) os.Exit(1) @@ -47,7 +45,7 @@ func main() { fmt.Printf("[iaas API] Public IP %q has been successfully attached to the server %s.\n", publicIpId, serverId) - err = iaasClient.RemovePublicIpFromServer(ctxWithHTTPResp, projectId, serverId, publicIpId).Execute() + err = iaasClient.RemovePublicIpFromServer(ctxWithHTTPResp, projectId, region, serverId, publicIpId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `RemovePublicIpFromServer`: %v\n", err) } else { @@ -57,7 +55,7 @@ func main() { requestId = httpResp.Header[wait.XRequestIDHeader][0] // Wait for dettachment of the public ip - _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, requestId).WaitWithContext(context.Background()) + _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, region, requestId).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for removal of attachment of PublicIp: %v\n", err) os.Exit(1) diff --git a/examples/iaas/attach_security_group/attach_security_group.go b/examples/iaas/attach_security_group/attach_security_group.go index d5416d1c9..60cc6865e 100644 --- a/examples/iaas/attach_security_group/attach_security_group.go +++ b/examples/iaas/attach_security_group/attach_security_group.go @@ -6,22 +6,20 @@ import ( "net/http" "os" - "github.com/stackitcloud/stackit-sdk-go/core/config" "github.com/stackitcloud/stackit-sdk-go/core/runtime" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" ) func main() { - // Specify the organization ID and project ID + // Specify the project ID, server ID, security group ID and region projectId := "PROJECT_ID" // the uuid of your STACKIT project serverId := "SERVER_ID" securityGroupId := "SECURITY_GROUP_ID" + region := "eu01" // Create a new API client, that uses default authentication and configuration - iaasClient, err := iaas.NewAPIClient( - config.WithRegion("eu01"), - ) + iaasClient, err := iaas.NewAPIClient() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Creating API client: %v\n", err) os.Exit(1) @@ -30,7 +28,7 @@ func main() { // Attach an existing network interface to an existing server var httpResp *http.Response ctxWithHTTPResp := runtime.WithCaptureHTTPResponse(context.Background(), &httpResp) - err = iaasClient.AddSecurityGroupToServer(ctxWithHTTPResp, projectId, serverId, securityGroupId).Execute() + err = iaasClient.AddSecurityGroupToServer(ctxWithHTTPResp, projectId, region, serverId, securityGroupId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `AddSecurityGroupToServer`: %v\n", err) } else { @@ -39,7 +37,7 @@ func main() { requestId := httpResp.Header[wait.XRequestIDHeader][0] // Wait for attachment of the security group - _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, requestId).WaitWithContext(context.Background()) + _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, region, requestId).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for attachment: %v\n", err) os.Exit(1) @@ -47,7 +45,7 @@ func main() { fmt.Printf("[iaas API] Security group %q has been successfully attached to the server %s.\n", securityGroupId, serverId) - err = iaasClient.RemoveSecurityGroupFromServer(ctxWithHTTPResp, projectId, serverId, securityGroupId).Execute() + err = iaasClient.RemoveSecurityGroupFromServer(ctxWithHTTPResp, projectId, region, serverId, securityGroupId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `RemoveSecurityGroupFromServer`: %v\n", err) } else { @@ -57,7 +55,7 @@ func main() { requestId = httpResp.Header[wait.XRequestIDHeader][0] // Wait for dettachment of the security group - _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, requestId).WaitWithContext(context.Background()) + _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, region, requestId).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for removal of attachment of SecurityGroup: %v\n", err) os.Exit(1) diff --git a/examples/iaas/attach_service_account/attach_service_account.go b/examples/iaas/attach_service_account/attach_service_account.go index 9ac303fe1..0833a18a5 100644 --- a/examples/iaas/attach_service_account/attach_service_account.go +++ b/examples/iaas/attach_service_account/attach_service_account.go @@ -6,22 +6,20 @@ import ( "net/http" "os" - "github.com/stackitcloud/stackit-sdk-go/core/config" "github.com/stackitcloud/stackit-sdk-go/core/runtime" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" ) func main() { - // Specify the organization ID and project ID + // Specify the project ID, server ID, service account mail and region projectId := "PROJECT_ID" // the uuid of your STACKIT project serverId := "SERVER_ID" serviceAccountMail := "SERVICE_ACCOUNT_MAIL" + region := "eu01" // Create a new API client, that uses default authentication and configuration - iaasClient, err := iaas.NewAPIClient( - config.WithRegion("eu01"), - ) + iaasClient, err := iaas.NewAPIClient() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Creating API client: %v\n", err) os.Exit(1) @@ -30,7 +28,7 @@ func main() { // Attach an existing service account to an existing server var httpResp *http.Response ctxWithHTTPResp := runtime.WithCaptureHTTPResponse(context.Background(), &httpResp) - _, err = iaasClient.AddServiceAccountToServer(ctxWithHTTPResp, projectId, serverId, serviceAccountMail).Execute() + _, err = iaasClient.AddServiceAccountToServer(ctxWithHTTPResp, projectId, region, serverId, serviceAccountMail).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `AddServiceAccountToServer`: %v\n", err) } else { @@ -39,7 +37,7 @@ func main() { requestId := httpResp.Header[wait.XRequestIDHeader][0] // Wait for attachment of the service account - _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, requestId).WaitWithContext(context.Background()) + _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, region, requestId).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for attachment: %v\n", err) os.Exit(1) @@ -47,7 +45,7 @@ func main() { fmt.Printf("[iaas API] Service account %q has been successfully attached to the server %s.\n", serviceAccountMail, serverId) - _, err = iaasClient.RemoveServiceAccountFromServer(ctxWithHTTPResp, projectId, serverId, serviceAccountMail).Execute() + _, err = iaasClient.RemoveServiceAccountFromServer(ctxWithHTTPResp, projectId, region, serverId, serviceAccountMail).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `RemoveServiceAccountFromServer`: %v\n", err) } else { @@ -57,7 +55,7 @@ func main() { requestId = httpResp.Header[wait.XRequestIDHeader][0] // Wait for dettachment of the service account - _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, requestId).WaitWithContext(context.Background()) + _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, region, requestId).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for removal of attachment of service account: %v\n", err) os.Exit(1) diff --git a/examples/iaas/attach_volume/attach_volume.go b/examples/iaas/attach_volume/attach_volume.go index 0b10cac08..6b0fea0d2 100644 --- a/examples/iaas/attach_volume/attach_volume.go +++ b/examples/iaas/attach_volume/attach_volume.go @@ -5,28 +5,26 @@ import ( "fmt" "os" - "github.com/stackitcloud/stackit-sdk-go/core/config" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" ) func main() { - // Specify the organization ID and project ID + // Specify the project ID, server ID, volume ID and region projectId := "PROJECT_ID" // the uuid of your STACKIT project serverId := "SERVER_ID" volumeId := "VOLUME_ID" + region := "eu01" // Create a new API client, that uses default authentication and configuration - iaasClient, err := iaas.NewAPIClient( - config.WithRegion("eu01"), - ) + iaasClient, err := iaas.NewAPIClient() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Creating API client: %v\n", err) os.Exit(1) } payload := iaas.AddVolumeToServerPayload{} - _, err = iaasClient.AddVolumeToServer(context.Background(), projectId, serverId, volumeId).AddVolumeToServerPayload(payload).Execute() + _, err = iaasClient.AddVolumeToServer(context.Background(), projectId, region, serverId, volumeId).AddVolumeToServerPayload(payload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `AddVolumeToServer`: %v\n", err) } else { @@ -34,7 +32,7 @@ func main() { } // Wait for attachment of the volume - _, err = wait.AddVolumeToServerWaitHandler(context.Background(), iaasClient, projectId, serverId, volumeId).WaitWithContext(context.Background()) + _, err = wait.AddVolumeToServerWaitHandler(context.Background(), iaasClient, projectId, region, serverId, volumeId).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for attachment: %v\n", err) os.Exit(1) @@ -42,7 +40,7 @@ func main() { fmt.Printf("[iaas API] Volume %q has been successfully attached to the server %s.\n", volumeId, serverId) - err = iaasClient.RemoveVolumeFromServer(context.Background(), projectId, serverId, volumeId).Execute() + err = iaasClient.RemoveVolumeFromServer(context.Background(), projectId, region, serverId, volumeId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `RemoveVolumeFromServer`: %v\n", err) } else { @@ -50,7 +48,7 @@ func main() { } // Wait for dettachment of the volume - _, err = wait.RemoveVolumeFromServerWaitHandler(context.Background(), iaasClient, projectId, serverId, volumeId).WaitWithContext(context.Background()) + _, err = wait.RemoveVolumeFromServerWaitHandler(context.Background(), iaasClient, projectId, region, serverId, volumeId).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for removal of attachment of volume: %v\n", err) os.Exit(1) diff --git a/examples/iaas/network/network.go b/examples/iaas/network/network.go index cd0b1b565..192536fc4 100644 --- a/examples/iaas/network/network.go +++ b/examples/iaas/network/network.go @@ -5,20 +5,18 @@ import ( "fmt" "os" - "github.com/stackitcloud/stackit-sdk-go/core/config" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" ) func main() { - // Specify the organization ID and project ID + // Specify the project ID and region projectId := "PROJECT_ID" // the uuid of your STACKIT project + region := "eu01" // Create a new API client, that uses default authentication and configuration - iaasClient, err := iaas.NewAPIClient( - config.WithRegion("eu01"), - ) + iaasClient, err := iaas.NewAPIClient() if err != nil { fmt.Fprintf(os.Stderr, "[IaaS API] Creating API client: %v\n", err) os.Exit(1) @@ -27,25 +25,25 @@ func main() { // Create a network createNetworkPayload := iaas.CreateNetworkPayload{ Name: utils.Ptr("example-network"), - AddressFamily: &iaas.CreateNetworkAddressFamily{ - Ipv4: &iaas.CreateNetworkIPv4Body{ - PrefixLength: utils.Ptr(int64(24)), + Ipv4: &iaas.CreateNetworkIPv4{ + CreateNetworkIPv4WithPrefixLength: &iaas.CreateNetworkIPv4WithPrefixLength{ Nameservers: &[]string{"1.2.3.4"}, + PrefixLength: utils.Ptr(int64(24)), }, }, } - network, err := iaasClient.CreateNetwork(context.Background(), projectId).CreateNetworkPayload(createNetworkPayload).Execute() + network, err := iaasClient.CreateNetwork(context.Background(), projectId, region).CreateNetworkPayload(createNetworkPayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `CreateNetwork`: %v\n", err) os.Exit(1) } - fmt.Printf("[IaaS API] Triggered creation of network with ID %q.\n", *network.NetworkId) - fmt.Printf("[Iaas API] Current state of the network: %q\n", *network.State) + fmt.Printf("[IaaS API] Triggered creation of network with ID %q.\n", *network.Id) + fmt.Printf("[Iaas API] Current state of the network: %q\n", *network.Status) fmt.Println("[Iaas API] Waiting for network to be created...") - network, err = wait.CreateNetworkWaitHandler(context.Background(), iaasClient, projectId, *network.NetworkId).WaitWithContext(context.Background()) + network, err = wait.CreateNetworkWaitHandler(context.Background(), iaasClient, projectId, region, *network.Id).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[IaaS API] Error when waiting for creation: %v\n", err) os.Exit(1) @@ -58,13 +56,13 @@ func main() { Name: utils.Ptr("example-network-test-renamed"), } - err = iaasClient.PartialUpdateNetwork(context.Background(), projectId, *network.NetworkId).PartialUpdateNetworkPayload(updateNetworkPayload).Execute() + err = iaasClient.PartialUpdateNetwork(context.Background(), projectId, region, *network.Id).PartialUpdateNetworkPayload(updateNetworkPayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `PartialUpdateNetwork`: %v\n", err) os.Exit(1) } - _, err = wait.UpdateNetworkWaitHandler(context.Background(), iaasClient, projectId, *network.NetworkId).WaitWithContext(context.Background()) + _, err = wait.UpdateNetworkWaitHandler(context.Background(), iaasClient, projectId, region, *network.Id).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[IaaS API] Error when waiting for update: %v\n", err) os.Exit(1) @@ -73,13 +71,13 @@ func main() { fmt.Printf("[IaaS API] Network has been successfully updated.\n") // Delete a network - err = iaasClient.DeleteNetwork(context.Background(), projectId, *network.NetworkId).Execute() + err = iaasClient.DeleteNetwork(context.Background(), projectId, region, *network.Id).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `DeleteNetwork`: %v\n", err) os.Exit(1) } - _, err = wait.DeleteNetworkWaitHandler(context.Background(), iaasClient, projectId, *network.NetworkId).WaitWithContext(context.Background()) + _, err = wait.DeleteNetworkWaitHandler(context.Background(), iaasClient, projectId, region, *network.Id).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[IaaS API] Error when waiting for deletion: %v\n", err) os.Exit(1) diff --git a/examples/iaas/network_area/network_area.go b/examples/iaas/network_area/network_area.go index 8d3cbd5e7..a60f02a9d 100644 --- a/examples/iaas/network_area/network_area.go +++ b/examples/iaas/network_area/network_area.go @@ -5,20 +5,18 @@ import ( "fmt" "os" - "github.com/stackitcloud/stackit-sdk-go/core/config" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" ) func main() { - // Specify the organization ID and project ID + // Specify the organization ID and region organizationId := "ORGANIZATION_ID" + region := "eu01" // Create a new API client, that uses default authentication and configuration - iaasClient, err := iaas.NewAPIClient( - config.WithRegion("eu01"), - ) + iaasClient, err := iaas.NewAPIClient() if err != nil { fmt.Fprintf(os.Stderr, "[IaaS API] Creating API client: %v\n", err) os.Exit(1) @@ -30,77 +28,107 @@ func main() { if err != nil { fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `ListNetworkAreas`: %v\n", err) - } else { - fmt.Printf("[IaaS API] Number of network areas: %v\n", len(*areas.Items)) + os.Exit(1) } + fmt.Printf("[IaaS API] Number of network areas: %v\n", len(*areas.Items)) // Create a network area createNetworkAreaPayload := iaas.CreateNetworkAreaPayload{ Name: utils.Ptr("example-network-area"), - AddressFamily: &iaas.CreateAreaAddressFamily{ - Ipv4: &iaas.CreateAreaIPv4{ - DefaultPrefixLen: utils.Ptr(int64(25)), - MaxPrefixLen: utils.Ptr(int64(29)), - MinPrefixLen: utils.Ptr(int64(24)), - NetworkRanges: &[]iaas.NetworkRange{ - { - Prefix: utils.Ptr("1.2.3.4/24"), - }, - }, - TransferNetwork: utils.Ptr("1.2.4.5/24"), - }, + Labels: &map[string]interface{}{ + "key": "value", }, } area, err := iaasClient.CreateNetworkArea(context.Background(), organizationId).CreateNetworkAreaPayload(createNetworkAreaPayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `CreateNetworkAreas`: %v\n", err) } else { - fmt.Printf("[IaaS API] Triggered creation of network area with ID %q.\n", *area.AreaId) - } - - // Wait for creation of the network area - _, err = wait.CreateNetworkAreaWaitHandler(context.Background(), iaasClient, organizationId, *area.AreaId).WaitWithContext(context.Background()) - if err != nil { - fmt.Fprintf(os.Stderr, "[IaaS API] Error when waiting for creation: %v\n", err) - os.Exit(1) + fmt.Printf("[IaaS API] Created network area with ID %q.\n", *area.Id) } - fmt.Printf("[IaaS API] Network area %q has been successfully created.\n", *area.AreaId) + fmt.Printf("[IaaS API] Network area %q has been successfully created.\n", *area.Id) // Update a network area updateNetworkAreaPayload := iaas.PartialUpdateNetworkAreaPayload{ Name: utils.Ptr(*area.Name + "-renamed"), } - updatedArea, err := iaasClient.PartialUpdateNetworkArea(context.Background(), organizationId, *area.AreaId).PartialUpdateNetworkAreaPayload(updateNetworkAreaPayload).Execute() + updatedArea, err := iaasClient.PartialUpdateNetworkArea(context.Background(), organizationId, *area.Id).PartialUpdateNetworkAreaPayload(updateNetworkAreaPayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `PartialUpdateNetworkArea`: %v\n", err) } else { - fmt.Printf("[IaaS API] Triggered update of network area with ID %q.\n", *updatedArea.AreaId) + fmt.Printf("[IaaS API] Updated network area with ID %q.\n", *updatedArea.Id) + } + + fmt.Printf("[IaaS API] Network area %q has been successfully updated.\n", *updatedArea.Id) + + // Create a network area region + createNetworkAreaRegionPayload := iaas.CreateNetworkAreaRegionPayload{ + Ipv4: &iaas.RegionalAreaIPv4{ + DefaultNameservers: &[]string{ + "1.2.3.4", + }, + DefaultPrefixLen: utils.Ptr(int64(25)), + MaxPrefixLen: utils.Ptr(int64(29)), + MinPrefixLen: utils.Ptr(int64(24)), + NetworkRanges: &[]iaas.NetworkRange{ + { + Prefix: utils.Ptr("1.2.3.0/24"), + }, + }, + TransferNetwork: utils.Ptr("1.2.4.0/24"), + }, + } + + resp, err := iaasClient.CreateNetworkAreaRegion(context.Background(), organizationId, *updatedArea.Id, region).CreateNetworkAreaRegionPayload(createNetworkAreaRegionPayload).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `ConfigureNetworkAreaRegion`: %v\n", err) + } else { + fmt.Printf("[IaaS API] Triggered configuration of network area with ID %q.\n", *updatedArea.Id) } + fmt.Printf("[IaaS API] Status of updated network area config %q.\n", *resp.Status) - // Wait for update of the network area - _, err = wait.UpdateNetworkAreaWaitHandler(context.Background(), iaasClient, organizationId, *updatedArea.AreaId).WaitWithContext(context.Background()) + _, err = wait.CreateNetworkAreaRegionWaitHandler(context.Background(), iaasClient, organizationId, *updatedArea.Id, region).WaitWithContext(context.Background()) if err != nil { - fmt.Fprintf(os.Stderr, "[IaaS API] Error when waiting for update: %v\n", err) + fmt.Fprintf(os.Stderr, "[IaaS API] Error when waiting for network configuration creation: %v\n", err) os.Exit(1) } + fmt.Printf("[IaaS API] Network area %q configuration for region %q has been successfully created.\n", *updatedArea.Id, region) - fmt.Printf("[IaaS API] Network area %q has been successfully updated.\n", *updatedArea.AreaId) + // Update a network area configuration + updateConfigNetworkAreaPayload := iaas.UpdateNetworkAreaRegionPayload{ + Ipv4: &iaas.UpdateRegionalAreaIPv4{ + DefaultNameservers: &[]string{ + "2.2.3.4", + }, + DefaultPrefixLen: utils.Ptr(int64(26)), + }, + } - // Delete a network area - err = iaasClient.DeleteNetworkArea(context.Background(), organizationId, *updatedArea.AreaId).Execute() + _, err = iaasClient.UpdateNetworkAreaRegion(context.Background(), organizationId, *updatedArea.Id, region).UpdateNetworkAreaRegionPayload(updateConfigNetworkAreaPayload).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `DeleteNetworkArea`: %v\n", err) + fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `UpdateNetworkAreaRegion`: %v\n", err) } else { - fmt.Printf("[IaaS API] Triggered deletion of network area with ID %q.\n", *updatedArea.AreaId) + fmt.Printf("[IaaS API] Network area %q configuration for region %q has been successfully updated.\n", *updatedArea.Id, region) } - // Wait for deletion of the network area - _, err = wait.DeleteNetworkAreaWaitHandler(context.Background(), iaasClient, organizationId, *updatedArea.AreaId).WaitWithContext(context.Background()) + // Delete regional network area + err = iaasClient.DeleteNetworkAreaRegion(context.Background(), organizationId, *updatedArea.Id, region).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "[IaaS API] Error when waiting for deletion: %v\n", err) + fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `DeleteNetworkAreaRegion`: %v\n", err) + } + + _, err = wait.DeleteNetworkAreaRegionWaitHandler(context.Background(), iaasClient, organizationId, *updatedArea.Id, region).WaitWithContext(context.Background()) + if err != nil { + fmt.Fprintf(os.Stderr, "[IaaS API] Error when waiting for network configuration deletion: %v\n", err) os.Exit(1) } + fmt.Printf("[IaaS API] Network area %q configuration for region %q has been successfully deleted.\n", *updatedArea.Id, region) - fmt.Printf("[IaaS API] Network area %q has been successfully deleted.\n", *updatedArea.AreaId) + // Delete a network area + err = iaasClient.DeleteNetworkArea(context.Background(), organizationId, *updatedArea.Id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `DeleteNetworkArea`: %v\n", err) + } else { + fmt.Printf("[IaaS API] Network area %q has been successfully deleted.\n", *updatedArea.Id) + } } diff --git a/examples/iaas/publicip/publicIp.go b/examples/iaas/publicip/publicIp.go index 56cc7bde4..eed2f72df 100644 --- a/examples/iaas/publicip/publicIp.go +++ b/examples/iaas/publicip/publicIp.go @@ -5,25 +5,24 @@ import ( "fmt" "os" - "github.com/stackitcloud/stackit-sdk-go/core/config" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/iaas" ) func main() { - // Specify the organization ID and project ID + // Specify the project ID, network interface ID and region projectId := "PROJECT_ID" // the uuid of your STACKIT project + networkInterfaceId := "NETWORK_INTERFACE_ID" + region := "eu01" // Create a new API client, that uses default authentication and configuration - iaasClient, err := iaas.NewAPIClient( - config.WithRegion("eu01"), - ) + iaasClient, err := iaas.NewAPIClient() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Creating API client: %v\n", err) os.Exit(1) } - publicIps, err := iaasClient.ListPublicIPs(context.Background(), projectId).Execute() + publicIps, err := iaasClient.ListPublicIPs(context.Background(), projectId, region).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `ListPublicIPs`: %v\n", err) @@ -33,9 +32,9 @@ func main() { // Create a publicIp createpublicIpPayload := iaas.CreatePublicIPPayload{ - NetworkInterface: iaas.NewNullableString(utils.Ptr("NIC_ID")), + NetworkInterface: iaas.NewNullableString(utils.Ptr(networkInterfaceId)), } - publicIp, err := iaasClient.CreatePublicIP(context.Background(), projectId).CreatePublicIPPayload(createpublicIpPayload).Execute() + publicIp, err := iaasClient.CreatePublicIP(context.Background(), projectId, region).CreatePublicIPPayload(createpublicIpPayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `CreatePublicIP`: %v\n", err) } else { @@ -46,7 +45,7 @@ func main() { updatepublicIpPayload := iaas.UpdatePublicIPPayload{ NetworkInterface: iaas.NewNullableString(nil), } - publicIp, err = iaasClient.UpdatePublicIP(context.Background(), projectId, *publicIp.Id).UpdatePublicIPPayload(updatepublicIpPayload).Execute() + publicIp, err = iaasClient.UpdatePublicIP(context.Background(), projectId, region, *publicIp.Id).UpdatePublicIPPayload(updatepublicIpPayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `UpdatePublicIP`: %v\n", err) } @@ -59,7 +58,7 @@ func main() { } // Delete a public IP - err = iaasClient.DeletePublicIP(context.Background(), projectId, *publicIp.Id).Execute() + err = iaasClient.DeletePublicIP(context.Background(), projectId, region, *publicIp.Id).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `DeletepublicIp`: %v\n", err) } else { diff --git a/examples/iaas/routing_tables/routing_tables.go b/examples/iaas/routing_tables/routing_tables.go new file mode 100644 index 000000000..9ef62b4cb --- /dev/null +++ b/examples/iaas/routing_tables/routing_tables.go @@ -0,0 +1,96 @@ +package main + +import ( + "context" + "fmt" + "os" + + "github.com/stackitcloud/stackit-sdk-go/core/utils" + "github.com/stackitcloud/stackit-sdk-go/services/iaas" +) + +func main() { + // Specify the organization ID, network area ID and region + organizationId := "ORGANIZATION_ID" + networkAreaId := "NETWORK_AREA_ID" + region := "eu01" + + // Create a new API client, that uses default authentication and configuration + iaasClient, err := iaas.NewAPIClient() + if err != nil { + fmt.Fprintf(os.Stderr, "[IaaS API] Creating API client: %v\n", err) + os.Exit(1) + } + + // Add routing table in network area + addRoutingTableToAreaPayload := iaas.AddRoutingTableToAreaPayload{ + Name: utils.Ptr("example-routing-tables"), + Description: utils.Ptr("example"), + } + + routingTable, err := iaasClient.AddRoutingTableToArea(context.Background(), organizationId, networkAreaId, region).AddRoutingTableToAreaPayload(addRoutingTableToAreaPayload).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `AddRoutingTableToArea`: %v\n", err) + os.Exit(1) + } + fmt.Printf("[IaaS API] Added routing table %q.\n", *routingTable.Id) + + // Update routing table in network area + updateRoutingTableOfAreaPayload := iaas.UpdateRoutingTableOfAreaPayload{ + Name: utils.Ptr("example-routing-tables-updated"), + DynamicRoutes: utils.Ptr(false), + } + + updatedRoutingTable, err := iaasClient.UpdateRoutingTableOfArea(context.Background(), organizationId, networkAreaId, region, *routingTable.Id).UpdateRoutingTableOfAreaPayload(updateRoutingTableOfAreaPayload).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `UpdateRoutingTableOfArea`: %v\n", err) + os.Exit(1) + } + fmt.Printf("[IaaS API] Updated routing table %q.\n", *updatedRoutingTable.Id) + + // Add routes in routing table + addRoutesToRoutingTablePayload := iaas.AddRoutesToRoutingTablePayload{ + Items: &[]iaas.Route{ + { + Destination: &iaas.RouteDestination{ + DestinationCIDRv4: &iaas.DestinationCIDRv4{ + Type: utils.Ptr("cidrv4"), + Value: utils.Ptr("192.168.0.0/24"), + }, + }, + Labels: &map[string]interface{}{ + "foo": "bar", + }, + Nexthop: &iaas.RouteNexthop{ + NexthopIPv4: &iaas.NexthopIPv4{ + Type: utils.Ptr("ipv4"), + Value: utils.Ptr("10.1.2.10"), + }, + }, + }, + }, + } + + route, err := iaasClient.AddRoutesToRoutingTable(context.Background(), organizationId, networkAreaId, region, *updatedRoutingTable.Id).AddRoutesToRoutingTablePayload(addRoutesToRoutingTablePayload).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `AddRoutesToRoutingTable`: %v\n", err) + os.Exit(1) + } + fmt.Printf("[IaaS API] Added routes %q to routing table %q.\n", *(*route.Items)[0].Id, *updatedRoutingTable.Id) + + // Delete route in routing table + err = iaasClient.DeleteRouteFromRoutingTable(context.Background(), organizationId, networkAreaId, region, *updatedRoutingTable.Id, *(*route.Items)[0].Id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `DeleteRouteFromRoutingTable`: %v\n", err) + os.Exit(1) + } + fmt.Printf("[IaaS API] Deleted route %q from routing table %q.\n", *(*route.Items)[0].Id, *updatedRoutingTable.Id) + + // Delete routing table in network area + err = iaasClient.DeleteRoutingTableFromArea(context.Background(), organizationId, networkAreaId, region, *updatedRoutingTable.Id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `DeleteRoutingTableFromArea`: %v\n", err) + os.Exit(1) + } + fmt.Printf("[IaaS API] Deleted routing table %q.\n", *updatedRoutingTable.Id) +} diff --git a/examples/iaas/server/server.go b/examples/iaas/server/server.go index 1ab1f3180..6d7bd857f 100644 --- a/examples/iaas/server/server.go +++ b/examples/iaas/server/server.go @@ -5,26 +5,25 @@ import ( "fmt" "os" - "github.com/stackitcloud/stackit-sdk-go/core/config" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" ) func main() { - // Specify the organization ID and project ID + // Specify the project ID, image ID and region projectId := "PROJECT_ID" // the uuid of your STACKIT project + imageId := "IMAGE_ID" + region := "eu01" // Create a new API client, that uses default authentication and configuration - iaasClient, err := iaas.NewAPIClient( - config.WithRegion("eu01"), - ) + iaasClient, err := iaas.NewAPIClient() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Creating API client: %v\n", err) os.Exit(1) } - servers, err := iaasClient.ListServers(context.Background(), projectId).Execute() + servers, err := iaasClient.ListServers(context.Background(), projectId, region).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `ListServers`: %v\n", err) @@ -32,28 +31,57 @@ func main() { fmt.Printf("[iaas API] Number of servers: %v\n", len(*servers.Items)) } + // Create a network + createNetworkPayload := iaas.CreateNetworkPayload{ + Name: utils.Ptr("example-network"), + Ipv4: &iaas.CreateNetworkIPv4{ + CreateNetworkIPv4WithPrefixLength: &iaas.CreateNetworkIPv4WithPrefixLength{ + PrefixLength: utils.Ptr(int64(24)), + }, + }, + } + + network, err := iaasClient.CreateNetwork(context.Background(), projectId, region).CreateNetworkPayload(createNetworkPayload).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `CreateNetwork`: %v\n", err) + os.Exit(1) + } + + fmt.Println("[Iaas API] Waiting for network to be created...") + + network, err = wait.CreateNetworkWaitHandler(context.Background(), iaasClient, projectId, region, *network.Id).WaitWithContext(context.Background()) + if err != nil { + fmt.Fprintf(os.Stderr, "[IaaS API] Error when waiting for creation: %v\n", err) + os.Exit(1) + } + // Create a server createServerPayload := iaas.CreateServerPayload{ Name: utils.Ptr("example-server"), AvailabilityZone: utils.Ptr("eu01-1"), MachineType: utils.Ptr("g1.1"), - BootVolume: &iaas.CreateServerPayloadBootVolume{ + BootVolume: &iaas.ServerBootVolume{ Size: utils.Ptr(int64(64)), Source: &iaas.BootVolumeSource{ - Id: utils.Ptr("IMAGE_ID"), + Id: utils.Ptr(imageId), Type: utils.Ptr("image"), }, }, + Networking: &iaas.CreateServerPayloadAllOfNetworking{ + CreateServerNetworking: &iaas.CreateServerNetworking{ + NetworkId: network.Id, + }, + }, } - server, err := iaasClient.CreateServer(context.Background(), projectId).CreateServerPayload(createServerPayload).Execute() + server, err := iaasClient.CreateServer(context.Background(), projectId, region).CreateServerPayload(createServerPayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `CreateServer`: %v\n", err) - } else { - fmt.Printf("[iaas API] Triggered creation of server with ID %q.\n", *server.Id) + os.Exit(1) } + fmt.Printf("[iaas API] Triggered creation of server with ID %q.\n", *server.Id) // Wait for creation of the server - server, err = wait.CreateServerWaitHandler(context.Background(), iaasClient, projectId, *server.Id).WaitWithContext(context.Background()) + server, err = wait.CreateServerWaitHandler(context.Background(), iaasClient, projectId, region, *server.Id).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for creation: %v\n", err) os.Exit(1) @@ -62,7 +90,7 @@ func main() { fmt.Printf("[iaas API] Server %q has been successfully created.\n", *server.Id) // Stop a server - err = iaasClient.StopServer(context.Background(), projectId, *server.Id).Execute() + err = iaasClient.StopServer(context.Background(), projectId, region, *server.Id).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `StopServer`: %v\n", err) } else { @@ -70,7 +98,7 @@ func main() { } // Wait for stop of the server - server, err = wait.StopServerWaitHandler(context.Background(), iaasClient, projectId, *server.Id).WaitWithContext(context.Background()) + server, err = wait.StopServerWaitHandler(context.Background(), iaasClient, projectId, region, *server.Id).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for stop: %v\n", err) os.Exit(1) @@ -79,7 +107,7 @@ func main() { fmt.Printf("[iaas API] Server %q has been successfully stopped.\n", *server.Id) // Start a server - err = iaasClient.StartServer(context.Background(), projectId, *server.Id).Execute() + err = iaasClient.StartServer(context.Background(), projectId, region, *server.Id).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `StartServer`: %v\n", err) } else { @@ -87,7 +115,7 @@ func main() { } // Wait for start of the server - server, err = wait.StartServerWaitHandler(context.Background(), iaasClient, projectId, *server.Id).WaitWithContext(context.Background()) + server, err = wait.StartServerWaitHandler(context.Background(), iaasClient, projectId, region, *server.Id).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for start: %v\n", err) os.Exit(1) @@ -99,7 +127,7 @@ func main() { updateServerPayload := iaas.UpdateServerPayload{ Name: utils.Ptr("renamed"), } - server, err = iaasClient.UpdateServer(context.Background(), projectId, *server.Id).UpdateServerPayload(updateServerPayload).Execute() + server, err = iaasClient.UpdateServer(context.Background(), projectId, region, *server.Id).UpdateServerPayload(updateServerPayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `UpdateServer`: %v\n", err) } @@ -111,14 +139,14 @@ func main() { MachineType: utils.Ptr("c1.2"), } - err = iaasClient.ResizeServer(context.Background(), projectId, *server.Id).ResizeServerPayload(resizeServerPayload).Execute() + err = iaasClient.ResizeServer(context.Background(), projectId, region, *server.Id).ResizeServerPayload(resizeServerPayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `ResizeServer`: %v\n", err) } else { fmt.Printf("[iaas API] Triggered resize of server with ID %q.\n", *server.Id) } - server, err = wait.ResizeServerWaitHandler(context.Background(), iaasClient, projectId, *server.Id).WaitWithContext(context.Background()) + server, err = wait.ResizeServerWaitHandler(context.Background(), iaasClient, projectId, region, *server.Id).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for resize: %v\n", err) os.Exit(1) @@ -127,7 +155,7 @@ func main() { fmt.Printf("[iaas API] Server %q has been successfully resized.\n", *server.Id) // Delete a server - err = iaasClient.DeleteServer(context.Background(), projectId, *server.Id).Execute() + err = iaasClient.DeleteServer(context.Background(), projectId, region, *server.Id).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `DeleteServer`: %v\n", err) } else { @@ -135,11 +163,26 @@ func main() { } // Wait for deletion of the server - _, err = wait.DeleteServerWaitHandler(context.Background(), iaasClient, projectId, *server.Id).WaitWithContext(context.Background()) + _, err = wait.DeleteServerWaitHandler(context.Background(), iaasClient, projectId, region, *server.Id).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for deletion: %v\n", err) os.Exit(1) } fmt.Printf("[iaas API] Server %q has been successfully deleted.\n", *server.Id) + + // Delete a network + err = iaasClient.DeleteNetwork(context.Background(), projectId, region, *network.Id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "[IaaS API] Error when calling `DeleteNetwork`: %v\n", err) + os.Exit(1) + } + + _, err = wait.DeleteNetworkWaitHandler(context.Background(), iaasClient, projectId, region, *network.Id).WaitWithContext(context.Background()) + if err != nil { + fmt.Fprintf(os.Stderr, "[IaaS API] Error when waiting for deletion: %v\n", err) + os.Exit(1) + } + + fmt.Printf("[IaaS API] Network has been successfully deleted.\n") } diff --git a/examples/iaas/volume/volume.go b/examples/iaas/volume/volume.go index 09c581ab2..1bcf6149a 100644 --- a/examples/iaas/volume/volume.go +++ b/examples/iaas/volume/volume.go @@ -5,26 +5,24 @@ import ( "fmt" "os" - "github.com/stackitcloud/stackit-sdk-go/core/config" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" ) func main() { - // Specify the organization ID and project ID + // Specify the project ID and region projectId := "PROJECT_ID" // the uuid of your STACKIT project + region := "eu01" // Create a new API client, that uses default authentication and configuration - iaasClient, err := iaas.NewAPIClient( - config.WithRegion("eu01"), - ) + iaasClient, err := iaas.NewAPIClient() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Creating API client: %v\n", err) os.Exit(1) } - volumes, err := iaasClient.ListVolumes(context.Background(), projectId).Execute() + volumes, err := iaasClient.ListVolumes(context.Background(), projectId, region).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `ListVolumes`: %v\n", err) @@ -38,7 +36,7 @@ func main() { AvailabilityZone: utils.Ptr("eu01-1"), Size: utils.Ptr(int64(10)), } - volume, err := iaasClient.CreateVolume(context.Background(), projectId).CreateVolumePayload(createVolumePayload).Execute() + volume, err := iaasClient.CreateVolume(context.Background(), projectId, region).CreateVolumePayload(createVolumePayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `CreateVolume`: %v\n", err) } else { @@ -46,7 +44,7 @@ func main() { } // Wait for creation of the volume - volume, err = wait.CreateVolumeWaitHandler(context.Background(), iaasClient, projectId, *volume.Id).WaitWithContext(context.Background()) + volume, err = wait.CreateVolumeWaitHandler(context.Background(), iaasClient, projectId, region, *volume.Id).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for creation: %v\n", err) os.Exit(1) @@ -58,7 +56,7 @@ func main() { updateVolumePayload := iaas.UpdateVolumePayload{ Name: utils.Ptr("renamed"), } - volume, err = iaasClient.UpdateVolume(context.Background(), projectId, *volume.Id).UpdateVolumePayload(updateVolumePayload).Execute() + volume, err = iaasClient.UpdateVolume(context.Background(), projectId, region, *volume.Id).UpdateVolumePayload(updateVolumePayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `UpdateVolume`: %v\n", err) } @@ -69,7 +67,7 @@ func main() { resizeVolumePayload := iaas.ResizeVolumePayload{ Size: utils.Ptr(int64(130)), } - err = iaasClient.ResizeVolume(context.Background(), projectId, *volume.Id).ResizeVolumePayload(resizeVolumePayload).Execute() + err = iaasClient.ResizeVolume(context.Background(), projectId, region, *volume.Id).ResizeVolumePayload(resizeVolumePayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `ResizeVolume`: %v\n", err) } @@ -77,7 +75,7 @@ func main() { fmt.Printf("[iaas API] Volume %q has been successfully resized.\n", *volume.Id) // Delete a volume - err = iaasClient.DeleteVolume(context.Background(), projectId, *volume.Id).Execute() + err = iaasClient.DeleteVolume(context.Background(), projectId, region, *volume.Id).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when calling `DeleteVolume`: %v\n", err) } else { @@ -85,7 +83,7 @@ func main() { } // Wait for deletion of the volume - _, err = wait.DeleteVolumeWaitHandler(context.Background(), iaasClient, projectId, *volume.Id).WaitWithContext(context.Background()) + _, err = wait.DeleteVolumeWaitHandler(context.Background(), iaasClient, projectId, region, *volume.Id).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "[iaas API] Error when waiting for deletion: %v\n", err) os.Exit(1) diff --git a/scripts/test-go.sh b/scripts/test-go.sh index 6baf6cd5d..5e9726491 100755 --- a/scripts/test-go.sh +++ b/scripts/test-go.sh @@ -49,13 +49,6 @@ else for service_dir in ${SERVICES_PATH}/*; do service=$(basename ${service_dir}) - # Our unit test template fails because it doesn't support fields with validations, - # such as the UUID component used by IaaS. We introduce this hardcoded skip until we fix it - if [ "${service}" = "iaas" ] || [ "${service}" = "iaasalpha" ]; then - echo ">> Skipping services/${service}" - continue - fi - test_service ${service} done fi diff --git a/services/iaas/CHANGELOG.md b/services/iaas/CHANGELOG.md index 69070c7ba..5d3f9e86c 100644 --- a/services/iaas/CHANGELOG.md +++ b/services/iaas/CHANGELOG.md @@ -1,3 +1,19 @@ +## v1.0.0 +- **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. +- **Feature:** Add new methods to manage routing tables: `AddRoutingTableToArea`, `DeleteRoutingTableFromArea`, `GetRoutingTableOfArea`, `ListRoutingTablesOfArea`, `UpdateRoutingTableOfArea` +- **Feature:** Add new methods to manage routes in routing tables: `AddRoutesToRoutingTable`, `DeleteRouteFromRoutingTable`, `GetRouteOfRoutingTable`, `ListRoutesOfRoutingTable`, `UpdateRouteOfRoutingTable` +- **Breaking Change:** Add new method to manage network area regions: `CreateNetworkAreaRegion`, `DeleteNetworkAreaRegion`, `GetNetworkAreaRegion`, `ListNetworkAreaRegions`, `UpdateNetworkAreaRegion` +- **Feature:** Add new wait handler for network area region: `CreateNetworkAreaRegionWaitHandler` and `DeleteRegionalNetworkAreaConfigurationWaitHandler` +- **Breaking Change:** Wait handler which relates to region-specific services, got an additional param for the region: `CreateNetworkWaitHandler`, `UpdateNetworkWaitHandler`, `DeleteNetworkWaitHandler`, `CreateVolumeWaitHandler`, `DeleteVolumeWaitHandler`, `CreateServerWaitHandler`, `ResizeServerWaitHandler`, `DeleteServerWaitHandler`, `StartServerWaitHandler`, `StopServerWaitHandler`, `DeallocateServerWaitHandler`, `RescueServerWaitHandler`, `UnrescueServerWaitHandler`, `ProjectRequestWaitHandler`, `AddVolumeToServerWaitHandler`, `RemoveVolumeFromServerWaitHandler`, `UploadImageWaitHandler`, `DeleteImageWaitHandler`, `CreateBackupWaitHandler`, `DeleteBackupWaitHandler`, `RestoreBackupWaitHandler`, `CreateSnapshotWaitHandler`, `DeleteSnapshotWaitHandler` +- **Breaking Change:** `Network` model has changed: + - `NetworkId` has been renamed to `Id` + - `Gateway`, `Nameservers`, `Prefixes` and `PublicIp` has been moved to new model `NetworkIPv4`, and can be accessed in the new property `IPv4` + - Properties `Gatewayv6`, `Nameserversv6` and `Prefixesv6` moved to new model `NetworkIPv6`, and can be accessed in the new property `IPv6` +- **Breaking Change:** `CreateServerPayload` model has changed: + - Model `CreateServerPayloadBootVolume` of `BootVolume` property changed to `ServerBootVolume` + - Property `Networking` in `CreateServerPayload` is required now +- **Deprecated:** Deprecated wait handler and will be removed after April 2026: `CreateNetworkAreaWaitHandler`, `UpdateNetworkAreaWaitHandler` and `DeleteNetworkAreaWaitHandler` + ## v0.31.0 - Add `CreatedAt` and `UpdatedAt` fields to `BaseSecurityGroupRule` struct - Add `Description` field to `CreateNicPayload`, `NIC`, `UpdateNicPayload` structs diff --git a/services/iaas/VERSION b/services/iaas/VERSION index 7021025f3..0ec25f750 100644 --- a/services/iaas/VERSION +++ b/services/iaas/VERSION @@ -1 +1 @@ -v0.31.0 +v1.0.0 diff --git a/services/iaas/api_default.go b/services/iaas/api_default.go index 6c694f2eb..5787d74a4 100644 --- a/services/iaas/api_default.go +++ b/services/iaas/api_default.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -30,165 +30,225 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param networkId The identifier (ID) of a STACKIT Network. @return ApiAddNetworkToServerRequest */ - AddNetworkToServer(ctx context.Context, projectId string, serverId string, networkId string) ApiAddNetworkToServerRequest + AddNetworkToServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiAddNetworkToServerRequest /* AddNetworkToServerExecute executes the request */ - AddNetworkToServerExecute(ctx context.Context, projectId string, serverId string, networkId string) error + AddNetworkToServerExecute(ctx context.Context, projectId string, region string, serverId string, networkId string) error /* AddNicToServer Attach an existing network interface. Attach an existing network interface to a server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param nicId The identifier (ID) of a network interface. @return ApiAddNicToServerRequest */ - AddNicToServer(ctx context.Context, projectId string, serverId string, nicId string) ApiAddNicToServerRequest + AddNicToServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiAddNicToServerRequest /* AddNicToServerExecute executes the request */ - AddNicToServerExecute(ctx context.Context, projectId string, serverId string, nicId string) error + AddNicToServerExecute(ctx context.Context, projectId string, region string, serverId string, nicId string) error /* AddPublicIpToServer Associate a public IP to the server. Associate a public IP to a server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param publicIpId The identifier (ID) of a Public IP. @return ApiAddPublicIpToServerRequest */ - AddPublicIpToServer(ctx context.Context, projectId string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest + AddPublicIpToServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest /* AddPublicIpToServerExecute executes the request */ - AddPublicIpToServerExecute(ctx context.Context, projectId string, serverId string, publicIpId string) error + AddPublicIpToServerExecute(ctx context.Context, projectId string, region string, serverId string, publicIpId string) error + /* + AddRoutesToRoutingTable Create new routes in a routing table. + Create new routes in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiAddRoutesToRoutingTableRequest + */ + AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest + /* + AddRoutesToRoutingTableExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return RouteListResponse + + */ + AddRoutesToRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RouteListResponse, error) + /* + AddRoutingTableToArea Create new routing table in a network area. + Create a new routing table in an existing network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiAddRoutingTableToAreaRequest + */ + AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest + /* + AddRoutingTableToAreaExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return RoutingTable + + */ + AddRoutingTableToAreaExecute(ctx context.Context, organizationId string, areaId string, region string) (*RoutingTable, error) /* AddSecurityGroupToServer Add a server to a security group. Add an existing server to an existing security group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiAddSecurityGroupToServerRequest */ - AddSecurityGroupToServer(ctx context.Context, projectId string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest + AddSecurityGroupToServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest /* AddSecurityGroupToServerExecute executes the request */ - AddSecurityGroupToServerExecute(ctx context.Context, projectId string, serverId string, securityGroupId string) error + AddSecurityGroupToServerExecute(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) error /* AddServiceAccountToServer Attach service account to a server. Attach an additional service account to the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param serviceAccountMail The e-mail address of a service account. @return ApiAddServiceAccountToServerRequest */ - AddServiceAccountToServer(ctx context.Context, projectId string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest + AddServiceAccountToServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest /* AddServiceAccountToServerExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param serviceAccountMail The e-mail address of a service account. @return ServiceAccountMailListResponse */ - AddServiceAccountToServerExecute(ctx context.Context, projectId string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) + AddServiceAccountToServerExecute(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) /* AddVolumeToServer Attach a volume to a server. Attach an existing volume to an existing server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiAddVolumeToServerRequest */ - AddVolumeToServer(ctx context.Context, projectId string, serverId string, volumeId string) ApiAddVolumeToServerRequest + AddVolumeToServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiAddVolumeToServerRequest /* AddVolumeToServerExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param volumeId The identifier (ID) of a STACKIT Volume. @return VolumeAttachment */ - AddVolumeToServerExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) + AddVolumeToServerExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) (*VolumeAttachment, error) /* CreateAffinityGroup Create a new affinity group in a project. Create a new server affinity group in the given project ID. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiCreateAffinityGroupRequest */ - CreateAffinityGroup(ctx context.Context, projectId string) ApiCreateAffinityGroupRequest + CreateAffinityGroup(ctx context.Context, projectId string, region string) ApiCreateAffinityGroupRequest /* CreateAffinityGroupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return AffinityGroup */ - CreateAffinityGroupExecute(ctx context.Context, projectId string) (*AffinityGroup, error) + CreateAffinityGroupExecute(ctx context.Context, projectId string, region string) (*AffinityGroup, error) /* CreateBackup Create new Backup. Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiCreateBackupRequest */ - CreateBackup(ctx context.Context, projectId string) ApiCreateBackupRequest + CreateBackup(ctx context.Context, projectId string, region string) ApiCreateBackupRequest /* CreateBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return Backup */ - CreateBackupExecute(ctx context.Context, projectId string) (*Backup, error) + CreateBackupExecute(ctx context.Context, projectId string, region string) (*Backup, error) /* CreateImage Create new Image. Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiCreateImageRequest */ - CreateImage(ctx context.Context, projectId string) ApiCreateImageRequest + CreateImage(ctx context.Context, projectId string, region string) ApiCreateImageRequest /* CreateImageExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ImageCreateResponse */ - CreateImageExecute(ctx context.Context, projectId string) (*ImageCreateResponse, error) + CreateImageExecute(ctx context.Context, projectId string, region string) (*ImageCreateResponse, error) /* CreateKeyPair Import a public key. - Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. Supported keypair types are ecdsa, ed25519 and rsa. + Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateKeyPairRequest @@ -208,18 +268,20 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiCreateNetworkRequest */ - CreateNetwork(ctx context.Context, projectId string) ApiCreateNetworkRequest + CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest /* CreateNetworkExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return Network */ - CreateNetworkExecute(ctx context.Context, projectId string) (*Network, error) + CreateNetworkExecute(ctx context.Context, projectId string, region string) (*Network, error) /* CreateNetworkArea Create new network area in an organization. Create a new network area in an organization. @@ -245,19 +307,43 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @return ApiCreateNetworkAreaRangeRequest */ - CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRangeRequest + CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRangeRequest /* CreateNetworkAreaRangeExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @return NetworkRangeListResponse */ - CreateNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string) (*NetworkRangeListResponse, error) + CreateNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, region string) (*NetworkRangeListResponse, error) + /* + CreateNetworkAreaRegion Configure a region for a network area. + Configure a new region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRegionRequest + */ + CreateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRegionRequest + /* + CreateNetworkAreaRegionExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return RegionalArea + + */ + CreateNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) (*RegionalArea, error) /* CreateNetworkAreaRoute Create new network routes. Create one or several new network routes in a network area. @@ -265,240 +351,262 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @return ApiCreateNetworkAreaRouteRequest */ - CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRouteRequest + CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRouteRequest /* CreateNetworkAreaRouteExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @return RouteListResponse */ - CreateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string) (*RouteListResponse, error) + CreateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string) (*RouteListResponse, error) /* CreateNic Create new network interface. Create a new network interface in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return ApiCreateNicRequest */ - CreateNic(ctx context.Context, projectId string, networkId string) ApiCreateNicRequest + CreateNic(ctx context.Context, projectId string, region string, networkId string) ApiCreateNicRequest /* CreateNicExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return NIC */ - CreateNicExecute(ctx context.Context, projectId string, networkId string) (*NIC, error) + CreateNicExecute(ctx context.Context, projectId string, region string, networkId string) (*NIC, error) /* CreatePublicIP Create new public IP. Create a new public IP in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiCreatePublicIPRequest */ - CreatePublicIP(ctx context.Context, projectId string) ApiCreatePublicIPRequest + CreatePublicIP(ctx context.Context, projectId string, region string) ApiCreatePublicIPRequest /* CreatePublicIPExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return PublicIp */ - CreatePublicIPExecute(ctx context.Context, projectId string) (*PublicIp, error) + CreatePublicIPExecute(ctx context.Context, projectId string, region string) (*PublicIp, error) /* CreateSecurityGroup Create new security group. Create a new security group in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiCreateSecurityGroupRequest */ - CreateSecurityGroup(ctx context.Context, projectId string) ApiCreateSecurityGroupRequest + CreateSecurityGroup(ctx context.Context, projectId string, region string) ApiCreateSecurityGroupRequest /* CreateSecurityGroupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return SecurityGroup */ - CreateSecurityGroupExecute(ctx context.Context, projectId string) (*SecurityGroup, error) + CreateSecurityGroupExecute(ctx context.Context, projectId string, region string) (*SecurityGroup, error) /* CreateSecurityGroupRule Create new security group rule. Create a new security group rule in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiCreateSecurityGroupRuleRequest */ - CreateSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string) ApiCreateSecurityGroupRuleRequest + CreateSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string) ApiCreateSecurityGroupRuleRequest /* CreateSecurityGroupRuleExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return SecurityGroupRule */ - CreateSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroupRule, error) + CreateSecurityGroupRuleExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroupRule, error) /* CreateServer Create new server. Create a new server in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiCreateServerRequest */ - CreateServer(ctx context.Context, projectId string) ApiCreateServerRequest + CreateServer(ctx context.Context, projectId string, region string) ApiCreateServerRequest /* CreateServerExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return Server */ - CreateServerExecute(ctx context.Context, projectId string) (*Server, error) + CreateServerExecute(ctx context.Context, projectId string, region string) (*Server, error) /* CreateSnapshot Create new Snapshot. Create a new Snapshot from a Volume in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiCreateSnapshotRequest */ - CreateSnapshot(ctx context.Context, projectId string) ApiCreateSnapshotRequest + CreateSnapshot(ctx context.Context, projectId string, region string) ApiCreateSnapshotRequest /* CreateSnapshotExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return Snapshot */ - CreateSnapshotExecute(ctx context.Context, projectId string) (*Snapshot, error) + CreateSnapshotExecute(ctx context.Context, projectId string, region string) (*Snapshot, error) /* CreateVolume Create new volume. Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiCreateVolumeRequest */ - CreateVolume(ctx context.Context, projectId string) ApiCreateVolumeRequest + CreateVolume(ctx context.Context, projectId string, region string) ApiCreateVolumeRequest /* CreateVolumeExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return Volume */ - CreateVolumeExecute(ctx context.Context, projectId string) (*Volume, error) + CreateVolumeExecute(ctx context.Context, projectId string, region string) (*Volume, error) /* DeallocateServer Deallocate an existing server. Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiDeallocateServerRequest */ - DeallocateServer(ctx context.Context, projectId string, serverId string) ApiDeallocateServerRequest + DeallocateServer(ctx context.Context, projectId string, region string, serverId string) ApiDeallocateServerRequest /* DeallocateServerExecute executes the request */ - DeallocateServerExecute(ctx context.Context, projectId string, serverId string) error + DeallocateServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* DeleteAffinityGroup Delete a affinity group in a project. Delete a affinity group in the given project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. @return ApiDeleteAffinityGroupRequest */ - DeleteAffinityGroup(ctx context.Context, projectId string, affinityGroupId string) ApiDeleteAffinityGroupRequest + DeleteAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiDeleteAffinityGroupRequest /* DeleteAffinityGroupExecute executes the request */ - DeleteAffinityGroupExecute(ctx context.Context, projectId string, affinityGroupId string) error + DeleteAffinityGroupExecute(ctx context.Context, projectId string, region string, affinityGroupId string) error /* DeleteBackup Delete a backup. Delete a backup that is part of the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param backupId The identifier (ID) of a STACKIT Backup. @return ApiDeleteBackupRequest */ - DeleteBackup(ctx context.Context, projectId string, backupId string) ApiDeleteBackupRequest + DeleteBackup(ctx context.Context, projectId string, region string, backupId string) ApiDeleteBackupRequest /* DeleteBackupExecute executes the request */ - DeleteBackupExecute(ctx context.Context, projectId string, backupId string) error + DeleteBackupExecute(ctx context.Context, projectId string, region string, backupId string) error /* DeleteImage Delete an Image. Delete an image that is part of the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiDeleteImageRequest */ - DeleteImage(ctx context.Context, projectId string, imageId string) ApiDeleteImageRequest + DeleteImage(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageRequest /* DeleteImageExecute executes the request */ - DeleteImageExecute(ctx context.Context, projectId string, imageId string) error + DeleteImageExecute(ctx context.Context, projectId string, region string, imageId string) error /* DeleteImageShare Remove image share. Remove the image share. New scope will be local. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiDeleteImageShareRequest */ - DeleteImageShare(ctx context.Context, projectId string, imageId string) ApiDeleteImageShareRequest + DeleteImageShare(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageShareRequest /* DeleteImageShareExecute executes the request */ - DeleteImageShareExecute(ctx context.Context, projectId string, imageId string) error + DeleteImageShareExecute(ctx context.Context, projectId string, region string, imageId string) error /* DeleteImageShareConsumer Remove an image share consumer. Remove consumer from a shared image. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. @return ApiDeleteImageShareConsumerRequest */ - DeleteImageShareConsumer(ctx context.Context, projectId string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest + DeleteImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest /* DeleteImageShareConsumerExecute executes the request */ - DeleteImageShareConsumerExecute(ctx context.Context, projectId string, imageId string, consumerProjectId string) error + DeleteImageShareConsumerExecute(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) error /* DeleteKeyPair Delete an SSH keypair. Delete an SSH keypair from a user. @@ -519,15 +627,16 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return ApiDeleteNetworkRequest */ - DeleteNetwork(ctx context.Context, projectId string, networkId string) ApiDeleteNetworkRequest + DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest /* DeleteNetworkExecute executes the request */ - DeleteNetworkExecute(ctx context.Context, projectId string, networkId string) error + DeleteNetworkExecute(ctx context.Context, projectId string, region string, networkId string) error /* DeleteNetworkArea Delete a network area. Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. @@ -550,15 +659,32 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @param networkRangeId The identifier (ID) of a STACKIT Network Range. @return ApiDeleteNetworkAreaRangeRequest */ - DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest + DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest /* DeleteNetworkAreaRangeExecute executes the request */ - DeleteNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, networkRangeId string) error + DeleteNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) error + /* + DeleteNetworkAreaRegion Delete a configuration of region for a network area. + Delete a current configuration of region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiDeleteNetworkAreaRegionRequest + */ + DeleteNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiDeleteNetworkAreaRegionRequest + /* + DeleteNetworkAreaRegionExecute executes the request + + */ + DeleteNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) error /* DeleteNetworkAreaRoute Delete a network route. Delete a network route of a network area. @@ -566,246 +692,301 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @param routeId The identifier (ID) of a STACKIT Route. @return ApiDeleteNetworkAreaRouteRequest */ - DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiDeleteNetworkAreaRouteRequest + DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiDeleteNetworkAreaRouteRequest /* DeleteNetworkAreaRouteExecute executes the request */ - DeleteNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, routeId string) error + DeleteNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string, routeId string) error /* DeleteNic Delete a network interface. Delete a network interface that is part of the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @param nicId The identifier (ID) of a network interface. @return ApiDeleteNicRequest */ - DeleteNic(ctx context.Context, projectId string, networkId string, nicId string) ApiDeleteNicRequest + DeleteNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiDeleteNicRequest /* DeleteNicExecute executes the request */ - DeleteNicExecute(ctx context.Context, projectId string, networkId string, nicId string) error + DeleteNicExecute(ctx context.Context, projectId string, region string, networkId string, nicId string) error /* DeletePublicIP Delete a public IP. Delete a public IP that is part of the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param publicIpId The identifier (ID) of a Public IP. @return ApiDeletePublicIPRequest */ - DeletePublicIP(ctx context.Context, projectId string, publicIpId string) ApiDeletePublicIPRequest + DeletePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiDeletePublicIPRequest /* DeletePublicIPExecute executes the request */ - DeletePublicIPExecute(ctx context.Context, projectId string, publicIpId string) error + DeletePublicIPExecute(ctx context.Context, projectId string, region string, publicIpId string) error + /* + DeleteRouteFromRoutingTable Delete a route in a routing table. + Delete a route in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteRouteFromRoutingTableRequest + */ + DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest + /* + DeleteRouteFromRoutingTableExecute executes the request + + */ + DeleteRouteFromRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) error + /* + DeleteRoutingTableFromArea Delete a routing table. + Delete a routing table of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiDeleteRoutingTableFromAreaRequest + */ + DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest + /* + DeleteRoutingTableFromAreaExecute executes the request + + */ + DeleteRoutingTableFromAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) error /* DeleteSecurityGroup Delete security group. Delete a security group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiDeleteSecurityGroupRequest */ - DeleteSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiDeleteSecurityGroupRequest + DeleteSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiDeleteSecurityGroupRequest /* DeleteSecurityGroupExecute executes the request */ - DeleteSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) error + DeleteSecurityGroupExecute(ctx context.Context, projectId string, region string, securityGroupId string) error /* DeleteSecurityGroupRule Delete security group rule. Delete a security group rule. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. @return ApiDeleteSecurityGroupRuleRequest */ - DeleteSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest + DeleteSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest /* DeleteSecurityGroupRuleExecute executes the request */ - DeleteSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) error + DeleteSecurityGroupRuleExecute(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) error /* DeleteServer Delete a server. Delete a server. Volumes won't be deleted. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiDeleteServerRequest */ - DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest + DeleteServer(ctx context.Context, projectId string, region string, serverId string) ApiDeleteServerRequest /* DeleteServerExecute executes the request */ - DeleteServerExecute(ctx context.Context, projectId string, serverId string) error + DeleteServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* DeleteSnapshot Delete a snapshot. Delete a snapshot that is part of the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param snapshotId The identifier (ID) of a STACKIT Snapshot. @return ApiDeleteSnapshotRequest */ - DeleteSnapshot(ctx context.Context, projectId string, snapshotId string) ApiDeleteSnapshotRequest + DeleteSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiDeleteSnapshotRequest /* DeleteSnapshotExecute executes the request */ - DeleteSnapshotExecute(ctx context.Context, projectId string, snapshotId string) error + DeleteSnapshotExecute(ctx context.Context, projectId string, region string, snapshotId string) error /* DeleteVolume Delete a volume. Delete a volume inside a project. The deletion will fail if the volume is still in use. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiDeleteVolumeRequest */ - DeleteVolume(ctx context.Context, projectId string, volumeId string) ApiDeleteVolumeRequest + DeleteVolume(ctx context.Context, projectId string, region string, volumeId string) ApiDeleteVolumeRequest /* DeleteVolumeExecute executes the request */ - DeleteVolumeExecute(ctx context.Context, projectId string, volumeId string) error + DeleteVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) error /* GetAffinityGroup Get the affinity group. Get the affinity group created in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. @return ApiGetAffinityGroupRequest */ - GetAffinityGroup(ctx context.Context, projectId string, affinityGroupId string) ApiGetAffinityGroupRequest + GetAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiGetAffinityGroupRequest /* GetAffinityGroupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. @return AffinityGroup */ - GetAffinityGroupExecute(ctx context.Context, projectId string, affinityGroupId string) (*AffinityGroup, error) + GetAffinityGroupExecute(ctx context.Context, projectId string, region string, affinityGroupId string) (*AffinityGroup, error) /* GetAttachedVolume Get Volume Attachment details. Get the details of an existing Volume Attachment. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiGetAttachedVolumeRequest */ - GetAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiGetAttachedVolumeRequest + GetAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiGetAttachedVolumeRequest /* GetAttachedVolumeExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param volumeId The identifier (ID) of a STACKIT Volume. @return VolumeAttachment */ - GetAttachedVolumeExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) + GetAttachedVolumeExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) (*VolumeAttachment, error) /* GetBackup Get details about a backup. Get details about a block device backup. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param backupId The identifier (ID) of a STACKIT Backup. @return ApiGetBackupRequest */ - GetBackup(ctx context.Context, projectId string, backupId string) ApiGetBackupRequest + GetBackup(ctx context.Context, projectId string, region string, backupId string) ApiGetBackupRequest /* GetBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param backupId The identifier (ID) of a STACKIT Backup. @return Backup */ - GetBackupExecute(ctx context.Context, projectId string, backupId string) (*Backup, error) + GetBackupExecute(ctx context.Context, projectId string, region string, backupId string) (*Backup, error) /* GetImage Get details about an image. Get details about a specific Image inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiGetImageRequest */ - GetImage(ctx context.Context, projectId string, imageId string) ApiGetImageRequest + GetImage(ctx context.Context, projectId string, region string, imageId string) ApiGetImageRequest /* GetImageExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return Image */ - GetImageExecute(ctx context.Context, projectId string, imageId string) (*Image, error) + GetImageExecute(ctx context.Context, projectId string, region string, imageId string) (*Image, error) /* GetImageShare Get share details of an image. Get share details about an shared image. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiGetImageShareRequest */ - GetImageShare(ctx context.Context, projectId string, imageId string) ApiGetImageShareRequest + GetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiGetImageShareRequest /* GetImageShareExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ImageShare */ - GetImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) + GetImageShareExecute(ctx context.Context, projectId string, region string, imageId string) (*ImageShare, error) /* GetImageShareConsumer Get image share consumer. Get details about an image share consumer. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. @return ApiGetImageShareConsumerRequest */ - GetImageShareConsumer(ctx context.Context, projectId string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest + GetImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest /* GetImageShareConsumerExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. @return ImageShareConsumer */ - GetImageShareConsumerExecute(ctx context.Context, projectId string, imageId string, consumerProjectId string) (*ImageShareConsumer, error) + GetImageShareConsumerExecute(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) (*ImageShareConsumer, error) /* GetKeyPair Get SSH keypair details. Get details about an SSH keypair. @@ -830,40 +1011,44 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param machineType STACKIT machine type Name. @return ApiGetMachineTypeRequest */ - GetMachineType(ctx context.Context, projectId string, machineType string) ApiGetMachineTypeRequest + GetMachineType(ctx context.Context, projectId string, region string, machineType string) ApiGetMachineTypeRequest /* GetMachineTypeExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param machineType STACKIT machine type Name. @return MachineType */ - GetMachineTypeExecute(ctx context.Context, projectId string, machineType string) (*MachineType, error) + GetMachineTypeExecute(ctx context.Context, projectId string, region string, machineType string) (*MachineType, error) /* GetNetwork Get network details. Get details about a network of a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return ApiGetNetworkRequest */ - GetNetwork(ctx context.Context, projectId string, networkId string) ApiGetNetworkRequest + GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest /* GetNetworkExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return Network */ - GetNetworkExecute(ctx context.Context, projectId string, networkId string) (*Network, error) + GetNetworkExecute(ctx context.Context, projectId string, region string, networkId string) (*Network, error) /* GetNetworkArea Get details about a network area. Get details about a network area in an organization. @@ -891,21 +1076,45 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @param networkRangeId The identifier (ID) of a STACKIT Network Range. @return ApiGetNetworkAreaRangeRequest */ - GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, networkRangeId string) ApiGetNetworkAreaRangeRequest + GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiGetNetworkAreaRangeRequest /* GetNetworkAreaRangeExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @param networkRangeId The identifier (ID) of a STACKIT Network Range. @return NetworkRange */ - GetNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, networkRangeId string) (*NetworkRange, error) + GetNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) (*NetworkRange, error) + /* + GetNetworkAreaRegion Get details about a configured region. + Get details about a configured region in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiGetNetworkAreaRegionRequest + */ + GetNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiGetNetworkAreaRegionRequest + /* + GetNetworkAreaRegionExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return RegionalArea + + */ + GetNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) (*RegionalArea, error) /* GetNetworkAreaRoute Get details about a network route. Get details about a network route defined in a network area. @@ -913,43 +1122,47 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @param routeId The identifier (ID) of a STACKIT Route. @return ApiGetNetworkAreaRouteRequest */ - GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiGetNetworkAreaRouteRequest + GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiGetNetworkAreaRouteRequest /* GetNetworkAreaRouteExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @param routeId The identifier (ID) of a STACKIT Route. @return Route */ - GetNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, routeId string) (*Route, error) + GetNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string, routeId string) (*Route, error) /* - GetNic Get details about a network interface of a network. + GetNic Get details about a network interface. Get details about a network interface inside a network. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @param nicId The identifier (ID) of a network interface. @return ApiGetNicRequest */ - GetNic(ctx context.Context, projectId string, networkId string, nicId string) ApiGetNicRequest + GetNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiGetNicRequest /* GetNicExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @param nicId The identifier (ID) of a network interface. @return NIC */ - GetNicExecute(ctx context.Context, projectId string, networkId string, nicId string) (*NIC, error) + GetNicExecute(ctx context.Context, projectId string, region string, networkId string, nicId string) (*NIC, error) /* GetOrganizationRequest Lookup an organization request ID. Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. @@ -994,312 +1207,394 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param nicId The identifier (ID) of a network interface. @return ApiGetProjectNICRequest */ - GetProjectNIC(ctx context.Context, projectId string, nicId string) ApiGetProjectNICRequest + GetProjectNIC(ctx context.Context, projectId string, region string, nicId string) ApiGetProjectNICRequest /* GetProjectNICExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param nicId The identifier (ID) of a network interface. @return NIC */ - GetProjectNICExecute(ctx context.Context, projectId string, nicId string) (*NIC, error) + GetProjectNICExecute(ctx context.Context, projectId string, region string, nicId string) (*NIC, error) /* GetProjectRequest Lookup a project request ID. Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param requestId The identifier (ID) of a STACKIT Request. @return ApiGetProjectRequestRequest */ - GetProjectRequest(ctx context.Context, projectId string, requestId string) ApiGetProjectRequestRequest + GetProjectRequest(ctx context.Context, projectId string, region string, requestId string) ApiGetProjectRequestRequest /* GetProjectRequestExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param requestId The identifier (ID) of a STACKIT Request. @return Request */ - GetProjectRequestExecute(ctx context.Context, projectId string, requestId string) (*Request, error) + GetProjectRequestExecute(ctx context.Context, projectId string, region string, requestId string) (*Request, error) /* GetPublicIP Get details about a public IP. Get details about a public IP inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param publicIpId The identifier (ID) of a Public IP. @return ApiGetPublicIPRequest */ - GetPublicIP(ctx context.Context, projectId string, publicIpId string) ApiGetPublicIPRequest + GetPublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiGetPublicIPRequest /* GetPublicIPExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param publicIpId The identifier (ID) of a Public IP. @return PublicIp */ - GetPublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, error) + GetPublicIPExecute(ctx context.Context, projectId string, region string, publicIpId string) (*PublicIp, error) + /* + GetRouteOfRoutingTable Get details about a route of a routing table. + Get details about a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetRouteOfRoutingTableRequest + */ + GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest + /* + GetRouteOfRoutingTableExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return Route + + */ + GetRouteOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) (*Route, error) + /* + GetRoutingTableOfArea Get details about a routing table. + Get details about a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiGetRoutingTableOfAreaRequest + */ + GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest + /* + GetRoutingTableOfAreaExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return RoutingTable + + */ + GetRoutingTableOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RoutingTable, error) /* GetSecurityGroup Get security group details. Get details about a security group of a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiGetSecurityGroupRequest */ - GetSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiGetSecurityGroupRequest + GetSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiGetSecurityGroupRequest /* GetSecurityGroupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return SecurityGroup */ - GetSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) + GetSecurityGroupExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroup, error) /* GetSecurityGroupRule Get security group rule details. Get details about a security group rule of a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. @return ApiGetSecurityGroupRuleRequest */ - GetSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest + GetSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest /* GetSecurityGroupRuleExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. @return SecurityGroupRule */ - GetSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) (*SecurityGroupRule, error) + GetSecurityGroupRuleExecute(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) (*SecurityGroupRule, error) /* GetServer Get server details. Get details about a server by its ID. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiGetServerRequest */ - GetServer(ctx context.Context, projectId string, serverId string) ApiGetServerRequest + GetServer(ctx context.Context, projectId string, region string, serverId string) ApiGetServerRequest /* GetServerExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return Server */ - GetServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) + GetServerExecute(ctx context.Context, projectId string, region string, serverId string) (*Server, error) /* GetServerConsole Get server console. Get a URL for server remote console. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiGetServerConsoleRequest */ - GetServerConsole(ctx context.Context, projectId string, serverId string) ApiGetServerConsoleRequest + GetServerConsole(ctx context.Context, projectId string, region string, serverId string) ApiGetServerConsoleRequest /* GetServerConsoleExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ServerConsoleUrl */ - GetServerConsoleExecute(ctx context.Context, projectId string, serverId string) (*ServerConsoleUrl, error) + GetServerConsoleExecute(ctx context.Context, projectId string, region string, serverId string) (*ServerConsoleUrl, error) /* GetServerLog Get server log. Get server console log. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiGetServerLogRequest */ - GetServerLog(ctx context.Context, projectId string, serverId string) ApiGetServerLogRequest + GetServerLog(ctx context.Context, projectId string, region string, serverId string) ApiGetServerLogRequest /* GetServerLogExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return GetServerLog200Response */ - GetServerLogExecute(ctx context.Context, projectId string, serverId string) (*GetServerLog200Response, error) + GetServerLogExecute(ctx context.Context, projectId string, region string, serverId string) (*GetServerLog200Response, error) /* GetSnapshot Get details about a snapshot. Get details about a block device snapshot. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param snapshotId The identifier (ID) of a STACKIT Snapshot. @return ApiGetSnapshotRequest */ - GetSnapshot(ctx context.Context, projectId string, snapshotId string) ApiGetSnapshotRequest + GetSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiGetSnapshotRequest /* GetSnapshotExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param snapshotId The identifier (ID) of a STACKIT Snapshot. @return Snapshot */ - GetSnapshotExecute(ctx context.Context, projectId string, snapshotId string) (*Snapshot, error) + GetSnapshotExecute(ctx context.Context, projectId string, region string, snapshotId string) (*Snapshot, error) /* GetVolume Get details about a volume. Get details about a block device volume. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiGetVolumeRequest */ - GetVolume(ctx context.Context, projectId string, volumeId string) ApiGetVolumeRequest + GetVolume(ctx context.Context, projectId string, region string, volumeId string) ApiGetVolumeRequest /* GetVolumeExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param volumeId The identifier (ID) of a STACKIT Volume. @return Volume */ - GetVolumeExecute(ctx context.Context, projectId string, volumeId string) (*Volume, error) + GetVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) (*Volume, error) /* GetVolumePerformanceClass Get details about a volume performance class. Get details about a specific volume performance class. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param volumePerformanceClass The name of a STACKIT Volume performance class. @return ApiGetVolumePerformanceClassRequest */ - GetVolumePerformanceClass(ctx context.Context, projectId string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest + GetVolumePerformanceClass(ctx context.Context, projectId string, region string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest /* GetVolumePerformanceClassExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param volumePerformanceClass The name of a STACKIT Volume performance class. @return VolumePerformanceClass */ - GetVolumePerformanceClassExecute(ctx context.Context, projectId string, volumePerformanceClass string) (*VolumePerformanceClass, error) + GetVolumePerformanceClassExecute(ctx context.Context, projectId string, region string, volumePerformanceClass string) (*VolumePerformanceClass, error) /* ListAffinityGroups Get the affinity groups setup for a project. Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListAffinityGroupsRequest */ - ListAffinityGroups(ctx context.Context, projectId string) ApiListAffinityGroupsRequest + ListAffinityGroups(ctx context.Context, projectId string, region string) ApiListAffinityGroupsRequest /* ListAffinityGroupsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return AffinityGroupListResponse */ - ListAffinityGroupsExecute(ctx context.Context, projectId string) (*AffinityGroupListResponse, error) + ListAffinityGroupsExecute(ctx context.Context, projectId string, region string) (*AffinityGroupListResponse, error) /* ListAttachedVolumes List all volume attachments of a server. Get a list of all volume attachments of a server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiListAttachedVolumesRequest */ - ListAttachedVolumes(ctx context.Context, projectId string, serverId string) ApiListAttachedVolumesRequest + ListAttachedVolumes(ctx context.Context, projectId string, region string, serverId string) ApiListAttachedVolumesRequest /* ListAttachedVolumesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return VolumeAttachmentListResponse */ - ListAttachedVolumesExecute(ctx context.Context, projectId string, serverId string) (*VolumeAttachmentListResponse, error) + ListAttachedVolumesExecute(ctx context.Context, projectId string, region string, serverId string) (*VolumeAttachmentListResponse, error) /* ListAvailabilityZones List all availability zones. Get a list of all availability zones. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region The STACKIT Region of the resources. @return ApiListAvailabilityZonesRequest */ - ListAvailabilityZones(ctx context.Context) ApiListAvailabilityZonesRequest + ListAvailabilityZones(ctx context.Context, region string) ApiListAvailabilityZonesRequest /* ListAvailabilityZonesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region The STACKIT Region of the resources. @return AvailabilityZoneListResponse */ - ListAvailabilityZonesExecute(ctx context.Context) (*AvailabilityZoneListResponse, error) + ListAvailabilityZonesExecute(ctx context.Context, region string) (*AvailabilityZoneListResponse, error) /* ListBackups List all backups inside a project. Get a list of all backups inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListBackupsRequest */ - ListBackups(ctx context.Context, projectId string) ApiListBackupsRequest + ListBackups(ctx context.Context, projectId string, region string) ApiListBackupsRequest /* ListBackupsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return BackupListResponse */ - ListBackupsExecute(ctx context.Context, projectId string) (*BackupListResponse, error) + ListBackupsExecute(ctx context.Context, projectId string, region string) (*BackupListResponse, error) /* ListImages List all Images inside a project. Get a list of all images inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListImagesRequest */ - ListImages(ctx context.Context, projectId string) ApiListImagesRequest + ListImages(ctx context.Context, projectId string, region string) ApiListImagesRequest /* ListImagesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ImageListResponse */ - ListImagesExecute(ctx context.Context, projectId string) (*ImageListResponse, error) + ListImagesExecute(ctx context.Context, projectId string, region string) (*ImageListResponse, error) /* ListKeyPairs List all SSH keypairs for the requesting user. Get a list of all SSH keypairs assigned to the requesting user. @@ -1322,18 +1617,20 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListMachineTypesRequest */ - ListMachineTypes(ctx context.Context, projectId string) ApiListMachineTypesRequest + ListMachineTypes(ctx context.Context, projectId string, region string) ApiListMachineTypesRequest /* ListMachineTypesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return MachineTypeListResponse */ - ListMachineTypesExecute(ctx context.Context, projectId string) (*MachineTypeListResponse, error) + ListMachineTypesExecute(ctx context.Context, projectId string, region string) (*MachineTypeListResponse, error) /* ListNetworkAreaProjects List all projects using a network area. Get a list of all projects using a network area. @@ -1361,19 +1658,41 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @return ApiListNetworkAreaRangesRequest */ - ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRangesRequest + ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRangesRequest /* ListNetworkAreaRangesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @return NetworkRangeListResponse */ - ListNetworkAreaRangesExecute(ctx context.Context, organizationId string, areaId string) (*NetworkRangeListResponse, error) + ListNetworkAreaRangesExecute(ctx context.Context, organizationId string, areaId string, region string) (*NetworkRangeListResponse, error) + /* + ListNetworkAreaRegions List all configured regions in a network area. + Get a list of all configured regions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaRegionsRequest + */ + ListNetworkAreaRegions(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRegionsRequest + /* + ListNetworkAreaRegionsExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return RegionalAreaListResponse + + */ + ListNetworkAreaRegionsExecute(ctx context.Context, organizationId string, areaId string) (*RegionalAreaListResponse, error) /* ListNetworkAreaRoutes List all network routes in a network area. Get a list of all network routes defined in a network area. @@ -1381,19 +1700,21 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @return ApiListNetworkAreaRoutesRequest */ - ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRoutesRequest + ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRoutesRequest /* ListNetworkAreaRoutesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @return RouteListResponse */ - ListNetworkAreaRoutesExecute(ctx context.Context, organizationId string, areaId string) (*RouteListResponse, error) + ListNetworkAreaRoutesExecute(ctx context.Context, organizationId string, areaId string, region string) (*RouteListResponse, error) /* ListNetworkAreas List all network areas in an organization. Get a list of all visible network areas defined in an organization. @@ -1418,56 +1739,62 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListNetworksRequest */ - ListNetworks(ctx context.Context, projectId string) ApiListNetworksRequest + ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest /* ListNetworksExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return NetworkListResponse */ - ListNetworksExecute(ctx context.Context, projectId string) (*NetworkListResponse, error) + ListNetworksExecute(ctx context.Context, projectId string, region string) (*NetworkListResponse, error) /* ListNics List all network interfaces inside a network. Get a list of all network interfaces inside a network. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return ApiListNicsRequest */ - ListNics(ctx context.Context, projectId string, networkId string) ApiListNicsRequest + ListNics(ctx context.Context, projectId string, region string, networkId string) ApiListNicsRequest /* ListNicsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return NICListResponse */ - ListNicsExecute(ctx context.Context, projectId string, networkId string) (*NICListResponse, error) + ListNicsExecute(ctx context.Context, projectId string, region string, networkId string) (*NICListResponse, error) /* ListProjectNICs List all network interfaces inside a project. Get a list of all network interfaces inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListProjectNICsRequest */ - ListProjectNICs(ctx context.Context, projectId string) ApiListProjectNICsRequest + ListProjectNICs(ctx context.Context, projectId string, region string) ApiListProjectNICsRequest /* ListProjectNICsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return NICListResponse */ - ListProjectNICsExecute(ctx context.Context, projectId string) (*NICListResponse, error) + ListProjectNICsExecute(ctx context.Context, projectId string, region string) (*NICListResponse, error) /* ListPublicIPRanges List all public IP ranges. Get a list of all public IP ranges that STACKIT uses. @@ -1490,201 +1817,268 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListPublicIPsRequest */ - ListPublicIPs(ctx context.Context, projectId string) ApiListPublicIPsRequest + ListPublicIPs(ctx context.Context, projectId string, region string) ApiListPublicIPsRequest /* ListPublicIPsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return PublicIpListResponse */ - ListPublicIPsExecute(ctx context.Context, projectId string) (*PublicIpListResponse, error) + ListPublicIPsExecute(ctx context.Context, projectId string, region string) (*PublicIpListResponse, error) /* ListQuotas List project quotas. List quota limits and usage for project resources. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListQuotasRequest */ - ListQuotas(ctx context.Context, projectId string) ApiListQuotasRequest + ListQuotas(ctx context.Context, projectId string, region string) ApiListQuotasRequest /* ListQuotasExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return QuotaListResponse */ - ListQuotasExecute(ctx context.Context, projectId string) (*QuotaListResponse, error) + ListQuotasExecute(ctx context.Context, projectId string, region string) (*QuotaListResponse, error) + /* + ListRoutesOfRoutingTable List all routes in a routing table. + Get a list of all routes in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiListRoutesOfRoutingTableRequest + */ + ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest + /* + ListRoutesOfRoutingTableExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return RouteListResponse + + */ + ListRoutesOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RouteListResponse, error) + /* + ListRoutingTablesOfArea List all routing tables in a network area. + Get a list of all routing tables in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListRoutingTablesOfAreaRequest + */ + ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest + /* + ListRoutingTablesOfAreaExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return RoutingTableListResponse + + */ + ListRoutingTablesOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string) (*RoutingTableListResponse, error) /* ListSecurityGroupRules List all rules for a security group. Get a list of all rules inside a security group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiListSecurityGroupRulesRequest */ - ListSecurityGroupRules(ctx context.Context, projectId string, securityGroupId string) ApiListSecurityGroupRulesRequest + ListSecurityGroupRules(ctx context.Context, projectId string, region string, securityGroupId string) ApiListSecurityGroupRulesRequest /* ListSecurityGroupRulesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return SecurityGroupRuleListResponse */ - ListSecurityGroupRulesExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroupRuleListResponse, error) + ListSecurityGroupRulesExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroupRuleListResponse, error) /* ListSecurityGroups List all security groups inside a project. Get a list of all security groups inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListSecurityGroupsRequest */ - ListSecurityGroups(ctx context.Context, projectId string) ApiListSecurityGroupsRequest + ListSecurityGroups(ctx context.Context, projectId string, region string) ApiListSecurityGroupsRequest /* ListSecurityGroupsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return SecurityGroupListResponse */ - ListSecurityGroupsExecute(ctx context.Context, projectId string) (*SecurityGroupListResponse, error) + ListSecurityGroupsExecute(ctx context.Context, projectId string, region string) (*SecurityGroupListResponse, error) /* - ListServerNics Get all network interfaces. + ListServerNICs Get all network interfaces. Get all network interfaces attached to the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. - @return ApiListServerNicsRequest + @return ApiListServerNICsRequest */ - ListServerNics(ctx context.Context, projectId string, serverId string) ApiListServerNicsRequest + ListServerNICs(ctx context.Context, projectId string, region string, serverId string) ApiListServerNICsRequest /* - ListServerNicsExecute executes the request + ListServerNICsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return NICListResponse */ - ListServerNicsExecute(ctx context.Context, projectId string, serverId string) (*NICListResponse, error) + ListServerNICsExecute(ctx context.Context, projectId string, region string, serverId string) (*NICListResponse, error) /* ListServerServiceAccounts List all service accounts of the Server. Get the list of the service accounts of the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiListServerServiceAccountsRequest */ - ListServerServiceAccounts(ctx context.Context, projectId string, serverId string) ApiListServerServiceAccountsRequest + ListServerServiceAccounts(ctx context.Context, projectId string, region string, serverId string) ApiListServerServiceAccountsRequest /* ListServerServiceAccountsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ServiceAccountMailListResponse */ - ListServerServiceAccountsExecute(ctx context.Context, projectId string, serverId string) (*ServiceAccountMailListResponse, error) + ListServerServiceAccountsExecute(ctx context.Context, projectId string, region string, serverId string) (*ServiceAccountMailListResponse, error) /* ListServers List all servers inside a project. Get a list of all servers inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListServersRequest */ - ListServers(ctx context.Context, projectId string) ApiListServersRequest + ListServers(ctx context.Context, projectId string, region string) ApiListServersRequest /* ListServersExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ServerListResponse */ - ListServersExecute(ctx context.Context, projectId string) (*ServerListResponse, error) + ListServersExecute(ctx context.Context, projectId string, region string) (*ServerListResponse, error) /* - ListSnapshots List all snapshots inside a project. + ListSnapshotsInProject List all snapshots inside a project. Get a list of all snapshots inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListSnapshotsRequest + @param region The STACKIT Region of the resources. + @return ApiListSnapshotsInProjectRequest */ - ListSnapshots(ctx context.Context, projectId string) ApiListSnapshotsRequest + ListSnapshotsInProject(ctx context.Context, projectId string, region string) ApiListSnapshotsInProjectRequest /* - ListSnapshotsExecute executes the request + ListSnapshotsInProjectExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return SnapshotListResponse */ - ListSnapshotsExecute(ctx context.Context, projectId string) (*SnapshotListResponse, error) + ListSnapshotsInProjectExecute(ctx context.Context, projectId string, region string) (*SnapshotListResponse, error) /* ListVolumePerformanceClasses List all volume performance classes available for a project. Get a list of all volume performance classes available inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListVolumePerformanceClassesRequest */ - ListVolumePerformanceClasses(ctx context.Context, projectId string) ApiListVolumePerformanceClassesRequest + ListVolumePerformanceClasses(ctx context.Context, projectId string, region string) ApiListVolumePerformanceClassesRequest /* ListVolumePerformanceClassesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return VolumePerformanceClassListResponse */ - ListVolumePerformanceClassesExecute(ctx context.Context, projectId string) (*VolumePerformanceClassListResponse, error) + ListVolumePerformanceClassesExecute(ctx context.Context, projectId string, region string) (*VolumePerformanceClassListResponse, error) /* ListVolumes List all volumes inside a project. Get a list of all volumes inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListVolumesRequest */ - ListVolumes(ctx context.Context, projectId string) ApiListVolumesRequest + ListVolumes(ctx context.Context, projectId string, region string) ApiListVolumesRequest /* ListVolumesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return VolumeListResponse */ - ListVolumesExecute(ctx context.Context, projectId string) (*VolumeListResponse, error) + ListVolumesExecute(ctx context.Context, projectId string, region string) (*VolumeListResponse, error) /* PartialUpdateNetwork Update network settings. Update the settings of a network inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return ApiPartialUpdateNetworkRequest */ - PartialUpdateNetwork(ctx context.Context, projectId string, networkId string) ApiPartialUpdateNetworkRequest + PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest /* PartialUpdateNetworkExecute executes the request */ - PartialUpdateNetworkExecute(ctx context.Context, projectId string, networkId string) error + PartialUpdateNetworkExecute(ctx context.Context, projectId string, region string, networkId string) error /* PartialUpdateNetworkArea Update network area settings. Update the settings of a network area in an organization. @@ -1711,364 +2105,349 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiRebootServerRequest */ - RebootServer(ctx context.Context, projectId string, serverId string) ApiRebootServerRequest + RebootServer(ctx context.Context, projectId string, region string, serverId string) ApiRebootServerRequest /* RebootServerExecute executes the request */ - RebootServerExecute(ctx context.Context, projectId string, serverId string) error + RebootServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* RemoveNetworkFromServer Detach and delete all network interfaces associated with the specified network. Detach and delete all network interfaces associated with the specified network from the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param networkId The identifier (ID) of a STACKIT Network. @return ApiRemoveNetworkFromServerRequest */ - RemoveNetworkFromServer(ctx context.Context, projectId string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest + RemoveNetworkFromServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest /* RemoveNetworkFromServerExecute executes the request */ - RemoveNetworkFromServerExecute(ctx context.Context, projectId string, serverId string, networkId string) error + RemoveNetworkFromServerExecute(ctx context.Context, projectId string, region string, serverId string, networkId string) error /* RemoveNicFromServer Detach a network interface. Detach a network interface from a server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param nicId The identifier (ID) of a network interface. @return ApiRemoveNicFromServerRequest */ - RemoveNicFromServer(ctx context.Context, projectId string, serverId string, nicId string) ApiRemoveNicFromServerRequest + RemoveNicFromServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiRemoveNicFromServerRequest /* RemoveNicFromServerExecute executes the request */ - RemoveNicFromServerExecute(ctx context.Context, projectId string, serverId string, nicId string) error + RemoveNicFromServerExecute(ctx context.Context, projectId string, region string, serverId string, nicId string) error /* RemovePublicIpFromServer Dissociate a public IP from a server. Dissociate a public IP on an existing server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param publicIpId The identifier (ID) of a Public IP. @return ApiRemovePublicIpFromServerRequest */ - RemovePublicIpFromServer(ctx context.Context, projectId string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest + RemovePublicIpFromServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest /* RemovePublicIpFromServerExecute executes the request */ - RemovePublicIpFromServerExecute(ctx context.Context, projectId string, serverId string, publicIpId string) error + RemovePublicIpFromServerExecute(ctx context.Context, projectId string, region string, serverId string, publicIpId string) error /* RemoveSecurityGroupFromServer Remove a server from a security group. Remove a server from a attached security group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiRemoveSecurityGroupFromServerRequest */ - RemoveSecurityGroupFromServer(ctx context.Context, projectId string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest + RemoveSecurityGroupFromServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest /* RemoveSecurityGroupFromServerExecute executes the request */ - RemoveSecurityGroupFromServerExecute(ctx context.Context, projectId string, serverId string, securityGroupId string) error + RemoveSecurityGroupFromServerExecute(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) error /* RemoveServiceAccountFromServer Detach a service account from a server. Detach an additional service account from the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param serviceAccountMail The e-mail address of a service account. @return ApiRemoveServiceAccountFromServerRequest */ - RemoveServiceAccountFromServer(ctx context.Context, projectId string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest + RemoveServiceAccountFromServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest /* RemoveServiceAccountFromServerExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param serviceAccountMail The e-mail address of a service account. @return ServiceAccountMailListResponse */ - RemoveServiceAccountFromServerExecute(ctx context.Context, projectId string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) + RemoveServiceAccountFromServerExecute(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) /* RemoveVolumeFromServer Detach a volume from a server. Detach an existing volume from an existing server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiRemoveVolumeFromServerRequest */ - RemoveVolumeFromServer(ctx context.Context, projectId string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest + RemoveVolumeFromServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest /* RemoveVolumeFromServerExecute executes the request */ - RemoveVolumeFromServerExecute(ctx context.Context, projectId string, serverId string, volumeId string) error + RemoveVolumeFromServerExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) error /* RescueServer Rescue an existing server. Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiRescueServerRequest */ - RescueServer(ctx context.Context, projectId string, serverId string) ApiRescueServerRequest + RescueServer(ctx context.Context, projectId string, region string, serverId string) ApiRescueServerRequest /* RescueServerExecute executes the request */ - RescueServerExecute(ctx context.Context, projectId string, serverId string) error + RescueServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* ResizeServer Resize a server. Resize the server to the given machine type. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiResizeServerRequest */ - ResizeServer(ctx context.Context, projectId string, serverId string) ApiResizeServerRequest + ResizeServer(ctx context.Context, projectId string, region string, serverId string) ApiResizeServerRequest /* ResizeServerExecute executes the request */ - ResizeServerExecute(ctx context.Context, projectId string, serverId string) error + ResizeServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* ResizeVolume Update the size of a volume. Update the size of a block device volume. The new volume size must be larger than the current size. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiResizeVolumeRequest */ - ResizeVolume(ctx context.Context, projectId string, volumeId string) ApiResizeVolumeRequest + ResizeVolume(ctx context.Context, projectId string, region string, volumeId string) ApiResizeVolumeRequest /* ResizeVolumeExecute executes the request */ - ResizeVolumeExecute(ctx context.Context, projectId string, volumeId string) error + ResizeVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) error /* RestoreBackup Restore Backup to the referenced source Volume. Restores a Backup to the existing Volume it references to. The use of this endpoint is disruptive as the volume needs to be detached. If a new volume is to be created use the volumes endpoint with the option to create from backup. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param backupId The identifier (ID) of a STACKIT Backup. @return ApiRestoreBackupRequest */ - RestoreBackup(ctx context.Context, projectId string, backupId string) ApiRestoreBackupRequest + RestoreBackup(ctx context.Context, projectId string, region string, backupId string) ApiRestoreBackupRequest /* RestoreBackupExecute executes the request */ - RestoreBackupExecute(ctx context.Context, projectId string, backupId string) error + RestoreBackupExecute(ctx context.Context, projectId string, region string, backupId string) error /* SetImageShare Set image share. Set share of an Image. New Options will replace existing settings. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiSetImageShareRequest */ - SetImageShare(ctx context.Context, projectId string, imageId string) ApiSetImageShareRequest + SetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiSetImageShareRequest /* SetImageShareExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ImageShare */ - SetImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) + SetImageShareExecute(ctx context.Context, projectId string, region string, imageId string) (*ImageShare, error) /* StartServer Boot up a server. Start an existing server or allocates the server if deallocated. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiStartServerRequest */ - StartServer(ctx context.Context, projectId string, serverId string) ApiStartServerRequest + StartServer(ctx context.Context, projectId string, region string, serverId string) ApiStartServerRequest /* StartServerExecute executes the request */ - StartServerExecute(ctx context.Context, projectId string, serverId string) error + StartServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* StopServer Stop an existing server. Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiStopServerRequest */ - StopServer(ctx context.Context, projectId string, serverId string) ApiStopServerRequest + StopServer(ctx context.Context, projectId string, region string, serverId string) ApiStopServerRequest /* StopServerExecute executes the request */ - StopServerExecute(ctx context.Context, projectId string, serverId string) error + StopServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* UnrescueServer Unrescue an existing server. Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiUnrescueServerRequest */ - UnrescueServer(ctx context.Context, projectId string, serverId string) ApiUnrescueServerRequest + UnrescueServer(ctx context.Context, projectId string, region string, serverId string) ApiUnrescueServerRequest /* UnrescueServerExecute executes the request */ - UnrescueServerExecute(ctx context.Context, projectId string, serverId string) error + UnrescueServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* UpdateAttachedVolume Update Volume Attachment Parameters. Update the properties of an existing Volume Attachment. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiUpdateAttachedVolumeRequest */ - UpdateAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest + UpdateAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest /* UpdateAttachedVolumeExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param volumeId The identifier (ID) of a STACKIT Volume. @return VolumeAttachment */ - UpdateAttachedVolumeExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) + UpdateAttachedVolumeExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) (*VolumeAttachment, error) /* UpdateBackup Update information of a backup. Update name or labels of the backup. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param backupId The identifier (ID) of a STACKIT Backup. @return ApiUpdateBackupRequest */ - UpdateBackup(ctx context.Context, projectId string, backupId string) ApiUpdateBackupRequest + UpdateBackup(ctx context.Context, projectId string, region string, backupId string) ApiUpdateBackupRequest /* UpdateBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param backupId The identifier (ID) of a STACKIT Backup. @return Backup */ - UpdateBackupExecute(ctx context.Context, projectId string, backupId string) (*Backup, error) + UpdateBackupExecute(ctx context.Context, projectId string, region string, backupId string) (*Backup, error) /* UpdateImage Update Image Parameters. Update the properties of an existing Image inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiUpdateImageRequest */ - UpdateImage(ctx context.Context, projectId string, imageId string) ApiUpdateImageRequest + UpdateImage(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageRequest /* UpdateImageExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return Image */ - UpdateImageExecute(ctx context.Context, projectId string, imageId string) (*Image, error) - /* - UpdateImageScopeLocal Update Image Scope to Local. - Update the scope property of an existing Image inside a project to local. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiUpdateImageScopeLocalRequest - */ - UpdateImageScopeLocal(ctx context.Context, projectId string, imageId string) ApiUpdateImageScopeLocalRequest - /* - UpdateImageScopeLocalExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return Image - - */ - UpdateImageScopeLocalExecute(ctx context.Context, projectId string, imageId string) (*Image, error) - /* - UpdateImageScopePublic Update Image Scope to Public. - Update the scope property of an existing Image inside a project to public. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiUpdateImageScopePublicRequest - */ - UpdateImageScopePublic(ctx context.Context, projectId string, imageId string) ApiUpdateImageScopePublicRequest - /* - UpdateImageScopePublicExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return Image - - */ - UpdateImageScopePublicExecute(ctx context.Context, projectId string, imageId string) (*Image, error) + UpdateImageExecute(ctx context.Context, projectId string, region string, imageId string) (*Image, error) /* UpdateImageShare Update image share. Update share of an Image. Projects will be appended to existing list. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiUpdateImageShareRequest */ - UpdateImageShare(ctx context.Context, projectId string, imageId string) ApiUpdateImageShareRequest + UpdateImageShare(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageShareRequest /* UpdateImageShareExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ImageShare */ - UpdateImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) + UpdateImageShareExecute(ctx context.Context, projectId string, region string, imageId string) (*ImageShare, error) /* UpdateKeyPair Update information of an SSH keypair. Update labels of the SSH keypair. @@ -2087,6 +2466,28 @@ type DefaultApi interface { */ UpdateKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) + /* + UpdateNetworkAreaRegion Update a region for a network area. + Update a new region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiUpdateNetworkAreaRegionRequest + */ + UpdateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiUpdateNetworkAreaRegionRequest + /* + UpdateNetworkAreaRegionExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return RegionalArea + + */ + UpdateNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) (*RegionalArea, error) /* UpdateNetworkAreaRoute Update a network route. Update a network route defined in a network area. @@ -2094,143 +2495,207 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @param routeId The identifier (ID) of a STACKIT Route. @return ApiUpdateNetworkAreaRouteRequest */ - UpdateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiUpdateNetworkAreaRouteRequest + UpdateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiUpdateNetworkAreaRouteRequest /* UpdateNetworkAreaRouteExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. @param routeId The identifier (ID) of a STACKIT Route. @return Route */ - UpdateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, routeId string) (*Route, error) + UpdateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string, routeId string) (*Route, error) /* UpdateNic Update a network interface. Update the properties of an existing network interface inside a network. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @param nicId The identifier (ID) of a network interface. @return ApiUpdateNicRequest */ - UpdateNic(ctx context.Context, projectId string, networkId string, nicId string) ApiUpdateNicRequest + UpdateNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiUpdateNicRequest /* UpdateNicExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @param nicId The identifier (ID) of a network interface. @return NIC */ - UpdateNicExecute(ctx context.Context, projectId string, networkId string, nicId string) (*NIC, error) + UpdateNicExecute(ctx context.Context, projectId string, region string, networkId string, nicId string) (*NIC, error) /* UpdatePublicIP Update a public IP. Update the properties of an existing public IP inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param publicIpId The identifier (ID) of a Public IP. @return ApiUpdatePublicIPRequest */ - UpdatePublicIP(ctx context.Context, projectId string, publicIpId string) ApiUpdatePublicIPRequest + UpdatePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiUpdatePublicIPRequest /* UpdatePublicIPExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param publicIpId The identifier (ID) of a Public IP. @return PublicIp */ - UpdatePublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, error) + UpdatePublicIPExecute(ctx context.Context, projectId string, region string, publicIpId string) (*PublicIp, error) + /* + UpdateRouteOfRoutingTable Update a route of a routing table. + Update a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateRouteOfRoutingTableRequest + */ + UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest + /* + UpdateRouteOfRoutingTableExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return Route + + */ + UpdateRouteOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) (*Route, error) + /* + UpdateRoutingTableOfArea Update a routing table. + Update a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiUpdateRoutingTableOfAreaRequest + */ + UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest + /* + UpdateRoutingTableOfAreaExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return RoutingTable + + */ + UpdateRoutingTableOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RoutingTable, error) /* UpdateSecurityGroup Update information of a security group. Update labels of the security group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiUpdateSecurityGroupRequest */ - UpdateSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiUpdateSecurityGroupRequest + UpdateSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiUpdateSecurityGroupRequest /* UpdateSecurityGroupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return SecurityGroup */ - UpdateSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) + UpdateSecurityGroupExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroup, error) /* UpdateServer Update information of a server. Update name or labels of the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiUpdateServerRequest */ - UpdateServer(ctx context.Context, projectId string, serverId string) ApiUpdateServerRequest + UpdateServer(ctx context.Context, projectId string, region string, serverId string) ApiUpdateServerRequest /* UpdateServerExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return Server */ - UpdateServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) + UpdateServerExecute(ctx context.Context, projectId string, region string, serverId string) (*Server, error) /* UpdateSnapshot Update information of the snapshot. Update information like name or labels of the snapshot. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param snapshotId The identifier (ID) of a STACKIT Snapshot. @return ApiUpdateSnapshotRequest */ - UpdateSnapshot(ctx context.Context, projectId string, snapshotId string) ApiUpdateSnapshotRequest + UpdateSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiUpdateSnapshotRequest /* UpdateSnapshotExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param snapshotId The identifier (ID) of a STACKIT Snapshot. @return Snapshot */ - UpdateSnapshotExecute(ctx context.Context, projectId string, snapshotId string) (*Snapshot, error) + UpdateSnapshotExecute(ctx context.Context, projectId string, region string, snapshotId string) (*Snapshot, error) /* UpdateVolume Update information of a volume. Update name, description or labels of the volume. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiUpdateVolumeRequest */ - UpdateVolume(ctx context.Context, projectId string, volumeId string) ApiUpdateVolumeRequest + UpdateVolume(ctx context.Context, projectId string, region string, volumeId string) ApiUpdateVolumeRequest /* UpdateVolumeExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param volumeId The identifier (ID) of a STACKIT Volume. @return Volume */ - UpdateVolumeExecute(ctx context.Context, projectId string, volumeId string) (*Volume, error) + UpdateVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) (*Volume, error) } type ApiAddNetworkToServerRequest interface { @@ -2245,6 +2710,18 @@ type ApiAddPublicIpToServerRequest interface { Execute() error } +type ApiAddRoutesToRoutingTableRequest interface { + // Request an addition of routes to a routing table. + AddRoutesToRoutingTablePayload(addRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload) ApiAddRoutesToRoutingTableRequest + Execute() (*RouteListResponse, error) +} + +type ApiAddRoutingTableToAreaRequest interface { + // Request an addition of a routing table to an area. + AddRoutingTableToAreaPayload(addRoutingTableToAreaPayload AddRoutingTableToAreaPayload) ApiAddRoutingTableToAreaRequest + Execute() (*RoutingTable, error) +} + type ApiAddSecurityGroupToServerRequest interface { Execute() error } @@ -2290,7 +2767,7 @@ type ApiCreateNetworkRequest interface { } type ApiCreateNetworkAreaRequest interface { - // Request an area creation. + // Request an Area creation. CreateNetworkAreaPayload(createNetworkAreaPayload CreateNetworkAreaPayload) ApiCreateNetworkAreaRequest Execute() (*NetworkArea, error) } @@ -2301,6 +2778,12 @@ type ApiCreateNetworkAreaRangeRequest interface { Execute() (*NetworkRangeListResponse, error) } +type ApiCreateNetworkAreaRegionRequest interface { + // Request to add a new regional network area configuration. + CreateNetworkAreaRegionPayload(createNetworkAreaRegionPayload CreateNetworkAreaRegionPayload) ApiCreateNetworkAreaRegionRequest + Execute() (*RegionalArea, error) +} + type ApiCreateNetworkAreaRouteRequest interface { // Request an addition of routes to an area. CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload CreateNetworkAreaRoutePayload) ApiCreateNetworkAreaRouteRequest @@ -2391,6 +2874,10 @@ type ApiDeleteNetworkAreaRangeRequest interface { Execute() error } +type ApiDeleteNetworkAreaRegionRequest interface { + Execute() error +} + type ApiDeleteNetworkAreaRouteRequest interface { Execute() error } @@ -2403,6 +2890,14 @@ type ApiDeletePublicIPRequest interface { Execute() error } +type ApiDeleteRouteFromRoutingTableRequest interface { + Execute() error +} + +type ApiDeleteRoutingTableFromAreaRequest interface { + Execute() error +} + type ApiDeleteSecurityGroupRequest interface { Execute() error } @@ -2467,6 +2962,10 @@ type ApiGetNetworkAreaRangeRequest interface { Execute() (*NetworkRange, error) } +type ApiGetNetworkAreaRegionRequest interface { + Execute() (*RegionalArea, error) +} + type ApiGetNetworkAreaRouteRequest interface { Execute() (*Route, error) } @@ -2495,6 +2994,14 @@ type ApiGetPublicIPRequest interface { Execute() (*PublicIp, error) } +type ApiGetRouteOfRoutingTableRequest interface { + Execute() (*Route, error) +} + +type ApiGetRoutingTableOfAreaRequest interface { + Execute() (*RoutingTable, error) +} + type ApiGetSecurityGroupRequest interface { Execute() (*SecurityGroup, error) } @@ -2577,6 +3084,10 @@ type ApiListNetworkAreaRangesRequest interface { Execute() (*NetworkRangeListResponse, error) } +type ApiListNetworkAreaRegionsRequest interface { + Execute() (*RegionalAreaListResponse, error) +} + type ApiListNetworkAreaRoutesRequest interface { // Filter resources by labels. LabelSelector(labelSelector string) ApiListNetworkAreaRoutesRequest @@ -2621,6 +3132,18 @@ type ApiListQuotasRequest interface { Execute() (*QuotaListResponse, error) } +type ApiListRoutesOfRoutingTableRequest interface { + // Filter resources by labels. + LabelSelector(labelSelector string) ApiListRoutesOfRoutingTableRequest + Execute() (*RouteListResponse, error) +} + +type ApiListRoutingTablesOfAreaRequest interface { + // Filter resources by labels. + LabelSelector(labelSelector string) ApiListRoutingTablesOfAreaRequest + Execute() (*RoutingTableListResponse, error) +} + type ApiListSecurityGroupRulesRequest interface { Execute() (*SecurityGroupRuleListResponse, error) } @@ -2631,7 +3154,7 @@ type ApiListSecurityGroupsRequest interface { Execute() (*SecurityGroupListResponse, error) } -type ApiListServerNicsRequest interface { +type ApiListServerNICsRequest interface { Execute() (*NICListResponse, error) } @@ -2647,9 +3170,9 @@ type ApiListServersRequest interface { Execute() (*ServerListResponse, error) } -type ApiListSnapshotsRequest interface { +type ApiListSnapshotsInProjectRequest interface { // Filter resources by labels. - LabelSelector(labelSelector string) ApiListSnapshotsRequest + LabelSelector(labelSelector string) ApiListSnapshotsInProjectRequest Execute() (*SnapshotListResponse, error) } @@ -2672,7 +3195,7 @@ type ApiPartialUpdateNetworkRequest interface { } type ApiPartialUpdateNetworkAreaRequest interface { - // Request to update an area. + // Request to update an Area. PartialUpdateNetworkAreaPayload(partialUpdateNetworkAreaPayload PartialUpdateNetworkAreaPayload) ApiPartialUpdateNetworkAreaRequest Execute() (*NetworkArea, error) } @@ -2765,14 +3288,6 @@ type ApiUpdateImageRequest interface { Execute() (*Image, error) } -type ApiUpdateImageScopeLocalRequest interface { - Execute() (*Image, error) -} - -type ApiUpdateImageScopePublicRequest interface { - Execute() (*Image, error) -} - type ApiUpdateImageShareRequest interface { // Update an Image Share. UpdateImageSharePayload(updateImageSharePayload UpdateImageSharePayload) ApiUpdateImageShareRequest @@ -2785,6 +3300,12 @@ type ApiUpdateKeyPairRequest interface { Execute() (*Keypair, error) } +type ApiUpdateNetworkAreaRegionRequest interface { + // Request an update of a regional network area. + UpdateNetworkAreaRegionPayload(updateNetworkAreaRegionPayload UpdateNetworkAreaRegionPayload) ApiUpdateNetworkAreaRegionRequest + Execute() (*RegionalArea, error) +} + type ApiUpdateNetworkAreaRouteRequest interface { // Request an update of a network route. UpdateNetworkAreaRoutePayload(updateNetworkAreaRoutePayload UpdateNetworkAreaRoutePayload) ApiUpdateNetworkAreaRouteRequest @@ -2803,6 +3324,18 @@ type ApiUpdatePublicIPRequest interface { Execute() (*PublicIp, error) } +type ApiUpdateRouteOfRoutingTableRequest interface { + // Request an update of a route in a routing table. + UpdateRouteOfRoutingTablePayload(updateRouteOfRoutingTablePayload UpdateRouteOfRoutingTablePayload) ApiUpdateRouteOfRoutingTableRequest + Execute() (*Route, error) +} + +type ApiUpdateRoutingTableOfAreaRequest interface { + // Request an update of a routing table. + UpdateRoutingTableOfAreaPayload(updateRoutingTableOfAreaPayload UpdateRoutingTableOfAreaPayload) ApiUpdateRoutingTableOfAreaRequest + Execute() (*RoutingTable, error) +} + type ApiUpdateSecurityGroupRequest interface { // Request an update of a security group. UpdateSecurityGroupPayload(updateSecurityGroupPayload UpdateSecurityGroupPayload) ApiUpdateSecurityGroupRequest @@ -2834,6 +3367,7 @@ type AddNetworkToServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string networkId string } @@ -2854,8 +3388,9 @@ func (r AddNetworkToServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/networks/{networkId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) @@ -2997,25 +3532,28 @@ Create and attach a network interface from the specified network to the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param networkId The identifier (ID) of a STACKIT Network. @return ApiAddNetworkToServerRequest */ -func (a *APIClient) AddNetworkToServer(ctx context.Context, projectId string, serverId string, networkId string) ApiAddNetworkToServerRequest { +func (a *APIClient) AddNetworkToServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiAddNetworkToServerRequest { return AddNetworkToServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, networkId: networkId, } } -func (a *APIClient) AddNetworkToServerExecute(ctx context.Context, projectId string, serverId string, networkId string) error { +func (a *APIClient) AddNetworkToServerExecute(ctx context.Context, projectId string, region string, serverId string, networkId string) error { r := AddNetworkToServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, networkId: networkId, } @@ -3026,6 +3564,7 @@ type AddNicToServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string nicId string } @@ -3046,8 +3585,9 @@ func (r AddNicToServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/nics/{nicId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) @@ -3200,25 +3740,28 @@ Attach an existing network interface to a server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param nicId The identifier (ID) of a network interface. @return ApiAddNicToServerRequest */ -func (a *APIClient) AddNicToServer(ctx context.Context, projectId string, serverId string, nicId string) ApiAddNicToServerRequest { +func (a *APIClient) AddNicToServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiAddNicToServerRequest { return AddNicToServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, nicId: nicId, } } -func (a *APIClient) AddNicToServerExecute(ctx context.Context, projectId string, serverId string, nicId string) error { +func (a *APIClient) AddNicToServerExecute(ctx context.Context, projectId string, region string, serverId string, nicId string) error { r := AddNicToServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, nicId: nicId, } @@ -3229,6 +3772,7 @@ type AddPublicIpToServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string publicIpId string } @@ -3249,8 +3793,9 @@ func (r AddPublicIpToServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/public-ips/{publicIpId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) @@ -3403,84 +3948,101 @@ Associate a public IP to a server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param publicIpId The identifier (ID) of a Public IP. @return ApiAddPublicIpToServerRequest */ -func (a *APIClient) AddPublicIpToServer(ctx context.Context, projectId string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest { +func (a *APIClient) AddPublicIpToServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest { return AddPublicIpToServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, publicIpId: publicIpId, } } -func (a *APIClient) AddPublicIpToServerExecute(ctx context.Context, projectId string, serverId string, publicIpId string) error { +func (a *APIClient) AddPublicIpToServerExecute(ctx context.Context, projectId string, region string, serverId string, publicIpId string) error { r := AddPublicIpToServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, publicIpId: publicIpId, } return r.Execute() } -type AddSecurityGroupToServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - securityGroupId string +type AddRoutesToRoutingTableRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string + addRoutesToRoutingTablePayload *AddRoutesToRoutingTablePayload } -func (r AddSecurityGroupToServerRequest) Execute() error { +// Request an addition of routes to a routing table. + +func (r AddRoutesToRoutingTableRequest) AddRoutesToRoutingTablePayload(addRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload) ApiAddRoutesToRoutingTableRequest { + r.addRoutesToRoutingTablePayload = &addRoutesToRoutingTablePayload + return r +} + +func (r AddRoutesToRoutingTableRequest) Execute() (*RouteListResponse, error) { var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { - return fmt.Errorf("could not parse client to type APIClient") + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.AddSecurityGroupToServer") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.AddRoutesToRoutingTable") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(r.routingTableId, "routingTableId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return fmt.Errorf("serverId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return fmt.Errorf("securityGroupId must have at least 36 elements") + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have at least 36 elements") } - if strlen(r.securityGroupId) > 36 { - return fmt.Errorf("securityGroupId must have less than 36 elements") + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have less than 36 elements") + } + if r.addRoutesToRoutingTablePayload == nil { + return localVarReturnValue, fmt.Errorf("addRoutesToRoutingTablePayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -3496,9 +4058,11 @@ func (r AddSecurityGroupToServerRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.addRoutesToRoutingTablePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return err + return localVarReturnValue, err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -3512,14 +4076,14 @@ func (r AddSecurityGroupToServerRequest) Execute() error { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return err + return localVarReturnValue, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return err + return localVarReturnValue, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -3533,155 +4097,176 @@ func (r AddSecurityGroupToServerRequest) Execute() error { err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 409 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return newErr + return localVarReturnValue, newErr } - return nil + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil } /* -AddSecurityGroupToServer: Add a server to a security group. +AddRoutesToRoutingTable: Create new routes in a routing table. -Add an existing server to an existing security group. +Create new routes in an existing routing table. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiAddSecurityGroupToServerRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiAddRoutesToRoutingTableRequest */ -func (a *APIClient) AddSecurityGroupToServer(ctx context.Context, projectId string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest { - return AddSecurityGroupToServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - securityGroupId: securityGroupId, +func (a *APIClient) AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest { + return AddRoutesToRoutingTableRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, } } -func (a *APIClient) AddSecurityGroupToServerExecute(ctx context.Context, projectId string, serverId string, securityGroupId string) error { - r := AddSecurityGroupToServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - securityGroupId: securityGroupId, +func (a *APIClient) AddRoutesToRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RouteListResponse, error) { + r := AddRoutesToRoutingTableRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, } return r.Execute() } -type AddServiceAccountToServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - serviceAccountMail string +type AddRoutingTableToAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + addRoutingTableToAreaPayload *AddRoutingTableToAreaPayload } -func (r AddServiceAccountToServerRequest) Execute() (*ServiceAccountMailListResponse, error) { +// Request an addition of a routing table to an area. + +func (r AddRoutingTableToAreaRequest) AddRoutingTableToAreaPayload(addRoutingTableToAreaPayload AddRoutingTableToAreaPayload) ApiAddRoutingTableToAreaRequest { + r.addRoutingTableToAreaPayload = &addRoutingTableToAreaPayload + return r +} + +func (r AddRoutingTableToAreaRequest) Execute() (*RoutingTable, error) { var ( - localVarHTTPMethod = http.MethodPut + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ServiceAccountMailListResponse + localVarReturnValue *RoutingTable ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.AddServiceAccountToServer") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.AddRoutingTableToArea") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(r.serviceAccountMail, "serviceAccountMail")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } - if strlen(r.serviceAccountMail) > 255 { - return localVarReturnValue, fmt.Errorf("serviceAccountMail must have less than 255 elements") + if r.addRoutingTableToAreaPayload == nil { + return localVarReturnValue, fmt.Errorf("addRoutingTableToAreaPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -3697,6 +4282,8 @@ func (r AddServiceAccountToServerRequest) Execute() (*ServiceAccountMailListResp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.addRoutingTableToAreaPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -3811,99 +4398,92 @@ func (r AddServiceAccountToServerRequest) Execute() (*ServiceAccountMailListResp } /* -AddServiceAccountToServer: Attach service account to a server. +AddRoutingTableToArea: Create new routing table in a network area. -Attach an additional service account to the server. +Create a new routing table in an existing network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @param serviceAccountMail The e-mail address of a service account. - @return ApiAddServiceAccountToServerRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiAddRoutingTableToAreaRequest */ -func (a *APIClient) AddServiceAccountToServer(ctx context.Context, projectId string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest { - return AddServiceAccountToServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - serviceAccountMail: serviceAccountMail, +func (a *APIClient) AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest { + return AddRoutingTableToAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } } -func (a *APIClient) AddServiceAccountToServerExecute(ctx context.Context, projectId string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) { - r := AddServiceAccountToServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - serviceAccountMail: serviceAccountMail, +func (a *APIClient) AddRoutingTableToAreaExecute(ctx context.Context, organizationId string, areaId string, region string) (*RoutingTable, error) { + r := AddRoutingTableToAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } return r.Execute() } -type AddVolumeToServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - volumeId string - addVolumeToServerPayload *AddVolumeToServerPayload -} - -// Request a volume attachment creation. - -func (r AddVolumeToServerRequest) AddVolumeToServerPayload(addVolumeToServerPayload AddVolumeToServerPayload) ApiAddVolumeToServerRequest { - r.addVolumeToServerPayload = &addVolumeToServerPayload - return r +type AddSecurityGroupToServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + serverId string + securityGroupId string } -func (r AddVolumeToServerRequest) Execute() (*VolumeAttachment, error) { +func (r AddSecurityGroupToServerRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VolumeAttachment + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { - return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.AddVolumeToServer") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.AddSecurityGroupToServer") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/security-groups/{securityGroupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + return fmt.Errorf("projectId must have at least 36 elements") } if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + return fmt.Errorf("projectId must have less than 36 elements") } if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") + return fmt.Errorf("serverId must have at least 36 elements") } if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + return fmt.Errorf("serverId must have less than 36 elements") } - if strlen(r.volumeId) < 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") + if strlen(r.securityGroupId) < 36 { + return fmt.Errorf("securityGroupId must have at least 36 elements") } - if strlen(r.volumeId) > 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") + if strlen(r.securityGroupId) > 36 { + return fmt.Errorf("securityGroupId must have less than 36 elements") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -3919,11 +4499,9 @@ func (r AddVolumeToServerRequest) Execute() (*VolumeAttachment, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.addVolumeToServerPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -3937,14 +4515,14 @@ func (r AddVolumeToServerRequest) Execute() (*VolumeAttachment, error) { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + return err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, err + return err } if localVarHTTPResponse.StatusCode >= 300 { @@ -3958,147 +4536,138 @@ func (r AddVolumeToServerRequest) Execute() (*VolumeAttachment, error) { err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 409 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return localVarReturnValue, newErr - } - - err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr + return newErr } - return localVarReturnValue, nil + return nil } /* -AddVolumeToServer: Attach a volume to a server. +AddSecurityGroupToServer: Add a server to a security group. -Attach an existing volume to an existing server. +Add an existing server to an existing security group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. - @param volumeId The identifier (ID) of a STACKIT Volume. - @return ApiAddVolumeToServerRequest + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiAddSecurityGroupToServerRequest */ -func (a *APIClient) AddVolumeToServer(ctx context.Context, projectId string, serverId string, volumeId string) ApiAddVolumeToServerRequest { - return AddVolumeToServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - volumeId: volumeId, +func (a *APIClient) AddSecurityGroupToServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest { + return AddSecurityGroupToServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + securityGroupId: securityGroupId, } } -func (a *APIClient) AddVolumeToServerExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) { - r := AddVolumeToServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - volumeId: volumeId, +func (a *APIClient) AddSecurityGroupToServerExecute(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) error { + r := AddSecurityGroupToServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + securityGroupId: securityGroupId, } return r.Execute() } -type CreateAffinityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createAffinityGroupPayload *CreateAffinityGroupPayload -} - -// Request a affinity group creation. - -func (r CreateAffinityGroupRequest) CreateAffinityGroupPayload(createAffinityGroupPayload CreateAffinityGroupPayload) ApiCreateAffinityGroupRequest { - r.createAffinityGroupPayload = &createAffinityGroupPayload - return r +type AddServiceAccountToServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + serverId string + serviceAccountMail string } -func (r CreateAffinityGroupRequest) Execute() (*AffinityGroup, error) { +func (r AddServiceAccountToServerRequest) Execute() (*ServiceAccountMailListResponse, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AffinityGroup + localVarReturnValue *ServiceAccountMailListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateAffinityGroup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.AddServiceAccountToServer") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/affinity-groups" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts/{serviceAccountMail}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(r.serviceAccountMail, "serviceAccountMail")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4109,12 +4678,18 @@ func (r CreateAffinityGroupRequest) Execute() (*AffinityGroup, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.createAffinityGroupPayload == nil { - return localVarReturnValue, fmt.Errorf("createAffinityGroupPayload is required and must be specified") + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + } + if strlen(r.serviceAccountMail) > 255 { + return localVarReturnValue, fmt.Errorf("serviceAccountMail must have less than 255 elements") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -4130,8 +4705,6 @@ func (r CreateAffinityGroupRequest) Execute() (*AffinityGroup, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createAffinityGroupPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -4208,6 +4781,17 @@ func (r CreateAffinityGroupRequest) Execute() (*AffinityGroup, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4235,64 +4819,79 @@ func (r CreateAffinityGroupRequest) Execute() (*AffinityGroup, error) { } /* -CreateAffinityGroup: Create a new affinity group in a project. +AddServiceAccountToServer: Attach service account to a server. -Create a new server affinity group in the given project ID. +Attach an additional service account to the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateAffinityGroupRequest + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param serviceAccountMail The e-mail address of a service account. + @return ApiAddServiceAccountToServerRequest */ -func (a *APIClient) CreateAffinityGroup(ctx context.Context, projectId string) ApiCreateAffinityGroupRequest { - return CreateAffinityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) AddServiceAccountToServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest { + return AddServiceAccountToServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + serviceAccountMail: serviceAccountMail, } } -func (a *APIClient) CreateAffinityGroupExecute(ctx context.Context, projectId string) (*AffinityGroup, error) { - r := CreateAffinityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) AddServiceAccountToServerExecute(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) { + r := AddServiceAccountToServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + serviceAccountMail: serviceAccountMail, } return r.Execute() } -type CreateBackupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createBackupPayload *CreateBackupPayload +type AddVolumeToServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + serverId string + volumeId string + addVolumeToServerPayload *AddVolumeToServerPayload } -// Request a backup creation. +// Request a volume attachment creation. -func (r CreateBackupRequest) CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest { - r.createBackupPayload = &createBackupPayload +func (r AddVolumeToServerRequest) AddVolumeToServerPayload(addVolumeToServerPayload AddVolumeToServerPayload) ApiAddVolumeToServerRequest { + r.addVolumeToServerPayload = &addVolumeToServerPayload return r } -func (r CreateBackupRequest) Execute() (*Backup, error) { +func (r AddVolumeToServerRequest) Execute() (*VolumeAttachment, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Backup + localVarReturnValue *VolumeAttachment ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateBackup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.AddVolumeToServer") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/backups" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4303,8 +4902,17 @@ func (r CreateBackupRequest) Execute() (*Backup, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.createBackupPayload == nil { - return localVarReturnValue, fmt.Errorf("createBackupPayload is required and must be specified") + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") } // to determine the Content-Type header @@ -4325,7 +4933,7 @@ func (r CreateBackupRequest) Execute() (*Backup, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createBackupPayload + localVarPostBody = r.addVolumeToServerPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -4402,6 +5010,17 @@ func (r CreateBackupRequest) Execute() (*Backup, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4429,64 +5048,75 @@ func (r CreateBackupRequest) Execute() (*Backup, error) { } /* -CreateBackup: Create new Backup. +AddVolumeToServer: Attach a volume to a server. -Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. +Attach an existing volume to an existing server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateBackupRequest + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiAddVolumeToServerRequest */ -func (a *APIClient) CreateBackup(ctx context.Context, projectId string) ApiCreateBackupRequest { - return CreateBackupRequest{ +func (a *APIClient) AddVolumeToServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiAddVolumeToServerRequest { + return AddVolumeToServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, } } -func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string) (*Backup, error) { - r := CreateBackupRequest{ +func (a *APIClient) AddVolumeToServerExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) (*VolumeAttachment, error) { + r := AddVolumeToServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, } return r.Execute() } -type CreateImageRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createImagePayload *CreateImagePayload +type CreateAffinityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + createAffinityGroupPayload *CreateAffinityGroupPayload } -// Request an image creation. +// Request a affinity group creation. -func (r CreateImageRequest) CreateImagePayload(createImagePayload CreateImagePayload) ApiCreateImageRequest { - r.createImagePayload = &createImagePayload +func (r CreateAffinityGroupRequest) CreateAffinityGroupPayload(createAffinityGroupPayload CreateAffinityGroupPayload) ApiCreateAffinityGroupRequest { + r.createAffinityGroupPayload = &createAffinityGroupPayload return r } -func (r CreateImageRequest) Execute() (*ImageCreateResponse, error) { +func (r CreateAffinityGroupRequest) Execute() (*AffinityGroup, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ImageCreateResponse + localVarReturnValue *AffinityGroup ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateImage") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateAffinityGroup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/images" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/affinity-groups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4497,8 +5127,8 @@ func (r CreateImageRequest) Execute() (*ImageCreateResponse, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.createImagePayload == nil { - return localVarReturnValue, fmt.Errorf("createImagePayload is required and must be specified") + if r.createAffinityGroupPayload == nil { + return localVarReturnValue, fmt.Errorf("createAffinityGroupPayload is required and must be specified") } // to determine the Content-Type header @@ -4519,7 +5149,7 @@ func (r CreateImageRequest) Execute() (*ImageCreateResponse, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createImagePayload + localVarPostBody = r.createAffinityGroupPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -4596,17 +5226,6 @@ func (r CreateImageRequest) Execute() (*ImageCreateResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 429 { - var v Error - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4634,68 +5253,81 @@ func (r CreateImageRequest) Execute() (*ImageCreateResponse, error) { } /* -CreateImage: Create new Image. +CreateAffinityGroup: Create a new affinity group in a project. -Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. +Create a new server affinity group in the given project ID. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateImageRequest + @param region The STACKIT Region of the resources. + @return ApiCreateAffinityGroupRequest */ -func (a *APIClient) CreateImage(ctx context.Context, projectId string) ApiCreateImageRequest { - return CreateImageRequest{ +func (a *APIClient) CreateAffinityGroup(ctx context.Context, projectId string, region string) ApiCreateAffinityGroupRequest { + return CreateAffinityGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) CreateImageExecute(ctx context.Context, projectId string) (*ImageCreateResponse, error) { - r := CreateImageRequest{ +func (a *APIClient) CreateAffinityGroupExecute(ctx context.Context, projectId string, region string) (*AffinityGroup, error) { + r := CreateAffinityGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } -type CreateKeyPairRequest struct { - ctx context.Context - apiService *DefaultApiService - createKeyPairPayload *CreateKeyPairPayload +type CreateBackupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + createBackupPayload *CreateBackupPayload } -// Request a public key import. +// Request a backup creation. -func (r CreateKeyPairRequest) CreateKeyPairPayload(createKeyPairPayload CreateKeyPairPayload) ApiCreateKeyPairRequest { - r.createKeyPairPayload = &createKeyPairPayload +func (r CreateBackupRequest) CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest { + r.createBackupPayload = &createBackupPayload return r } -func (r CreateKeyPairRequest) Execute() (*Keypair, error) { +func (r CreateBackupRequest) Execute() (*Backup, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Keypair + localVarReturnValue *Backup ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateKeyPair") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateBackup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/keypairs" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createKeyPairPayload == nil { - return localVarReturnValue, fmt.Errorf("createKeyPairPayload is required and must be specified") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if r.createBackupPayload == nil { + return localVarReturnValue, fmt.Errorf("createBackupPayload is required and must be specified") } // to determine the Content-Type header @@ -4716,7 +5348,7 @@ func (r CreateKeyPairRequest) Execute() (*Keypair, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createKeyPairPayload + localVarPostBody = r.createBackupPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -4793,17 +5425,6 @@ func (r CreateKeyPairRequest) Execute() (*Keypair, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4831,61 +5452,69 @@ func (r CreateKeyPairRequest) Execute() (*Keypair, error) { } /* -CreateKeyPair: Import a public key. +CreateBackup: Create new Backup. -Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. Supported keypair types are ecdsa, ed25519 and rsa. +Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateKeyPairRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateBackupRequest */ -func (a *APIClient) CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest { - return CreateKeyPairRequest{ +func (a *APIClient) CreateBackup(ctx context.Context, projectId string, region string) ApiCreateBackupRequest { + return CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, + projectId: projectId, + region: region, } } -func (a *APIClient) CreateKeyPairExecute(ctx context.Context) (*Keypair, error) { - r := CreateKeyPairRequest{ +func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string, region string) (*Backup, error) { + r := CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, + projectId: projectId, + region: region, } return r.Execute() } -type CreateNetworkRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createNetworkPayload *CreateNetworkPayload +type CreateImageRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + createImagePayload *CreateImagePayload } -// Request a network creation. +// Request an image creation. -func (r CreateNetworkRequest) CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest { - r.createNetworkPayload = &createNetworkPayload +func (r CreateImageRequest) CreateImagePayload(createImagePayload CreateImagePayload) ApiCreateImageRequest { + r.createImagePayload = &createImagePayload return r } -func (r CreateNetworkRequest) Execute() (*Network, error) { +func (r CreateImageRequest) Execute() (*ImageCreateResponse, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Network + localVarReturnValue *ImageCreateResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetwork") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateImage") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/networks" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4896,8 +5525,8 @@ func (r CreateNetworkRequest) Execute() (*Network, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.createNetworkPayload == nil { - return localVarReturnValue, fmt.Errorf("createNetworkPayload is required and must be specified") + if r.createImagePayload == nil { + return localVarReturnValue, fmt.Errorf("createImagePayload is required and must be specified") } // to determine the Content-Type header @@ -4918,7 +5547,7 @@ func (r CreateNetworkRequest) Execute() (*Network, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createNetworkPayload + localVarPostBody = r.createImagePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -4995,7 +5624,7 @@ func (r CreateNetworkRequest) Execute() (*Network, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 409 { + if localVarHTTPResponse.StatusCode == 429 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -5033,76 +5662,71 @@ func (r CreateNetworkRequest) Execute() (*Network, error) { } /* -CreateNetwork: Create new network. +CreateImage: Create new Image. -Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. +Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateNetworkRequest + @param region The STACKIT Region of the resources. + @return ApiCreateImageRequest */ -func (a *APIClient) CreateNetwork(ctx context.Context, projectId string) ApiCreateNetworkRequest { - return CreateNetworkRequest{ +func (a *APIClient) CreateImage(ctx context.Context, projectId string, region string) ApiCreateImageRequest { + return CreateImageRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) CreateNetworkExecute(ctx context.Context, projectId string) (*Network, error) { - r := CreateNetworkRequest{ +func (a *APIClient) CreateImageExecute(ctx context.Context, projectId string, region string) (*ImageCreateResponse, error) { + r := CreateImageRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } -type CreateNetworkAreaRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - createNetworkAreaPayload *CreateNetworkAreaPayload +type CreateKeyPairRequest struct { + ctx context.Context + apiService *DefaultApiService + createKeyPairPayload *CreateKeyPairPayload } -// Request an area creation. +// Request a public key import. -func (r CreateNetworkAreaRequest) CreateNetworkAreaPayload(createNetworkAreaPayload CreateNetworkAreaPayload) ApiCreateNetworkAreaRequest { - r.createNetworkAreaPayload = &createNetworkAreaPayload +func (r CreateKeyPairRequest) CreateKeyPairPayload(createKeyPairPayload CreateKeyPairPayload) ApiCreateKeyPairRequest { + r.createKeyPairPayload = &createKeyPairPayload return r } -func (r CreateNetworkAreaRequest) Execute() (*NetworkArea, error) { +func (r CreateKeyPairRequest) Execute() (*Keypair, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NetworkArea + localVarReturnValue *Keypair ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetworkArea") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateKeyPair") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath := localBasePath + "/v2/keypairs" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") - } - if r.createNetworkAreaPayload == nil { - return localVarReturnValue, fmt.Errorf("createNetworkAreaPayload is required and must be specified") + if r.createKeyPairPayload == nil { + return localVarReturnValue, fmt.Errorf("createKeyPairPayload is required and must be specified") } // to determine the Content-Type header @@ -5123,7 +5747,7 @@ func (r CreateNetworkAreaRequest) Execute() (*NetworkArea, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createNetworkAreaPayload + localVarPostBody = r.createKeyPairPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -5200,6 +5824,17 @@ func (r CreateNetworkAreaRequest) Execute() (*NetworkArea, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -5227,84 +5862,75 @@ func (r CreateNetworkAreaRequest) Execute() (*NetworkArea, error) { } /* -CreateNetworkArea: Create new network area in an organization. +CreateKeyPair: Import a public key. -Create a new network area in an organization. +Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @return ApiCreateNetworkAreaRequest + @return ApiCreateKeyPairRequest */ -func (a *APIClient) CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest { - return CreateNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, +func (a *APIClient) CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest { + return CreateKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, } } -func (a *APIClient) CreateNetworkAreaExecute(ctx context.Context, organizationId string) (*NetworkArea, error) { - r := CreateNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, +func (a *APIClient) CreateKeyPairExecute(ctx context.Context) (*Keypair, error) { + r := CreateKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, } return r.Execute() } -type CreateNetworkAreaRangeRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - createNetworkAreaRangePayload *CreateNetworkAreaRangePayload +type CreateNetworkRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + createNetworkPayload *CreateNetworkPayload } -// Request an addition of network ranges to an area. +// Request a network creation. -func (r CreateNetworkAreaRangeRequest) CreateNetworkAreaRangePayload(createNetworkAreaRangePayload CreateNetworkAreaRangePayload) ApiCreateNetworkAreaRangeRequest { - r.createNetworkAreaRangePayload = &createNetworkAreaRangePayload +func (r CreateNetworkRequest) CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest { + r.createNetworkPayload = &createNetworkPayload return r } -func (r CreateNetworkAreaRangeRequest) Execute() (*NetworkRangeListResponse, error) { +func (r CreateNetworkRequest) Execute() (*Network, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NetworkRangeListResponse + localVarReturnValue *Network ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetworkAreaRange") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetwork") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.createNetworkAreaRangePayload == nil { - return localVarReturnValue, fmt.Errorf("createNetworkAreaRangePayload is required and must be specified") + if r.createNetworkPayload == nil { + return localVarReturnValue, fmt.Errorf("createNetworkPayload is required and must be specified") } // to determine the Content-Type header @@ -5325,7 +5951,7 @@ func (r CreateNetworkAreaRangeRequest) Execute() (*NetworkRangeListResponse, err localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createNetworkAreaRangePayload + localVarPostBody = r.createNetworkPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -5440,69 +6066,67 @@ func (r CreateNetworkAreaRangeRequest) Execute() (*NetworkRangeListResponse, err } /* -CreateNetworkAreaRange: Create new network range in a network area. +CreateNetwork: Create new network. -Create a new network range in an existing network area. +Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiCreateNetworkAreaRangeRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkRequest */ -func (a *APIClient) CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRangeRequest { - return CreateNetworkAreaRangeRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest { + return CreateNetworkRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, } } -func (a *APIClient) CreateNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string) (*NetworkRangeListResponse, error) { - r := CreateNetworkAreaRangeRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) CreateNetworkExecute(ctx context.Context, projectId string, region string) (*Network, error) { + r := CreateNetworkRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, } return r.Execute() } -type CreateNetworkAreaRouteRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - createNetworkAreaRoutePayload *CreateNetworkAreaRoutePayload +type CreateNetworkAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + createNetworkAreaPayload *CreateNetworkAreaPayload } -// Request an addition of routes to an area. +// Request an Area creation. -func (r CreateNetworkAreaRouteRequest) CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload CreateNetworkAreaRoutePayload) ApiCreateNetworkAreaRouteRequest { - r.createNetworkAreaRoutePayload = &createNetworkAreaRoutePayload +func (r CreateNetworkAreaRequest) CreateNetworkAreaPayload(createNetworkAreaPayload CreateNetworkAreaPayload) ApiCreateNetworkAreaRequest { + r.createNetworkAreaPayload = &createNetworkAreaPayload return r } -func (r CreateNetworkAreaRouteRequest) Execute() (*RouteListResponse, error) { +func (r CreateNetworkAreaRequest) Execute() (*NetworkArea, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *RouteListResponse + localVarReturnValue *NetworkArea ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetworkAreaRoute") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetworkArea") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes" + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas" localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5513,14 +6137,8 @@ func (r CreateNetworkAreaRouteRequest) Execute() (*RouteListResponse, error) { if strlen(r.organizationId) > 36 { return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.areaId) < 36 { - return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") - } - if r.createNetworkAreaRoutePayload == nil { - return localVarReturnValue, fmt.Errorf("createNetworkAreaRoutePayload is required and must be specified") + if r.createNetworkAreaPayload == nil { + return localVarReturnValue, fmt.Errorf("createNetworkAreaPayload is required and must be specified") } // to determine the Content-Type header @@ -5541,7 +6159,7 @@ func (r CreateNetworkAreaRouteRequest) Execute() (*RouteListResponse, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createNetworkAreaRoutePayload + localVarPostBody = r.createNetworkAreaPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -5618,17 +6236,6 @@ func (r CreateNetworkAreaRouteRequest) Execute() (*RouteListResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -5656,87 +6263,86 @@ func (r CreateNetworkAreaRouteRequest) Execute() (*RouteListResponse, error) { } /* -CreateNetworkAreaRoute: Create new network routes. +CreateNetworkArea: Create new network area in an organization. -Create one or several new network routes in a network area. +Create a new network area in an organization. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiCreateNetworkAreaRouteRequest + @return ApiCreateNetworkAreaRequest */ -func (a *APIClient) CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRouteRequest { - return CreateNetworkAreaRouteRequest{ +func (a *APIClient) CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest { + return CreateNetworkAreaRequest{ apiService: a.defaultApi, ctx: ctx, organizationId: organizationId, - areaId: areaId, } } -func (a *APIClient) CreateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string) (*RouteListResponse, error) { - r := CreateNetworkAreaRouteRequest{ +func (a *APIClient) CreateNetworkAreaExecute(ctx context.Context, organizationId string) (*NetworkArea, error) { + r := CreateNetworkAreaRequest{ apiService: a.defaultApi, ctx: ctx, organizationId: organizationId, - areaId: areaId, } return r.Execute() } -type CreateNicRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - createNicPayload *CreateNicPayload +type CreateNetworkAreaRangeRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + createNetworkAreaRangePayload *CreateNetworkAreaRangePayload } -// Request a network interface creation. +// Request an addition of network ranges to an area. -func (r CreateNicRequest) CreateNicPayload(createNicPayload CreateNicPayload) ApiCreateNicRequest { - r.createNicPayload = &createNicPayload +func (r CreateNetworkAreaRangeRequest) CreateNetworkAreaRangePayload(createNetworkAreaRangePayload CreateNetworkAreaRangePayload) ApiCreateNetworkAreaRangeRequest { + r.createNetworkAreaRangePayload = &createNetworkAreaRangePayload return r } -func (r CreateNicRequest) Execute() (*NIC, error) { +func (r CreateNetworkAreaRangeRequest) Execute() (*NetworkRangeListResponse, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NIC + localVarReturnValue *NetworkRangeListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNic") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetworkAreaRange") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}/nics" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } - if r.createNicPayload == nil { - return localVarReturnValue, fmt.Errorf("createNicPayload is required and must be specified") + if r.createNetworkAreaRangePayload == nil { + return localVarReturnValue, fmt.Errorf("createNetworkAreaRangePayload is required and must be specified") } // to determine the Content-Type header @@ -5757,7 +6363,7 @@ func (r CreateNicRequest) Execute() (*NIC, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createNicPayload + localVarPostBody = r.createNetworkAreaRangePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -5845,17 +6451,6 @@ func (r CreateNicRequest) Execute() (*NIC, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 429 { - var v Error - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -5883,79 +6478,92 @@ func (r CreateNicRequest) Execute() (*NIC, error) { } /* -CreateNic: Create new network interface. +CreateNetworkAreaRange: Create new network range in a network area. -Create a new network interface in a project. +Create a new network range in an existing network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiCreateNicRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRangeRequest */ -func (a *APIClient) CreateNic(ctx context.Context, projectId string, networkId string) ApiCreateNicRequest { - return CreateNicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, +func (a *APIClient) CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRangeRequest { + return CreateNetworkAreaRangeRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } } -func (a *APIClient) CreateNicExecute(ctx context.Context, projectId string, networkId string) (*NIC, error) { - r := CreateNicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, +func (a *APIClient) CreateNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, region string) (*NetworkRangeListResponse, error) { + r := CreateNetworkAreaRangeRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } return r.Execute() } -type CreatePublicIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createPublicIPPayload *CreatePublicIPPayload +type CreateNetworkAreaRegionRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + createNetworkAreaRegionPayload *CreateNetworkAreaRegionPayload } -// Request a public IP creation. +// Request to add a new regional network area configuration. -func (r CreatePublicIPRequest) CreatePublicIPPayload(createPublicIPPayload CreatePublicIPPayload) ApiCreatePublicIPRequest { - r.createPublicIPPayload = &createPublicIPPayload +func (r CreateNetworkAreaRegionRequest) CreateNetworkAreaRegionPayload(createNetworkAreaRegionPayload CreateNetworkAreaRegionPayload) ApiCreateNetworkAreaRegionRequest { + r.createNetworkAreaRegionPayload = &createNetworkAreaRegionPayload return r } -func (r CreatePublicIPRequest) Execute() (*PublicIp, error) { +func (r CreateNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PublicIp + localVarReturnValue *RegionalArea ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreatePublicIP") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetworkAreaRegion") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/public-ips" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if r.createPublicIPPayload == nil { - return localVarReturnValue, fmt.Errorf("createPublicIPPayload is required and must be specified") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + } + if r.createNetworkAreaRegionPayload == nil { + return localVarReturnValue, fmt.Errorf("createNetworkAreaRegionPayload is required and must be specified") } // to determine the Content-Type header @@ -5976,7 +6584,7 @@ func (r CreatePublicIPRequest) Execute() (*PublicIp, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createPublicIPPayload + localVarPostBody = r.createNetworkAreaRegionPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -6053,7 +6661,7 @@ func (r CreatePublicIPRequest) Execute() (*PublicIp, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 409 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -6091,79 +6699,95 @@ func (r CreatePublicIPRequest) Execute() (*PublicIp, error) { } /* -CreatePublicIP: Create new public IP. +CreateNetworkAreaRegion: Configure a region for a network area. -Create a new public IP in a project. +Configure a new region for a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreatePublicIPRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRegionRequest */ -func (a *APIClient) CreatePublicIP(ctx context.Context, projectId string) ApiCreatePublicIPRequest { - return CreatePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) CreateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRegionRequest { + return CreateNetworkAreaRegionRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } } -func (a *APIClient) CreatePublicIPExecute(ctx context.Context, projectId string) (*PublicIp, error) { - r := CreatePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) CreateNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) (*RegionalArea, error) { + r := CreateNetworkAreaRegionRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } return r.Execute() } -type CreateSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createSecurityGroupPayload *CreateSecurityGroupPayload +type CreateNetworkAreaRouteRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + createNetworkAreaRoutePayload *CreateNetworkAreaRoutePayload } -// Request a security group creation. +// Request an addition of routes to an area. -func (r CreateSecurityGroupRequest) CreateSecurityGroupPayload(createSecurityGroupPayload CreateSecurityGroupPayload) ApiCreateSecurityGroupRequest { - r.createSecurityGroupPayload = &createSecurityGroupPayload +func (r CreateNetworkAreaRouteRequest) CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload CreateNetworkAreaRoutePayload) ApiCreateNetworkAreaRouteRequest { + r.createNetworkAreaRoutePayload = &createNetworkAreaRoutePayload return r } -func (r CreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { +func (r CreateNetworkAreaRouteRequest) Execute() (*RouteListResponse, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroup + localVarReturnValue *RouteListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateSecurityGroup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetworkAreaRoute") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if r.createSecurityGroupPayload == nil { - return localVarReturnValue, fmt.Errorf("createSecurityGroupPayload is required and must be specified") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - - // to determine the Content-Type header + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + } + if r.createNetworkAreaRoutePayload == nil { + return localVarReturnValue, fmt.Errorf("createNetworkAreaRoutePayload is required and must be specified") + } + + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header @@ -6181,7 +6805,7 @@ func (r CreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createSecurityGroupPayload + localVarPostBody = r.createNetworkAreaRoutePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -6258,6 +6882,17 @@ func (r CreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -6285,66 +6920,74 @@ func (r CreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { } /* -CreateSecurityGroup: Create new security group. +CreateNetworkAreaRoute: Create new network routes. -Create a new security group in a project. +Create one or several new network routes in a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateSecurityGroupRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRouteRequest */ -func (a *APIClient) CreateSecurityGroup(ctx context.Context, projectId string) ApiCreateSecurityGroupRequest { - return CreateSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRouteRequest { + return CreateNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } } -func (a *APIClient) CreateSecurityGroupExecute(ctx context.Context, projectId string) (*SecurityGroup, error) { - r := CreateSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) CreateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string) (*RouteListResponse, error) { + r := CreateNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } return r.Execute() } -type CreateSecurityGroupRuleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string - createSecurityGroupRulePayload *CreateSecurityGroupRulePayload +type CreateNicRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + networkId string + createNicPayload *CreateNicPayload } -// Request for a security group rule creation. +// Request a network interface creation. -func (r CreateSecurityGroupRuleRequest) CreateSecurityGroupRulePayload(createSecurityGroupRulePayload CreateSecurityGroupRulePayload) ApiCreateSecurityGroupRuleRequest { - r.createSecurityGroupRulePayload = &createSecurityGroupRulePayload +func (r CreateNicRequest) CreateNicPayload(createNicPayload CreateNicPayload) ApiCreateNicRequest { + r.createNicPayload = &createNicPayload return r } -func (r CreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { +func (r CreateNicRequest) Execute() (*NIC, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroupRule + localVarReturnValue *NIC ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateSecurityGroupRule") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNic") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6355,14 +6998,14 @@ func (r CreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") + if strlen(r.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") } - if strlen(r.securityGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") } - if r.createSecurityGroupRulePayload == nil { - return localVarReturnValue, fmt.Errorf("createSecurityGroupRulePayload is required and must be specified") + if r.createNicPayload == nil { + return localVarReturnValue, fmt.Errorf("createNicPayload is required and must be specified") } // to determine the Content-Type header @@ -6383,7 +7026,7 @@ func (r CreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createSecurityGroupRulePayload + localVarPostBody = r.createNicPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -6460,6 +7103,28 @@ func (r CreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -6487,67 +7152,72 @@ func (r CreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { } /* -CreateSecurityGroupRule: Create new security group rule. +CreateNic: Create new network interface. -Create a new security group rule in a project. +Create a new network interface in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiCreateSecurityGroupRuleRequest + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiCreateNicRequest */ -func (a *APIClient) CreateSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string) ApiCreateSecurityGroupRuleRequest { - return CreateSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) CreateNic(ctx context.Context, projectId string, region string, networkId string) ApiCreateNicRequest { + return CreateNicRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, } } -func (a *APIClient) CreateSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroupRule, error) { - r := CreateSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) CreateNicExecute(ctx context.Context, projectId string, region string, networkId string) (*NIC, error) { + r := CreateNicRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, } return r.Execute() } -type CreateServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createServerPayload *CreateServerPayload +type CreatePublicIPRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + createPublicIPPayload *CreatePublicIPPayload } -// Request a server creation. +// Request a public IP creation. -func (r CreateServerRequest) CreateServerPayload(createServerPayload CreateServerPayload) ApiCreateServerRequest { - r.createServerPayload = &createServerPayload +func (r CreatePublicIPRequest) CreatePublicIPPayload(createPublicIPPayload CreatePublicIPPayload) ApiCreatePublicIPRequest { + r.createPublicIPPayload = &createPublicIPPayload return r } -func (r CreateServerRequest) Execute() (*Server, error) { +func (r CreatePublicIPRequest) Execute() (*PublicIp, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Server + localVarReturnValue *PublicIp ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateServer") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreatePublicIP") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/public-ips" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6558,8 +7228,8 @@ func (r CreateServerRequest) Execute() (*Server, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.createServerPayload == nil { - return localVarReturnValue, fmt.Errorf("createServerPayload is required and must be specified") + if r.createPublicIPPayload == nil { + return localVarReturnValue, fmt.Errorf("createPublicIPPayload is required and must be specified") } // to determine the Content-Type header @@ -6580,7 +7250,7 @@ func (r CreateServerRequest) Execute() (*Server, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createServerPayload + localVarPostBody = r.createPublicIPPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -6657,6 +7327,17 @@ func (r CreateServerRequest) Execute() (*Server, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 429 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -6684,64 +7365,69 @@ func (r CreateServerRequest) Execute() (*Server, error) { } /* -CreateServer: Create new server. +CreatePublicIP: Create new public IP. -Create a new server in a project. +Create a new public IP in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateServerRequest + @param region The STACKIT Region of the resources. + @return ApiCreatePublicIPRequest */ -func (a *APIClient) CreateServer(ctx context.Context, projectId string) ApiCreateServerRequest { - return CreateServerRequest{ +func (a *APIClient) CreatePublicIP(ctx context.Context, projectId string, region string) ApiCreatePublicIPRequest { + return CreatePublicIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) CreateServerExecute(ctx context.Context, projectId string) (*Server, error) { - r := CreateServerRequest{ +func (a *APIClient) CreatePublicIPExecute(ctx context.Context, projectId string, region string) (*PublicIp, error) { + r := CreatePublicIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } -type CreateSnapshotRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createSnapshotPayload *CreateSnapshotPayload +type CreateSecurityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + createSecurityGroupPayload *CreateSecurityGroupPayload } -// Request a snapshot creation. +// Request a security group creation. -func (r CreateSnapshotRequest) CreateSnapshotPayload(createSnapshotPayload CreateSnapshotPayload) ApiCreateSnapshotRequest { - r.createSnapshotPayload = &createSnapshotPayload +func (r CreateSecurityGroupRequest) CreateSecurityGroupPayload(createSecurityGroupPayload CreateSecurityGroupPayload) ApiCreateSecurityGroupRequest { + r.createSecurityGroupPayload = &createSecurityGroupPayload return r } -func (r CreateSnapshotRequest) Execute() (*Snapshot, error) { +func (r CreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Snapshot + localVarReturnValue *SecurityGroup ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateSnapshot") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateSecurityGroup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/snapshots" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6752,8 +7438,8 @@ func (r CreateSnapshotRequest) Execute() (*Snapshot, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.createSnapshotPayload == nil { - return localVarReturnValue, fmt.Errorf("createSnapshotPayload is required and must be specified") + if r.createSecurityGroupPayload == nil { + return localVarReturnValue, fmt.Errorf("createSecurityGroupPayload is required and must be specified") } // to determine the Content-Type header @@ -6774,7 +7460,7 @@ func (r CreateSnapshotRequest) Execute() (*Snapshot, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createSnapshotPayload + localVarPostBody = r.createSecurityGroupPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -6878,64 +7564,71 @@ func (r CreateSnapshotRequest) Execute() (*Snapshot, error) { } /* -CreateSnapshot: Create new Snapshot. +CreateSecurityGroup: Create new security group. -Create a new Snapshot from a Volume in a project. +Create a new security group in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateSnapshotRequest + @param region The STACKIT Region of the resources. + @return ApiCreateSecurityGroupRequest */ -func (a *APIClient) CreateSnapshot(ctx context.Context, projectId string) ApiCreateSnapshotRequest { - return CreateSnapshotRequest{ +func (a *APIClient) CreateSecurityGroup(ctx context.Context, projectId string, region string) ApiCreateSecurityGroupRequest { + return CreateSecurityGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) CreateSnapshotExecute(ctx context.Context, projectId string) (*Snapshot, error) { - r := CreateSnapshotRequest{ +func (a *APIClient) CreateSecurityGroupExecute(ctx context.Context, projectId string, region string) (*SecurityGroup, error) { + r := CreateSecurityGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } -type CreateVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createVolumePayload *CreateVolumePayload +type CreateSecurityGroupRuleRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + securityGroupId string + createSecurityGroupRulePayload *CreateSecurityGroupRulePayload } -// Request a volume creation. +// Request for a security group rule creation. -func (r CreateVolumeRequest) CreateVolumePayload(createVolumePayload CreateVolumePayload) ApiCreateVolumeRequest { - r.createVolumePayload = &createVolumePayload +func (r CreateSecurityGroupRuleRequest) CreateSecurityGroupRulePayload(createSecurityGroupRulePayload CreateSecurityGroupRulePayload) ApiCreateSecurityGroupRuleRequest { + r.createSecurityGroupRulePayload = &createSecurityGroupRulePayload return r } -func (r CreateVolumeRequest) Execute() (*Volume, error) { +func (r CreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Volume + localVarReturnValue *SecurityGroupRule ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateVolume") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateSecurityGroupRule") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/volumes" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6946,12 +7639,18 @@ func (r CreateVolumeRequest) Execute() (*Volume, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.createVolumePayload == nil { - return localVarReturnValue, fmt.Errorf("createVolumePayload is required and must be specified") + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") + } + if r.createSecurityGroupRulePayload == nil { + return localVarReturnValue, fmt.Errorf("createSecurityGroupRulePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -6968,7 +7667,7 @@ func (r CreateVolumeRequest) Execute() (*Volume, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createVolumePayload + localVarPostBody = r.createSecurityGroupRulePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -7072,76 +7771,88 @@ func (r CreateVolumeRequest) Execute() (*Volume, error) { } /* -CreateVolume: Create new volume. +CreateSecurityGroupRule: Create new security group rule. -Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. +Create a new security group rule in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateVolumeRequest + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiCreateSecurityGroupRuleRequest */ -func (a *APIClient) CreateVolume(ctx context.Context, projectId string) ApiCreateVolumeRequest { - return CreateVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) CreateSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string) ApiCreateSecurityGroupRuleRequest { + return CreateSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, } } -func (a *APIClient) CreateVolumeExecute(ctx context.Context, projectId string) (*Volume, error) { - r := CreateVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) CreateSecurityGroupRuleExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroupRule, error) { + r := CreateSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, } return r.Execute() } -type DeallocateServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type CreateServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + createServerPayload *CreateServerPayload } -func (r DeallocateServerRequest) Execute() error { +// Request a server creation. + +func (r CreateServerRequest) CreateServerPayload(createServerPayload CreateServerPayload) ApiCreateServerRequest { + r.createServerPayload = &createServerPayload + return r +} + +func (r CreateServerRequest) Execute() (*Server, error) { var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Server ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { - return fmt.Errorf("could not parse client to type APIClient") + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeallocateServer") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateServer") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/deallocate" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.serverId) < 36 { - return fmt.Errorf("serverId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") + if r.createServerPayload == nil { + return localVarReturnValue, fmt.Errorf("createServerPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -7157,9 +7868,11 @@ func (r DeallocateServerRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createServerPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return err + return localVarReturnValue, err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -7173,14 +7886,14 @@ func (r DeallocateServerRequest) Execute() error { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return err + return localVarReturnValue, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return err + return localVarReturnValue, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -7194,146 +7907,151 @@ func (r DeallocateServerRequest) Execute() error { err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return newErr + return localVarReturnValue, newErr } - return nil + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil } /* -DeallocateServer: Deallocate an existing server. +CreateServer: Create new server. -Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. +Create a new server in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiDeallocateServerRequest + @param region The STACKIT Region of the resources. + @return ApiCreateServerRequest */ -func (a *APIClient) DeallocateServer(ctx context.Context, projectId string, serverId string) ApiDeallocateServerRequest { - return DeallocateServerRequest{ +func (a *APIClient) CreateServer(ctx context.Context, projectId string, region string) ApiCreateServerRequest { + return CreateServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + region: region, } } -func (a *APIClient) DeallocateServerExecute(ctx context.Context, projectId string, serverId string) error { - r := DeallocateServerRequest{ +func (a *APIClient) CreateServerExecute(ctx context.Context, projectId string, region string) (*Server, error) { + r := CreateServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + region: region, } return r.Execute() } -type DeleteAffinityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - affinityGroupId string +type CreateSnapshotRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + createSnapshotPayload *CreateSnapshotPayload } -func (r DeleteAffinityGroupRequest) Execute() error { +// Request a snapshot creation. + +func (r CreateSnapshotRequest) CreateSnapshotPayload(createSnapshotPayload CreateSnapshotPayload) ApiCreateSnapshotRequest { + r.createSnapshotPayload = &createSnapshotPayload + return r +} + +func (r CreateSnapshotRequest) Execute() (*Snapshot, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Snapshot ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { - return fmt.Errorf("could not parse client to type APIClient") + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAffinityGroup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateSnapshot") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/affinity-groups/{affinityGroupId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/snapshots" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(r.affinityGroupId, "affinityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.affinityGroupId) < 36 { - return fmt.Errorf("affinityGroupId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.affinityGroupId) > 36 { - return fmt.Errorf("affinityGroupId must have less than 36 elements") + if r.createSnapshotPayload == nil { + return localVarReturnValue, fmt.Errorf("createSnapshotPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -7349,9 +8067,11 @@ func (r DeleteAffinityGroupRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createSnapshotPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return err + return localVarReturnValue, err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -7365,14 +8085,14 @@ func (r DeleteAffinityGroupRequest) Execute() error { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return err + return localVarReturnValue, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return err + return localVarReturnValue, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -7386,146 +8106,151 @@ func (r DeleteAffinityGroupRequest) Execute() error { err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return newErr + return localVarReturnValue, newErr } - return nil + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil } /* -DeleteAffinityGroup: Delete a affinity group in a project. +CreateSnapshot: Create new Snapshot. -Delete a affinity group in the given project. +Create a new Snapshot from a Volume in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. - @return ApiDeleteAffinityGroupRequest + @param region The STACKIT Region of the resources. + @return ApiCreateSnapshotRequest */ -func (a *APIClient) DeleteAffinityGroup(ctx context.Context, projectId string, affinityGroupId string) ApiDeleteAffinityGroupRequest { - return DeleteAffinityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - affinityGroupId: affinityGroupId, +func (a *APIClient) CreateSnapshot(ctx context.Context, projectId string, region string) ApiCreateSnapshotRequest { + return CreateSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, } } -func (a *APIClient) DeleteAffinityGroupExecute(ctx context.Context, projectId string, affinityGroupId string) error { - r := DeleteAffinityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - affinityGroupId: affinityGroupId, - } - return r.Execute() -} +func (a *APIClient) CreateSnapshotExecute(ctx context.Context, projectId string, region string) (*Snapshot, error) { + r := CreateSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + } + return r.Execute() +} -type DeleteBackupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - backupId string - force *bool +type CreateVolumeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + createVolumePayload *CreateVolumePayload } -// Force action. +// Request a volume creation. -func (r DeleteBackupRequest) Force(force bool) ApiDeleteBackupRequest { - r.force = &force +func (r CreateVolumeRequest) CreateVolumePayload(createVolumePayload CreateVolumePayload) ApiCreateVolumeRequest { + r.createVolumePayload = &createVolumePayload return r } -func (r DeleteBackupRequest) Execute() error { +func (r CreateVolumeRequest) Execute() (*Volume, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Volume ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { - return fmt.Errorf("could not parse client to type APIClient") + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteBackup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateVolume") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/backups/{backupId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volumes" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.backupId) < 36 { - return fmt.Errorf("backupId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.backupId) > 36 { - return fmt.Errorf("backupId must have less than 36 elements") + if r.createVolumePayload == nil { + return localVarReturnValue, fmt.Errorf("createVolumePayload is required and must be specified") } - if r.force != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "force", r.force, "") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -7541,9 +8266,11 @@ func (r DeleteBackupRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createVolumePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return err + return localVarReturnValue, err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -7557,14 +8284,14 @@ func (r DeleteBackupRequest) Execute() error { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return err + return localVarReturnValue, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return err + return localVarReturnValue, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -7578,100 +8305,111 @@ func (r DeleteBackupRequest) Execute() error { err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return newErr + return localVarReturnValue, newErr } - return nil + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil } /* -DeleteBackup: Delete a backup. +CreateVolume: Create new volume. -Delete a backup that is part of the project. +Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param backupId The identifier (ID) of a STACKIT Backup. - @return ApiDeleteBackupRequest + @param region The STACKIT Region of the resources. + @return ApiCreateVolumeRequest */ -func (a *APIClient) DeleteBackup(ctx context.Context, projectId string, backupId string) ApiDeleteBackupRequest { - return DeleteBackupRequest{ +func (a *APIClient) CreateVolume(ctx context.Context, projectId string, region string) ApiCreateVolumeRequest { + return CreateVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - backupId: backupId, + region: region, } } -func (a *APIClient) DeleteBackupExecute(ctx context.Context, projectId string, backupId string) error { - r := DeleteBackupRequest{ +func (a *APIClient) CreateVolumeExecute(ctx context.Context, projectId string, region string) (*Volume, error) { + r := CreateVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - backupId: backupId, + region: region, } return r.Execute() } -type DeleteImageRequest struct { +type DeallocateServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string - imageId string + region string + serverId string } -func (r DeleteImageRequest) Execute() error { +func (r DeallocateServerRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) @@ -7680,14 +8418,15 @@ func (r DeleteImageRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteImage") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeallocateServer") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/deallocate" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -7698,11 +8437,11 @@ func (r DeleteImageRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.imageId) < 36 { - return fmt.Errorf("imageId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.imageId) > 36 { - return fmt.Errorf("imageId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return fmt.Errorf("serverId must have less than 36 elements") } // to determine the Content-Type header @@ -7798,6 +8537,17 @@ func (r DeleteImageRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -7815,42 +8565,46 @@ func (r DeleteImageRequest) Execute() error { } /* -DeleteImage: Delete an Image. +DeallocateServer: Deallocate an existing server. -Delete an image that is part of the project. +Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiDeleteImageRequest + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeallocateServerRequest */ -func (a *APIClient) DeleteImage(ctx context.Context, projectId string, imageId string) ApiDeleteImageRequest { - return DeleteImageRequest{ +func (a *APIClient) DeallocateServer(ctx context.Context, projectId string, region string, serverId string) ApiDeallocateServerRequest { + return DeallocateServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, + region: region, + serverId: serverId, } } -func (a *APIClient) DeleteImageExecute(ctx context.Context, projectId string, imageId string) error { - r := DeleteImageRequest{ +func (a *APIClient) DeallocateServerExecute(ctx context.Context, projectId string, region string, serverId string) error { + r := DeallocateServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, + region: region, + serverId: serverId, } return r.Execute() } -type DeleteImageShareRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string +type DeleteAffinityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + affinityGroupId string } -func (r DeleteImageShareRequest) Execute() error { +func (r DeleteAffinityGroupRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -7861,14 +8615,15 @@ func (r DeleteImageShareRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteImageShare") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAffinityGroup") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/share" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/affinity-groups/{affinityGroupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(r.affinityGroupId, "affinityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -7879,11 +8634,11 @@ func (r DeleteImageShareRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.imageId) < 36 { - return fmt.Errorf("imageId must have at least 36 elements") + if strlen(r.affinityGroupId) < 36 { + return fmt.Errorf("affinityGroupId must have at least 36 elements") } - if strlen(r.imageId) > 36 { - return fmt.Errorf("imageId must have less than 36 elements") + if strlen(r.affinityGroupId) > 36 { + return fmt.Errorf("affinityGroupId must have less than 36 elements") } // to determine the Content-Type header @@ -7996,43 +8751,54 @@ func (r DeleteImageShareRequest) Execute() error { } /* -DeleteImageShare: Remove image share. +DeleteAffinityGroup: Delete a affinity group in a project. -Remove the image share. New scope will be local. +Delete a affinity group in the given project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiDeleteImageShareRequest + @param region The STACKIT Region of the resources. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiDeleteAffinityGroupRequest */ -func (a *APIClient) DeleteImageShare(ctx context.Context, projectId string, imageId string) ApiDeleteImageShareRequest { - return DeleteImageShareRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +func (a *APIClient) DeleteAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiDeleteAffinityGroupRequest { + return DeleteAffinityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + affinityGroupId: affinityGroupId, } } -func (a *APIClient) DeleteImageShareExecute(ctx context.Context, projectId string, imageId string) error { - r := DeleteImageShareRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +func (a *APIClient) DeleteAffinityGroupExecute(ctx context.Context, projectId string, region string, affinityGroupId string) error { + r := DeleteAffinityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + affinityGroupId: affinityGroupId, } return r.Execute() } -type DeleteImageShareConsumerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string - consumerProjectId string +type DeleteBackupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + backupId string + force *bool } -func (r DeleteImageShareConsumerRequest) Execute() error { +// Force action. + +func (r DeleteBackupRequest) Force(force bool) ApiDeleteBackupRequest { + r.force = &force + return r +} + +func (r DeleteBackupRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -8043,15 +8809,15 @@ func (r DeleteImageShareConsumerRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteImageShareConsumer") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteBackup") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/backups/{backupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(r.consumerProjectId, "consumerProjectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -8062,19 +8828,16 @@ func (r DeleteImageShareConsumerRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.imageId) < 36 { - return fmt.Errorf("imageId must have at least 36 elements") - } - if strlen(r.imageId) > 36 { - return fmt.Errorf("imageId must have less than 36 elements") - } - if strlen(r.consumerProjectId) < 36 { - return fmt.Errorf("consumerProjectId must have at least 36 elements") + if strlen(r.backupId) < 36 { + return fmt.Errorf("backupId must have at least 36 elements") } - if strlen(r.consumerProjectId) > 36 { - return fmt.Errorf("consumerProjectId must have less than 36 elements") + if strlen(r.backupId) > 36 { + return fmt.Errorf("backupId must have less than 36 elements") } + if r.force != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force", r.force, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -8185,44 +8948,46 @@ func (r DeleteImageShareConsumerRequest) Execute() error { } /* -DeleteImageShareConsumer: Remove an image share consumer. +DeleteBackup: Delete a backup. -Remove consumer from a shared image. +Delete a backup that is part of the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. - @return ApiDeleteImageShareConsumerRequest + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiDeleteBackupRequest */ -func (a *APIClient) DeleteImageShareConsumer(ctx context.Context, projectId string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest { - return DeleteImageShareConsumerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - consumerProjectId: consumerProjectId, +func (a *APIClient) DeleteBackup(ctx context.Context, projectId string, region string, backupId string) ApiDeleteBackupRequest { + return DeleteBackupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, } } -func (a *APIClient) DeleteImageShareConsumerExecute(ctx context.Context, projectId string, imageId string, consumerProjectId string) error { - r := DeleteImageShareConsumerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - consumerProjectId: consumerProjectId, +func (a *APIClient) DeleteBackupExecute(ctx context.Context, projectId string, region string, backupId string) error { + r := DeleteBackupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, } return r.Execute() } -type DeleteKeyPairRequest struct { - ctx context.Context - apiService *DefaultApiService - keypairName string +type DeleteImageRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + imageId string } -func (r DeleteKeyPairRequest) Execute() error { +func (r DeleteImageRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -8233,19 +8998,30 @@ func (r DeleteKeyPairRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeyPair") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteImage") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/keypairs/{keypairName}" - localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(r.keypairName, "keypairName")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.keypairName) > 127 { - return fmt.Errorf("keypairName must have less than 127 elements") + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return fmt.Errorf("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return fmt.Errorf("imageId must have less than 36 elements") } // to determine the Content-Type header @@ -8358,39 +9134,46 @@ func (r DeleteKeyPairRequest) Execute() error { } /* -DeleteKeyPair: Delete an SSH keypair. +DeleteImage: Delete an Image. -Delete an SSH keypair from a user. +Delete an image that is part of the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param keypairName The name of an SSH keypair. - @return ApiDeleteKeyPairRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageRequest */ -func (a *APIClient) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { - return DeleteKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +func (a *APIClient) DeleteImage(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageRequest { + return DeleteImageRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, } } -func (a *APIClient) DeleteKeyPairExecute(ctx context.Context, keypairName string) error { - r := DeleteKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +func (a *APIClient) DeleteImageExecute(ctx context.Context, projectId string, region string, imageId string) error { + r := DeleteImageRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, } return r.Execute() } -type DeleteNetworkRequest struct { +type DeleteImageShareRequest struct { ctx context.Context apiService *DefaultApiService projectId string - networkId string + region string + imageId string } -func (r DeleteNetworkRequest) Execute() error { +func (r DeleteImageShareRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -8401,14 +9184,15 @@ func (r DeleteNetworkRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetwork") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteImageShare") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -8419,11 +9203,11 @@ func (r DeleteNetworkRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return fmt.Errorf("networkId must have at least 36 elements") + if strlen(r.imageId) < 36 { + return fmt.Errorf("imageId must have at least 36 elements") } - if strlen(r.networkId) > 36 { - return fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.imageId) > 36 { + return fmt.Errorf("imageId must have less than 36 elements") } // to determine the Content-Type header @@ -8519,17 +9303,6 @@ func (r DeleteNetworkRequest) Execute() error { newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -8547,42 +9320,47 @@ func (r DeleteNetworkRequest) Execute() error { } /* -DeleteNetwork: Delete network. +DeleteImageShare: Remove image share. -Delete a network. If the network is still in use, the deletion will fail. +Remove the image share. New scope will be local. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiDeleteNetworkRequest + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageShareRequest */ -func (a *APIClient) DeleteNetwork(ctx context.Context, projectId string, networkId string) ApiDeleteNetworkRequest { - return DeleteNetworkRequest{ +func (a *APIClient) DeleteImageShare(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageShareRequest { + return DeleteImageShareRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, + region: region, + imageId: imageId, } } -func (a *APIClient) DeleteNetworkExecute(ctx context.Context, projectId string, networkId string) error { - r := DeleteNetworkRequest{ +func (a *APIClient) DeleteImageShareExecute(ctx context.Context, projectId string, region string, imageId string) error { + r := DeleteImageShareRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, + region: region, + imageId: imageId, } return r.Execute() } -type DeleteNetworkAreaRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string +type DeleteImageShareConsumerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + imageId string + consumerProjectId string } -func (r DeleteNetworkAreaRequest) Execute() error { +func (r DeleteImageShareConsumerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -8593,29 +9371,37 @@ func (r DeleteNetworkAreaRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetworkArea") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteImageShareConsumer") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share/{consumerProjectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(r.consumerProjectId, "consumerProjectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return fmt.Errorf("organizationId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.organizationId) > 36 { - return fmt.Errorf("organizationId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.areaId) < 36 { - return fmt.Errorf("areaId must have at least 36 elements") + if strlen(r.imageId) < 36 { + return fmt.Errorf("imageId must have at least 36 elements") } - if strlen(r.areaId) > 36 { - return fmt.Errorf("areaId must have less than 36 elements") + if strlen(r.imageId) > 36 { + return fmt.Errorf("imageId must have less than 36 elements") + } + if strlen(r.consumerProjectId) < 36 { + return fmt.Errorf("consumerProjectId must have at least 36 elements") + } + if strlen(r.consumerProjectId) > 36 { + return fmt.Errorf("consumerProjectId must have less than 36 elements") } // to determine the Content-Type header @@ -8711,17 +9497,6 @@ func (r DeleteNetworkAreaRequest) Execute() error { newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -8739,43 +9514,47 @@ func (r DeleteNetworkAreaRequest) Execute() error { } /* -DeleteNetworkArea: Delete a network area. +DeleteImageShareConsumer: Remove an image share consumer. -Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. +Remove consumer from a shared image. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiDeleteNetworkAreaRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiDeleteImageShareConsumerRequest */ -func (a *APIClient) DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest { - return DeleteNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) DeleteImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest { + return DeleteImageShareConsumerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + consumerProjectId: consumerProjectId, } } -func (a *APIClient) DeleteNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) error { - r := DeleteNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) DeleteImageShareConsumerExecute(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) error { + r := DeleteImageShareConsumerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + consumerProjectId: consumerProjectId, } return r.Execute() } -type DeleteNetworkAreaRangeRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - networkRangeId string +type DeleteKeyPairRequest struct { + ctx context.Context + apiService *DefaultApiService + keypairName string } -func (r DeleteNetworkAreaRangeRequest) Execute() error { +func (r DeleteKeyPairRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -8786,36 +9565,19 @@ func (r DeleteNetworkAreaRangeRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetworkAreaRange") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeyPair") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(r.networkRangeId, "networkRangeId")), -1) + localVarPath := localBasePath + "/v2/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(r.keypairName, "keypairName")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return fmt.Errorf("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return fmt.Errorf("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return fmt.Errorf("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return fmt.Errorf("areaId must have less than 36 elements") - } - if strlen(r.networkRangeId) < 36 { - return fmt.Errorf("networkRangeId must have at least 36 elements") - } - if strlen(r.networkRangeId) > 36 { - return fmt.Errorf("networkRangeId must have less than 36 elements") + if strlen(r.keypairName) > 127 { + return fmt.Errorf("keypairName must have less than 127 elements") } // to determine the Content-Type header @@ -8911,18 +9673,7 @@ func (r DeleteNetworkAreaRangeRequest) Execute() error { newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 500 { + if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -8939,46 +9690,40 @@ func (r DeleteNetworkAreaRangeRequest) Execute() error { } /* -DeleteNetworkAreaRange: Delete a network range. +DeleteKeyPair: Delete an SSH keypair. -Delete a network range of a network area. The deletion will fail if the network range is still used. +Delete an SSH keypair from a user. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param networkRangeId The identifier (ID) of a STACKIT Network Range. - @return ApiDeleteNetworkAreaRangeRequest + @param keypairName The name of an SSH keypair. + @return ApiDeleteKeyPairRequest */ -func (a *APIClient) DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest { - return DeleteNetworkAreaRangeRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - networkRangeId: networkRangeId, +func (a *APIClient) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { + return DeleteKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, } } -func (a *APIClient) DeleteNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, networkRangeId string) error { - r := DeleteNetworkAreaRangeRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - networkRangeId: networkRangeId, +func (a *APIClient) DeleteKeyPairExecute(ctx context.Context, keypairName string) error { + r := DeleteKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, } return r.Execute() } -type DeleteNetworkAreaRouteRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - routeId string +type DeleteNetworkRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + networkId string } -func (r DeleteNetworkAreaRouteRequest) Execute() error { +func (r DeleteNetworkRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -8989,36 +9734,30 @@ func (r DeleteNetworkAreaRouteRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetworkAreaRoute") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetwork") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(r.routeId, "routeId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return fmt.Errorf("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return fmt.Errorf("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return fmt.Errorf("areaId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.areaId) > 36 { - return fmt.Errorf("areaId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.routeId) < 36 { - return fmt.Errorf("routeId must have at least 36 elements") + if strlen(r.networkId) < 36 { + return fmt.Errorf("networkId must have at least 36 elements") } - if strlen(r.routeId) > 36 { - return fmt.Errorf("routeId must have less than 36 elements") + if strlen(r.networkId) > 36 { + return fmt.Errorf("networkId must have less than 36 elements") } // to determine the Content-Type header @@ -9114,6 +9853,17 @@ func (r DeleteNetworkAreaRouteRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -9131,46 +9881,45 @@ func (r DeleteNetworkAreaRouteRequest) Execute() error { } /* -DeleteNetworkAreaRoute: Delete a network route. +DeleteNetwork: Delete network. -Delete a network route of a network area. +Delete a network. If the network is still in use, the deletion will fail. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param routeId The identifier (ID) of a STACKIT Route. - @return ApiDeleteNetworkAreaRouteRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiDeleteNetworkRequest */ -func (a *APIClient) DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiDeleteNetworkAreaRouteRequest { - return DeleteNetworkAreaRouteRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - routeId: routeId, +func (a *APIClient) DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest { + return DeleteNetworkRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, } } -func (a *APIClient) DeleteNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, routeId string) error { - r := DeleteNetworkAreaRouteRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - routeId: routeId, +func (a *APIClient) DeleteNetworkExecute(ctx context.Context, projectId string, region string, networkId string) error { + r := DeleteNetworkRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, } return r.Execute() } -type DeleteNicRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - nicId string +type DeleteNetworkAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string } -func (r DeleteNicRequest) Execute() error { +func (r DeleteNetworkAreaRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -9181,36 +9930,29 @@ func (r DeleteNicRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNic") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetworkArea") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.networkId) < 36 { - return fmt.Errorf("networkId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.networkId) > 36 { - return fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.nicId) < 36 { - return fmt.Errorf("nicId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.nicId) > 36 { - return fmt.Errorf("nicId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return fmt.Errorf("areaId must have less than 36 elements") } // to determine the Content-Type header @@ -9306,6 +10048,17 @@ func (r DeleteNicRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -9323,45 +10076,44 @@ func (r DeleteNicRequest) Execute() error { } /* -DeleteNic: Delete a network interface. +DeleteNetworkArea: Delete a network area. -Delete a network interface that is part of the project. +Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @param nicId The identifier (ID) of a network interface. - @return ApiDeleteNicRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiDeleteNetworkAreaRequest */ -func (a *APIClient) DeleteNic(ctx context.Context, projectId string, networkId string, nicId string) ApiDeleteNicRequest { - return DeleteNicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - nicId: nicId, +func (a *APIClient) DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest { + return DeleteNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } } -func (a *APIClient) DeleteNicExecute(ctx context.Context, projectId string, networkId string, nicId string) error { - r := DeleteNicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - nicId: nicId, +func (a *APIClient) DeleteNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) error { + r := DeleteNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } return r.Execute() } -type DeletePublicIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - publicIpId string +type DeleteNetworkAreaRangeRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + networkRangeId string } -func (r DeletePublicIPRequest) Execute() error { +func (r DeleteNetworkAreaRangeRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -9372,33 +10124,41 @@ func (r DeletePublicIPRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeletePublicIP") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetworkAreaRange") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/public-ips/{publicIpId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges/{networkRangeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(r.networkRangeId, "networkRangeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.publicIpId) < 36 { - return fmt.Errorf("publicIpId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.publicIpId) > 36 { - return fmt.Errorf("publicIpId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return fmt.Errorf("areaId must have less than 36 elements") } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + if strlen(r.networkRangeId) < 36 { + return fmt.Errorf("networkRangeId must have at least 36 elements") + } + if strlen(r.networkRangeId) > 36 { + return fmt.Errorf("networkRangeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -9490,6 +10250,17 @@ func (r DeletePublicIPRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -9507,42 +10278,49 @@ func (r DeletePublicIPRequest) Execute() error { } /* -DeletePublicIP: Delete a public IP. +DeleteNetworkAreaRange: Delete a network range. -Delete a public IP that is part of the project. +Delete a network range of a network area. The deletion will fail if the network range is still used. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param publicIpId The identifier (ID) of a Public IP. - @return ApiDeletePublicIPRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiDeleteNetworkAreaRangeRequest */ -func (a *APIClient) DeletePublicIP(ctx context.Context, projectId string, publicIpId string) ApiDeletePublicIPRequest { - return DeletePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - publicIpId: publicIpId, +func (a *APIClient) DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest { + return DeleteNetworkAreaRangeRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + networkRangeId: networkRangeId, } } -func (a *APIClient) DeletePublicIPExecute(ctx context.Context, projectId string, publicIpId string) error { - r := DeletePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - publicIpId: publicIpId, +func (a *APIClient) DeleteNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) error { + r := DeleteNetworkAreaRangeRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + networkRangeId: networkRangeId, } return r.Execute() } -type DeleteSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string +type DeleteNetworkAreaRegionRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string } -func (r DeleteSecurityGroupRequest) Execute() error { +func (r DeleteNetworkAreaRegionRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -9553,29 +10331,30 @@ func (r DeleteSecurityGroupRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSecurityGroup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetworkAreaRegion") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return fmt.Errorf("securityGroupId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.securityGroupId) > 36 { - return fmt.Errorf("securityGroupId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return fmt.Errorf("areaId must have less than 36 elements") } // to determine the Content-Type header @@ -9699,43 +10478,47 @@ func (r DeleteSecurityGroupRequest) Execute() error { } /* -DeleteSecurityGroup: Delete security group. +DeleteNetworkAreaRegion: Delete a configuration of region for a network area. -Delete a security group. +Delete a current configuration of region for a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiDeleteSecurityGroupRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiDeleteNetworkAreaRegionRequest */ -func (a *APIClient) DeleteSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiDeleteSecurityGroupRequest { - return DeleteSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) DeleteNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiDeleteNetworkAreaRegionRequest { + return DeleteNetworkAreaRegionRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } } -func (a *APIClient) DeleteSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) error { - r := DeleteSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) DeleteNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) error { + r := DeleteNetworkAreaRegionRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } return r.Execute() } -type DeleteSecurityGroupRuleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string - securityGroupRuleId string +type DeleteNetworkAreaRouteRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routeId string } -func (r DeleteSecurityGroupRuleRequest) Execute() error { +func (r DeleteNetworkAreaRouteRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -9746,36 +10529,37 @@ func (r DeleteSecurityGroupRuleRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSecurityGroupRule") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetworkAreaRoute") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(r.routeId, "routeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return fmt.Errorf("securityGroupId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.securityGroupId) > 36 { - return fmt.Errorf("securityGroupId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return fmt.Errorf("areaId must have less than 36 elements") } - if strlen(r.securityGroupRuleId) < 36 { - return fmt.Errorf("securityGroupRuleId must have at least 36 elements") + if strlen(r.routeId) < 36 { + return fmt.Errorf("routeId must have at least 36 elements") } - if strlen(r.securityGroupRuleId) > 36 { - return fmt.Errorf("securityGroupRuleId must have less than 36 elements") + if strlen(r.routeId) > 36 { + return fmt.Errorf("routeId must have less than 36 elements") } // to determine the Content-Type header @@ -9888,45 +10672,50 @@ func (r DeleteSecurityGroupRuleRequest) Execute() error { } /* -DeleteSecurityGroupRule: Delete security group rule. +DeleteNetworkAreaRoute: Delete a network route. -Delete a security group rule. +Delete a network route of a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. - @return ApiDeleteSecurityGroupRuleRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteNetworkAreaRouteRequest */ -func (a *APIClient) DeleteSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest { - return DeleteSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, +func (a *APIClient) DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiDeleteNetworkAreaRouteRequest { + return DeleteNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, } } -func (a *APIClient) DeleteSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) error { - r := DeleteSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, +func (a *APIClient) DeleteNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string, routeId string) error { + r := DeleteNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, } return r.Execute() } -type DeleteServerRequest struct { +type DeleteNicRequest struct { ctx context.Context apiService *DefaultApiService projectId string - serverId string + region string + networkId string + nicId string } -func (r DeleteServerRequest) Execute() error { +func (r DeleteNicRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -9937,14 +10726,16 @@ func (r DeleteServerRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServer") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNic") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -9955,11 +10746,17 @@ func (r DeleteServerRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return fmt.Errorf("serverId must have at least 36 elements") + if strlen(r.networkId) < 36 { + return fmt.Errorf("networkId must have at least 36 elements") } - if strlen(r.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.networkId) > 36 { + return fmt.Errorf("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return fmt.Errorf("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return fmt.Errorf("nicId must have less than 36 elements") } // to determine the Content-Type header @@ -10072,42 +10869,49 @@ func (r DeleteServerRequest) Execute() error { } /* -DeleteServer: Delete a server. +DeleteNic: Delete a network interface. -Delete a server. Volumes won't be deleted. +Delete a network interface that is part of the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiDeleteServerRequest + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiDeleteNicRequest */ -func (a *APIClient) DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest { - return DeleteServerRequest{ +func (a *APIClient) DeleteNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiDeleteNicRequest { + return DeleteNicRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + region: region, + networkId: networkId, + nicId: nicId, } } -func (a *APIClient) DeleteServerExecute(ctx context.Context, projectId string, serverId string) error { - r := DeleteServerRequest{ +func (a *APIClient) DeleteNicExecute(ctx context.Context, projectId string, region string, networkId string, nicId string) error { + r := DeleteNicRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + region: region, + networkId: networkId, + nicId: nicId, } return r.Execute() } -type DeleteSnapshotRequest struct { +type DeletePublicIPRequest struct { ctx context.Context apiService *DefaultApiService projectId string - snapshotId string + region string + publicIpId string } -func (r DeleteSnapshotRequest) Execute() error { +func (r DeletePublicIPRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -10118,14 +10922,15 @@ func (r DeleteSnapshotRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSnapshot") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeletePublicIP") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/snapshots/{snapshotId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(r.snapshotId, "snapshotId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -10136,11 +10941,11 @@ func (r DeleteSnapshotRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.snapshotId) < 36 { - return fmt.Errorf("snapshotId must have at least 36 elements") + if strlen(r.publicIpId) < 36 { + return fmt.Errorf("publicIpId must have at least 36 elements") } - if strlen(r.snapshotId) > 36 { - return fmt.Errorf("snapshotId must have less than 36 elements") + if strlen(r.publicIpId) > 36 { + return fmt.Errorf("publicIpId must have less than 36 elements") } // to determine the Content-Type header @@ -10253,42 +11058,48 @@ func (r DeleteSnapshotRequest) Execute() error { } /* -DeleteSnapshot: Delete a snapshot. +DeletePublicIP: Delete a public IP. -Delete a snapshot that is part of the project. +Delete a public IP that is part of the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param snapshotId The identifier (ID) of a STACKIT Snapshot. - @return ApiDeleteSnapshotRequest + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiDeletePublicIPRequest */ -func (a *APIClient) DeleteSnapshot(ctx context.Context, projectId string, snapshotId string) ApiDeleteSnapshotRequest { - return DeleteSnapshotRequest{ +func (a *APIClient) DeletePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiDeletePublicIPRequest { + return DeletePublicIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - snapshotId: snapshotId, + region: region, + publicIpId: publicIpId, } } -func (a *APIClient) DeleteSnapshotExecute(ctx context.Context, projectId string, snapshotId string) error { - r := DeleteSnapshotRequest{ +func (a *APIClient) DeletePublicIPExecute(ctx context.Context, projectId string, region string, publicIpId string) error { + r := DeletePublicIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - snapshotId: snapshotId, + region: region, + publicIpId: publicIpId, } return r.Execute() } -type DeleteVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - volumeId string +type DeleteRouteFromRoutingTableRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string + routeId string } -func (r DeleteVolumeRequest) Execute() error { +func (r DeleteRouteFromRoutingTableRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -10299,29 +11110,44 @@ func (r DeleteVolumeRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteVolume") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteRouteFromRoutingTable") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/volumes/{volumeId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(r.routingTableId, "routingTableId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(r.routeId, "routeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.volumeId) < 36 { - return fmt.Errorf("volumeId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.volumeId) > 36 { - return fmt.Errorf("volumeId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return fmt.Errorf("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return fmt.Errorf("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return fmt.Errorf("routingTableId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return fmt.Errorf("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return fmt.Errorf("routeId must have less than 36 elements") } // to determine the Content-Type header @@ -10417,7 +11243,196 @@ func (r DeleteVolumeRequest) Execute() error { newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 409 { + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +DeleteRouteFromRoutingTable: Delete a route in a routing table. + +Delete a route in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteRouteFromRoutingTableRequest +*/ +func (a *APIClient) DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest { + return DeleteRouteFromRoutingTableRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +func (a *APIClient) DeleteRouteFromRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) error { + r := DeleteRouteFromRoutingTableRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } + return r.Execute() +} + +type DeleteRoutingTableFromAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string +} + +func (r DeleteRoutingTableFromAreaRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteRoutingTableFromArea") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return fmt.Errorf("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return fmt.Errorf("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return fmt.Errorf("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return fmt.Errorf("routingTableId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -10445,76 +11460,2238 @@ func (r DeleteVolumeRequest) Execute() error { } /* -DeleteVolume: Delete a volume. +DeleteRoutingTableFromArea: Delete a routing table. -Delete a volume inside a project. The deletion will fail if the volume is still in use. +Delete a routing table of a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param volumeId The identifier (ID) of a STACKIT Volume. - @return ApiDeleteVolumeRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiDeleteRoutingTableFromAreaRequest */ -func (a *APIClient) DeleteVolume(ctx context.Context, projectId string, volumeId string) ApiDeleteVolumeRequest { - return DeleteVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumeId: volumeId, +func (a *APIClient) DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest { + return DeleteRoutingTableFromAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, } } -func (a *APIClient) DeleteVolumeExecute(ctx context.Context, projectId string, volumeId string) error { - r := DeleteVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumeId: volumeId, +func (a *APIClient) DeleteRoutingTableFromAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) error { + r := DeleteRoutingTableFromAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, } return r.Execute() } -type GetAffinityGroupRequest struct { +type DeleteSecurityGroupRequest struct { ctx context.Context apiService *DefaultApiService projectId string - affinityGroupId string + region string + securityGroupId string +} + +func (r DeleteSecurityGroupRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSecurityGroup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return fmt.Errorf("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return fmt.Errorf("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +DeleteSecurityGroup: Delete security group. + +Delete a security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiDeleteSecurityGroupRequest +*/ +func (a *APIClient) DeleteSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiDeleteSecurityGroupRequest { + return DeleteSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +func (a *APIClient) DeleteSecurityGroupExecute(ctx context.Context, projectId string, region string, securityGroupId string) error { + r := DeleteSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } + return r.Execute() +} + +type DeleteSecurityGroupRuleRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + securityGroupId string + securityGroupRuleId string +} + +func (r DeleteSecurityGroupRuleRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSecurityGroupRule") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return fmt.Errorf("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return fmt.Errorf("securityGroupId must have less than 36 elements") + } + if strlen(r.securityGroupRuleId) < 36 { + return fmt.Errorf("securityGroupRuleId must have at least 36 elements") + } + if strlen(r.securityGroupRuleId) > 36 { + return fmt.Errorf("securityGroupRuleId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +DeleteSecurityGroupRule: Delete security group rule. + +Delete a security group rule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiDeleteSecurityGroupRuleRequest +*/ +func (a *APIClient) DeleteSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest { + return DeleteSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +func (a *APIClient) DeleteSecurityGroupRuleExecute(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) error { + r := DeleteSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } + return r.Execute() +} + +type DeleteServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + serverId string +} + +func (r DeleteServerRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return fmt.Errorf("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return fmt.Errorf("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +DeleteServer: Delete a server. + +Delete a server. Volumes won't be deleted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeleteServerRequest +*/ +func (a *APIClient) DeleteServer(ctx context.Context, projectId string, region string, serverId string) ApiDeleteServerRequest { + return DeleteServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +func (a *APIClient) DeleteServerExecute(ctx context.Context, projectId string, region string, serverId string) error { + r := DeleteServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } + return r.Execute() +} + +type DeleteSnapshotRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + snapshotId string +} + +func (r DeleteSnapshotRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSnapshot") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(r.snapshotId, "snapshotId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.snapshotId) < 36 { + return fmt.Errorf("snapshotId must have at least 36 elements") + } + if strlen(r.snapshotId) > 36 { + return fmt.Errorf("snapshotId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +DeleteSnapshot: Delete a snapshot. + +Delete a snapshot that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiDeleteSnapshotRequest +*/ +func (a *APIClient) DeleteSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiDeleteSnapshotRequest { + return DeleteSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } +} + +func (a *APIClient) DeleteSnapshotExecute(ctx context.Context, projectId string, region string, snapshotId string) error { + r := DeleteSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } + return r.Execute() +} + +type DeleteVolumeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + volumeId string +} + +func (r DeleteVolumeRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteVolume") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return fmt.Errorf("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return fmt.Errorf("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +DeleteVolume: Delete a volume. + +Delete a volume inside a project. The deletion will fail if the volume is still in use. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiDeleteVolumeRequest +*/ +func (a *APIClient) DeleteVolume(ctx context.Context, projectId string, region string, volumeId string) ApiDeleteVolumeRequest { + return DeleteVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +func (a *APIClient) DeleteVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) error { + r := DeleteVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } + return r.Execute() +} + +type GetAffinityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + affinityGroupId string +} + +func (r GetAffinityGroupRequest) Execute() (*AffinityGroup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AffinityGroup + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAffinityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/affinity-groups/{affinityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(r.affinityGroupId, "affinityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.affinityGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("affinityGroupId must have at least 36 elements") + } + if strlen(r.affinityGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("affinityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetAffinityGroup: Get the affinity group. + +Get the affinity group created in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiGetAffinityGroupRequest +*/ +func (a *APIClient) GetAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiGetAffinityGroupRequest { + return GetAffinityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + affinityGroupId: affinityGroupId, + } +} + +func (a *APIClient) GetAffinityGroupExecute(ctx context.Context, projectId string, region string, affinityGroupId string) (*AffinityGroup, error) { + r := GetAffinityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + affinityGroupId: affinityGroupId, + } + return r.Execute() +} + +type GetAttachedVolumeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + serverId string + volumeId string +} + +func (r GetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachment + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAttachedVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetAttachedVolume: Get Volume Attachment details. + +Get the details of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetAttachedVolumeRequest +*/ +func (a *APIClient) GetAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiGetAttachedVolumeRequest { + return GetAttachedVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +func (a *APIClient) GetAttachedVolumeExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) (*VolumeAttachment, error) { + r := GetAttachedVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } + return r.Execute() +} + +type GetBackupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + backupId string +} + +func (r GetBackupRequest) Execute() (*Backup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.backupId) < 36 { + return localVarReturnValue, fmt.Errorf("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return localVarReturnValue, fmt.Errorf("backupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetBackup: Get details about a backup. + +Get details about a block device backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiGetBackupRequest +*/ +func (a *APIClient) GetBackup(ctx context.Context, projectId string, region string, backupId string) ApiGetBackupRequest { + return GetBackupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, region string, backupId string) (*Backup, error) { + r := GetBackupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } + return r.Execute() +} + +type GetImageRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + imageId string +} + +func (r GetImageRequest) Execute() (*Image, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Image + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetImage") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, fmt.Errorf("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetImage: Get details about an image. + +Get details about a specific Image inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageRequest +*/ +func (a *APIClient) GetImage(ctx context.Context, projectId string, region string, imageId string) ApiGetImageRequest { + return GetImageRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +func (a *APIClient) GetImageExecute(ctx context.Context, projectId string, region string, imageId string) (*Image, error) { + r := GetImageRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } + return r.Execute() +} + +type GetImageShareRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + imageId string +} + +func (r GetImageShareRequest) Execute() (*ImageShare, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetImageShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, fmt.Errorf("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetImageShare: Get share details of an image. + +Get share details about an shared image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageShareRequest +*/ +func (a *APIClient) GetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiGetImageShareRequest { + return GetImageShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +func (a *APIClient) GetImageShareExecute(ctx context.Context, projectId string, region string, imageId string) (*ImageShare, error) { + r := GetImageShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } + return r.Execute() +} + +type GetImageShareConsumerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + imageId string + consumerProjectId string +} + +func (r GetImageShareConsumerRequest) Execute() (*ImageShareConsumer, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShareConsumer + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetImageShareConsumer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share/{consumerProjectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(r.consumerProjectId, "consumerProjectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, fmt.Errorf("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + } + if strlen(r.consumerProjectId) < 36 { + return localVarReturnValue, fmt.Errorf("consumerProjectId must have at least 36 elements") + } + if strlen(r.consumerProjectId) > 36 { + return localVarReturnValue, fmt.Errorf("consumerProjectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetImageShareConsumer: Get image share consumer. + +Get details about an image share consumer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiGetImageShareConsumerRequest +*/ +func (a *APIClient) GetImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest { + return GetImageShareConsumerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + consumerProjectId: consumerProjectId, + } +} + +func (a *APIClient) GetImageShareConsumerExecute(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) (*ImageShareConsumer, error) { + r := GetImageShareConsumerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + consumerProjectId: consumerProjectId, + } + return r.Execute() +} + +type GetKeyPairRequest struct { + ctx context.Context + apiService *DefaultApiService + keypairName string } -func (r GetAffinityGroupRequest) Execute() (*AffinityGroup, error) { +func (r GetKeyPairRequest) Execute() (*Keypair, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AffinityGroup + localVarReturnValue *Keypair ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAffinityGroup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeyPair") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/affinity-groups/{affinityGroupId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(r.affinityGroupId, "affinityGroupId")), -1) + localVarPath := localBasePath + "/v2/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(r.keypairName, "keypairName")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.affinityGroupId) < 36 { - return localVarReturnValue, fmt.Errorf("affinityGroupId must have at least 36 elements") - } - if strlen(r.affinityGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("affinityGroupId must have less than 36 elements") + if strlen(r.keypairName) > 127 { + return localVarReturnValue, fmt.Errorf("keypairName must have less than 127 elements") } // to determine the Content-Type header @@ -10637,63 +13814,60 @@ func (r GetAffinityGroupRequest) Execute() (*AffinityGroup, error) { } /* -GetAffinityGroup: Get the affinity group. +GetKeyPair: Get SSH keypair details. -Get the affinity group created in a project. +Get details about an SSH keypair. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. - @return ApiGetAffinityGroupRequest + @param keypairName The name of an SSH keypair. + @return ApiGetKeyPairRequest */ -func (a *APIClient) GetAffinityGroup(ctx context.Context, projectId string, affinityGroupId string) ApiGetAffinityGroupRequest { - return GetAffinityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - affinityGroupId: affinityGroupId, +func (a *APIClient) GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest { + return GetKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, } } -func (a *APIClient) GetAffinityGroupExecute(ctx context.Context, projectId string, affinityGroupId string) (*AffinityGroup, error) { - r := GetAffinityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - affinityGroupId: affinityGroupId, +func (a *APIClient) GetKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) { + r := GetKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, } return r.Execute() } -type GetAttachedVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - volumeId string +type GetMachineTypeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + machineType string } -func (r GetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { +func (r GetMachineTypeRequest) Execute() (*MachineType, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VolumeAttachment + localVarReturnValue *MachineType ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAttachedVolume") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetMachineType") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/machine-types/{machineType}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"machineType"+"}", url.PathEscape(ParameterValueToString(r.machineType, "machineType")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -10704,17 +13878,8 @@ func (r GetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") - } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") - } - if strlen(r.volumeId) < 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") - } - if strlen(r.volumeId) > 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") + if strlen(r.machineType) > 127 { + return localVarReturnValue, fmt.Errorf("machineType must have less than 127 elements") } // to determine the Content-Type header @@ -10837,64 +14002,66 @@ func (r GetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { } /* -GetAttachedVolume: Get Volume Attachment details. +GetMachineType: Get details about a machine type. -Get the details of an existing Volume Attachment. +Get details about a specific machine type. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @param volumeId The identifier (ID) of a STACKIT Volume. - @return ApiGetAttachedVolumeRequest + @param region The STACKIT Region of the resources. + @param machineType STACKIT machine type Name. + @return ApiGetMachineTypeRequest */ -func (a *APIClient) GetAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiGetAttachedVolumeRequest { - return GetAttachedVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - volumeId: volumeId, +func (a *APIClient) GetMachineType(ctx context.Context, projectId string, region string, machineType string) ApiGetMachineTypeRequest { + return GetMachineTypeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + machineType: machineType, } } -func (a *APIClient) GetAttachedVolumeExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) { - r := GetAttachedVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - volumeId: volumeId, +func (a *APIClient) GetMachineTypeExecute(ctx context.Context, projectId string, region string, machineType string) (*MachineType, error) { + r := GetMachineTypeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + machineType: machineType, } return r.Execute() } -type GetBackupRequest struct { +type GetNetworkRequest struct { ctx context.Context apiService *DefaultApiService projectId string - backupId string + region string + networkId string } -func (r GetBackupRequest) Execute() (*Backup, error) { +func (r GetNetworkRequest) Execute() (*Network, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Backup + localVarReturnValue *Network ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBackup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetwork") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/backups/{backupId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -10905,11 +14072,11 @@ func (r GetBackupRequest) Execute() (*Backup, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.backupId) < 36 { - return localVarReturnValue, fmt.Errorf("backupId must have at least 36 elements") + if strlen(r.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") } - if strlen(r.backupId) > 36 { - return localVarReturnValue, fmt.Errorf("backupId must have less than 36 elements") + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") } // to determine the Content-Type header @@ -11032,76 +14199,79 @@ func (r GetBackupRequest) Execute() (*Backup, error) { } /* -GetBackup: Get details about a backup. +GetNetwork: Get network details. -Get details about a block device backup. +Get details about a network of a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param backupId The identifier (ID) of a STACKIT Backup. - @return ApiGetBackupRequest + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiGetNetworkRequest */ -func (a *APIClient) GetBackup(ctx context.Context, projectId string, backupId string) ApiGetBackupRequest { - return GetBackupRequest{ +func (a *APIClient) GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest { + return GetNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - backupId: backupId, + region: region, + networkId: networkId, } } -func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, backupId string) (*Backup, error) { - r := GetBackupRequest{ +func (a *APIClient) GetNetworkExecute(ctx context.Context, projectId string, region string, networkId string) (*Network, error) { + r := GetNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - backupId: backupId, + region: region, + networkId: networkId, } return r.Execute() } -type GetImageRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string +type GetNetworkAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string } -func (r GetImageRequest) Execute() (*Image, error) { +func (r GetNetworkAreaRequest) Execute() (*NetworkArea, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Image + localVarReturnValue *NetworkArea ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetImage") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetworkArea") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.imageId) < 36 { - return localVarReturnValue, fmt.Errorf("imageId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.imageId) > 36 { - return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } // to determine the Content-Type header @@ -11224,76 +14394,86 @@ func (r GetImageRequest) Execute() (*Image, error) { } /* -GetImage: Get details about an image. +GetNetworkArea: Get details about a network area. -Get details about a specific Image inside a project. +Get details about a network area in an organization. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiGetImageRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiGetNetworkAreaRequest */ -func (a *APIClient) GetImage(ctx context.Context, projectId string, imageId string) ApiGetImageRequest { - return GetImageRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +func (a *APIClient) GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest { + return GetNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } } -func (a *APIClient) GetImageExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { - r := GetImageRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +func (a *APIClient) GetNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) { + r := GetNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } return r.Execute() } -type GetImageShareRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string +type GetNetworkAreaRangeRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + networkRangeId string } -func (r GetImageShareRequest) Execute() (*ImageShare, error) { +func (r GetNetworkAreaRangeRequest) Execute() (*NetworkRange, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ImageShare + localVarReturnValue *NetworkRange ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetImageShare") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetworkAreaRange") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/share" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges/{networkRangeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(r.networkRangeId, "networkRangeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } - if strlen(r.imageId) < 36 { - return localVarReturnValue, fmt.Errorf("imageId must have at least 36 elements") + if strlen(r.networkRangeId) < 36 { + return localVarReturnValue, fmt.Errorf("networkRangeId must have at least 36 elements") } - if strlen(r.imageId) > 36 { - return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + if strlen(r.networkRangeId) > 36 { + return localVarReturnValue, fmt.Errorf("networkRangeId must have less than 36 elements") } // to determine the Content-Type header @@ -11416,84 +14596,84 @@ func (r GetImageShareRequest) Execute() (*ImageShare, error) { } /* -GetImageShare: Get share details of an image. +GetNetworkAreaRange: Get details about a network range. -Get share details about an shared image. +Get details about a network range in a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiGetImageShareRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiGetNetworkAreaRangeRequest */ -func (a *APIClient) GetImageShare(ctx context.Context, projectId string, imageId string) ApiGetImageShareRequest { - return GetImageShareRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +func (a *APIClient) GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiGetNetworkAreaRangeRequest { + return GetNetworkAreaRangeRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + networkRangeId: networkRangeId, } } -func (a *APIClient) GetImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) { - r := GetImageShareRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +func (a *APIClient) GetNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) (*NetworkRange, error) { + r := GetNetworkAreaRangeRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + networkRangeId: networkRangeId, } return r.Execute() } -type GetImageShareConsumerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string - consumerProjectId string +type GetNetworkAreaRegionRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string } -func (r GetImageShareConsumerRequest) Execute() (*ImageShareConsumer, error) { +func (r GetNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ImageShareConsumer + localVarReturnValue *RegionalArea ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetImageShareConsumer") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetworkAreaRegion") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(r.consumerProjectId, "consumerProjectId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.imageId) < 36 { - return localVarReturnValue, fmt.Errorf("imageId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.imageId) > 36 { - return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.consumerProjectId) < 36 { - return localVarReturnValue, fmt.Errorf("consumerProjectId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.consumerProjectId) > 36 { - return localVarReturnValue, fmt.Errorf("consumerProjectId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } // to determine the Content-Type header @@ -11616,68 +14796,89 @@ func (r GetImageShareConsumerRequest) Execute() (*ImageShareConsumer, error) { } /* -GetImageShareConsumer: Get image share consumer. +GetNetworkAreaRegion: Get details about a configured region. -Get details about an image share consumer. +Get details about a configured region in a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. - @return ApiGetImageShareConsumerRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiGetNetworkAreaRegionRequest */ -func (a *APIClient) GetImageShareConsumer(ctx context.Context, projectId string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest { - return GetImageShareConsumerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - consumerProjectId: consumerProjectId, +func (a *APIClient) GetNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiGetNetworkAreaRegionRequest { + return GetNetworkAreaRegionRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } } -func (a *APIClient) GetImageShareConsumerExecute(ctx context.Context, projectId string, imageId string, consumerProjectId string) (*ImageShareConsumer, error) { - r := GetImageShareConsumerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - consumerProjectId: consumerProjectId, +func (a *APIClient) GetNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) (*RegionalArea, error) { + r := GetNetworkAreaRegionRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } return r.Execute() } -type GetKeyPairRequest struct { - ctx context.Context - apiService *DefaultApiService - keypairName string +type GetNetworkAreaRouteRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routeId string } -func (r GetKeyPairRequest) Execute() (*Keypair, error) { +func (r GetNetworkAreaRouteRequest) Execute() (*Route, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Keypair + localVarReturnValue *Route ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeyPair") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetworkAreaRoute") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/keypairs/{keypairName}" - localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(r.keypairName, "keypairName")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(r.routeId, "routeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.keypairName) > 127 { - return localVarReturnValue, fmt.Errorf("keypairName must have less than 127 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, fmt.Errorf("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, fmt.Errorf("routeId must have less than 36 elements") } // to determine the Content-Type header @@ -11800,58 +15001,71 @@ func (r GetKeyPairRequest) Execute() (*Keypair, error) { } /* -GetKeyPair: Get SSH keypair details. +GetNetworkAreaRoute: Get details about a network route. -Get details about an SSH keypair. +Get details about a network route defined in a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param keypairName The name of an SSH keypair. - @return ApiGetKeyPairRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetNetworkAreaRouteRequest */ -func (a *APIClient) GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest { - return GetKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +func (a *APIClient) GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiGetNetworkAreaRouteRequest { + return GetNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, } } -func (a *APIClient) GetKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) { - r := GetKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +func (a *APIClient) GetNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string, routeId string) (*Route, error) { + r := GetNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, } return r.Execute() } -type GetMachineTypeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - machineType string +type GetNicRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + networkId string + nicId string } -func (r GetMachineTypeRequest) Execute() (*MachineType, error) { +func (r GetNicRequest) Execute() (*NIC, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *MachineType + localVarReturnValue *NIC ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetMachineType") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNic") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/machine-types/{machineType}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"machineType"+"}", url.PathEscape(ParameterValueToString(r.machineType, "machineType")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -11862,8 +15076,17 @@ func (r GetMachineTypeRequest) Execute() (*MachineType, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.machineType) > 127 { - return localVarReturnValue, fmt.Errorf("machineType must have less than 127 elements") + if strlen(r.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return localVarReturnValue, fmt.Errorf("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, fmt.Errorf("nicId must have less than 36 elements") } // to determine the Content-Type header @@ -11986,76 +15209,82 @@ func (r GetMachineTypeRequest) Execute() (*MachineType, error) { } /* -GetMachineType: Get details about a machine type. +GetNic: Get details about a network interface. -Get details about a specific machine type. +Get details about a network interface inside a network. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param machineType STACKIT machine type Name. - @return ApiGetMachineTypeRequest + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiGetNicRequest */ -func (a *APIClient) GetMachineType(ctx context.Context, projectId string, machineType string) ApiGetMachineTypeRequest { - return GetMachineTypeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - machineType: machineType, +func (a *APIClient) GetNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiGetNicRequest { + return GetNicRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, } } -func (a *APIClient) GetMachineTypeExecute(ctx context.Context, projectId string, machineType string) (*MachineType, error) { - r := GetMachineTypeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - machineType: machineType, +func (a *APIClient) GetNicExecute(ctx context.Context, projectId string, region string, networkId string, nicId string) (*NIC, error) { + r := GetNicRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, } return r.Execute() } -type GetNetworkRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string +type GetOrganizationRequestRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + requestId string } -func (r GetNetworkRequest) Execute() (*Network, error) { +func (r GetOrganizationRequestRequest) Execute() (*Request, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Network + localVarReturnValue *Request ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetwork") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOrganizationRequest") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(r.requestId, "requestId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + if strlen(r.requestId) < 36 { + return localVarReturnValue, fmt.Errorf("requestId must have at least 36 elements") } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.requestId) > 36 { + return localVarReturnValue, fmt.Errorf("requestId must have less than 36 elements") } // to determine the Content-Type header @@ -12178,76 +15407,68 @@ func (r GetNetworkRequest) Execute() (*Network, error) { } /* -GetNetwork: Get network details. +GetOrganizationRequest: Lookup an organization request ID. -Get details about a network of a project. +Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiGetNetworkRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetOrganizationRequestRequest */ -func (a *APIClient) GetNetwork(ctx context.Context, projectId string, networkId string) ApiGetNetworkRequest { - return GetNetworkRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, +func (a *APIClient) GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest { + return GetOrganizationRequestRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + requestId: requestId, } } -func (a *APIClient) GetNetworkExecute(ctx context.Context, projectId string, networkId string) (*Network, error) { - r := GetNetworkRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, +func (a *APIClient) GetOrganizationRequestExecute(ctx context.Context, organizationId string, requestId string) (*Request, error) { + r := GetOrganizationRequestRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + requestId: requestId, } return r.Execute() } -type GetNetworkAreaRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string +type GetProjectDetailsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string } -func (r GetNetworkAreaRequest) Execute() (*NetworkArea, error) { +func (r GetProjectDetailsRequest) Execute() (*Project, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NetworkArea + localVarReturnValue *Project ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetworkArea") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectDetails") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } // to determine the Content-Type header @@ -12370,84 +15591,75 @@ func (r GetNetworkAreaRequest) Execute() (*NetworkArea, error) { } /* -GetNetworkArea: Get details about a network area. +GetProjectDetails: Get project details. -Get details about a network area in an organization. +Get details about a STACKIT project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiGetNetworkAreaRequest + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiGetProjectDetailsRequest */ -func (a *APIClient) GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest { - return GetNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest { + return GetProjectDetailsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } } -func (a *APIClient) GetNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) { - r := GetNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) GetProjectDetailsExecute(ctx context.Context, projectId string) (*Project, error) { + r := GetProjectDetailsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } return r.Execute() } -type GetNetworkAreaRangeRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - networkRangeId string +type GetProjectNICRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + nicId string } -func (r GetNetworkAreaRangeRequest) Execute() (*NetworkRange, error) { +func (r GetProjectNICRequest) Execute() (*NIC, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NetworkRange + localVarReturnValue *NIC ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetworkAreaRange") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectNIC") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(r.networkRangeId, "networkRangeId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.networkRangeId) < 36 { - return localVarReturnValue, fmt.Errorf("networkRangeId must have at least 36 elements") + if strlen(r.nicId) < 36 { + return localVarReturnValue, fmt.Errorf("nicId must have at least 36 elements") } - if strlen(r.networkRangeId) > 36 { - return localVarReturnValue, fmt.Errorf("networkRangeId must have less than 36 elements") + if strlen(r.nicId) > 36 { + return localVarReturnValue, fmt.Errorf("nicId must have less than 36 elements") } // to determine the Content-Type header @@ -12570,87 +15782,81 @@ func (r GetNetworkAreaRangeRequest) Execute() (*NetworkRange, error) { } /* -GetNetworkAreaRange: Get details about a network range. +GetProjectNIC: Get details about a network interface of a project. -Get details about a network range in a network area. +Get details about a network interface inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param networkRangeId The identifier (ID) of a STACKIT Network Range. - @return ApiGetNetworkAreaRangeRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param nicId The identifier (ID) of a network interface. + @return ApiGetProjectNICRequest */ -func (a *APIClient) GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, networkRangeId string) ApiGetNetworkAreaRangeRequest { - return GetNetworkAreaRangeRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - networkRangeId: networkRangeId, +func (a *APIClient) GetProjectNIC(ctx context.Context, projectId string, region string, nicId string) ApiGetProjectNICRequest { + return GetProjectNICRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + nicId: nicId, } } -func (a *APIClient) GetNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, networkRangeId string) (*NetworkRange, error) { - r := GetNetworkAreaRangeRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - networkRangeId: networkRangeId, +func (a *APIClient) GetProjectNICExecute(ctx context.Context, projectId string, region string, nicId string) (*NIC, error) { + r := GetProjectNICRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + nicId: nicId, } return r.Execute() } -type GetNetworkAreaRouteRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - routeId string +type GetProjectRequestRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + requestId string } -func (r GetNetworkAreaRouteRequest) Execute() (*Route, error) { +func (r GetProjectRequestRequest) Execute() (*Request, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Route + localVarReturnValue *Request ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetworkAreaRoute") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectRequest") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(r.routeId, "routeId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(r.requestId, "requestId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.routeId) < 36 { - return localVarReturnValue, fmt.Errorf("routeId must have at least 36 elements") + if strlen(r.requestId) < 36 { + return localVarReturnValue, fmt.Errorf("requestId must have at least 36 elements") } - if strlen(r.routeId) > 36 { - return localVarReturnValue, fmt.Errorf("routeId must have less than 36 elements") + if strlen(r.requestId) > 36 { + return localVarReturnValue, fmt.Errorf("requestId must have less than 36 elements") } // to determine the Content-Type header @@ -12773,66 +15979,66 @@ func (r GetNetworkAreaRouteRequest) Execute() (*Route, error) { } /* -GetNetworkAreaRoute: Get details about a network route. +GetProjectRequest: Lookup a project request ID. -Get details about a network route defined in a network area. +Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param routeId The identifier (ID) of a STACKIT Route. - @return ApiGetNetworkAreaRouteRequest -*/ -func (a *APIClient) GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiGetNetworkAreaRouteRequest { - return GetNetworkAreaRouteRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - routeId: routeId, + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetProjectRequestRequest +*/ +func (a *APIClient) GetProjectRequest(ctx context.Context, projectId string, region string, requestId string) ApiGetProjectRequestRequest { + return GetProjectRequestRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + requestId: requestId, } } -func (a *APIClient) GetNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, routeId string) (*Route, error) { - r := GetNetworkAreaRouteRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - routeId: routeId, +func (a *APIClient) GetProjectRequestExecute(ctx context.Context, projectId string, region string, requestId string) (*Request, error) { + r := GetProjectRequestRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + requestId: requestId, } return r.Execute() } -type GetNicRequest struct { +type GetPublicIPRequest struct { ctx context.Context apiService *DefaultApiService projectId string - networkId string - nicId string + region string + publicIpId string } -func (r GetNicRequest) Execute() (*NIC, error) { +func (r GetPublicIPRequest) Execute() (*PublicIp, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NIC + localVarReturnValue *PublicIp ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNic") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPublicIP") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -12843,17 +16049,11 @@ func (r GetNicRequest) Execute() (*NIC, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") - } - if strlen(r.nicId) < 36 { - return localVarReturnValue, fmt.Errorf("nicId must have at least 36 elements") + if strlen(r.publicIpId) < 36 { + return localVarReturnValue, fmt.Errorf("publicIpId must have at least 36 elements") } - if strlen(r.nicId) > 36 { - return localVarReturnValue, fmt.Errorf("nicId must have less than 36 elements") + if strlen(r.publicIpId) > 36 { + return localVarReturnValue, fmt.Errorf("publicIpId must have less than 36 elements") } // to determine the Content-Type header @@ -12976,64 +16176,70 @@ func (r GetNicRequest) Execute() (*NIC, error) { } /* -GetNic: Get details about a network interface of a network. +GetPublicIP: Get details about a public IP. -Get details about a network interface inside a network. +Get details about a public IP inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @param nicId The identifier (ID) of a network interface. - @return ApiGetNicRequest + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiGetPublicIPRequest */ -func (a *APIClient) GetNic(ctx context.Context, projectId string, networkId string, nicId string) ApiGetNicRequest { - return GetNicRequest{ +func (a *APIClient) GetPublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiGetPublicIPRequest { + return GetPublicIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, - nicId: nicId, + region: region, + publicIpId: publicIpId, } } -func (a *APIClient) GetNicExecute(ctx context.Context, projectId string, networkId string, nicId string) (*NIC, error) { - r := GetNicRequest{ +func (a *APIClient) GetPublicIPExecute(ctx context.Context, projectId string, region string, publicIpId string) (*PublicIp, error) { + r := GetPublicIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, - nicId: nicId, + region: region, + publicIpId: publicIpId, } return r.Execute() } -type GetOrganizationRequestRequest struct { +type GetRouteOfRoutingTableRequest struct { ctx context.Context apiService *DefaultApiService organizationId string - requestId string + areaId string + region string + routingTableId string + routeId string } -func (r GetOrganizationRequestRequest) Execute() (*Request, error) { +func (r GetRouteOfRoutingTableRequest) Execute() (*Route, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Request + localVarReturnValue *Route ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOrganizationRequest") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetRouteOfRoutingTable") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/requests/{requestId}" + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(r.requestId, "requestId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(r.routingTableId, "routingTableId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(r.routeId, "routeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -13044,11 +16250,23 @@ func (r GetOrganizationRequestRequest) Execute() (*Request, error) { if strlen(r.organizationId) > 36 { return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.requestId) < 36 { - return localVarReturnValue, fmt.Errorf("requestId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.requestId) > 36 { - return localVarReturnValue, fmt.Errorf("requestId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, fmt.Errorf("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, fmt.Errorf("routeId must have less than 36 elements") } // to determine the Content-Type header @@ -13171,68 +16389,95 @@ func (r GetOrganizationRequestRequest) Execute() (*Request, error) { } /* -GetOrganizationRequest: Lookup an organization request ID. +GetRouteOfRoutingTable: Get details about a route of a routing table. -Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. +Get details about a route defined in a routing table. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. - @param requestId The identifier (ID) of a STACKIT Request. - @return ApiGetOrganizationRequestRequest + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetRouteOfRoutingTableRequest */ -func (a *APIClient) GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest { - return GetOrganizationRequestRequest{ +func (a *APIClient) GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest { + return GetRouteOfRoutingTableRequest{ apiService: a.defaultApi, ctx: ctx, organizationId: organizationId, - requestId: requestId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, } } -func (a *APIClient) GetOrganizationRequestExecute(ctx context.Context, organizationId string, requestId string) (*Request, error) { - r := GetOrganizationRequestRequest{ +func (a *APIClient) GetRouteOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) (*Route, error) { + r := GetRouteOfRoutingTableRequest{ apiService: a.defaultApi, ctx: ctx, organizationId: organizationId, - requestId: requestId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, } return r.Execute() } -type GetProjectDetailsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string +type GetRoutingTableOfAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string } -func (r GetProjectDetailsRequest) Execute() (*Project, error) { +func (r GetRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Project + localVarReturnValue *RoutingTable ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectDetails") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetRoutingTableOfArea") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(r.routingTableId, "routingTableId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have less than 36 elements") } // to determine the Content-Type header @@ -13355,58 +16600,69 @@ func (r GetProjectDetailsRequest) Execute() (*Project, error) { } /* -GetProjectDetails: Get project details. +GetRoutingTableOfArea: Get details about a routing table. -Get details about a STACKIT project. +Get details about a routing table defined in a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @return ApiGetProjectDetailsRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiGetRoutingTableOfAreaRequest */ -func (a *APIClient) GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest { - return GetProjectDetailsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest { + return GetRoutingTableOfAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, } } -func (a *APIClient) GetProjectDetailsExecute(ctx context.Context, projectId string) (*Project, error) { - r := GetProjectDetailsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) GetRoutingTableOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RoutingTable, error) { + r := GetRoutingTableOfAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, } return r.Execute() } -type GetProjectNICRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - nicId string +type GetSecurityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + securityGroupId string } -func (r GetProjectNICRequest) Execute() (*NIC, error) { +func (r GetSecurityGroupRequest) Execute() (*SecurityGroup, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NIC + localVarReturnValue *SecurityGroup ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectNIC") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSecurityGroup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/nics/{nicId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -13417,11 +16673,11 @@ func (r GetProjectNICRequest) Execute() (*NIC, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.nicId) < 36 { - return localVarReturnValue, fmt.Errorf("nicId must have at least 36 elements") + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") } - if strlen(r.nicId) > 36 { - return localVarReturnValue, fmt.Errorf("nicId must have less than 36 elements") + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") } // to determine the Content-Type header @@ -13544,61 +16800,68 @@ func (r GetProjectNICRequest) Execute() (*NIC, error) { } /* -GetProjectNIC: Get details about a network interface of a project. +GetSecurityGroup: Get security group details. -Get details about a network interface inside a project. +Get details about a security group of a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param nicId The identifier (ID) of a network interface. - @return ApiGetProjectNICRequest + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiGetSecurityGroupRequest */ -func (a *APIClient) GetProjectNIC(ctx context.Context, projectId string, nicId string) ApiGetProjectNICRequest { - return GetProjectNICRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - nicId: nicId, +func (a *APIClient) GetSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiGetSecurityGroupRequest { + return GetSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, } } -func (a *APIClient) GetProjectNICExecute(ctx context.Context, projectId string, nicId string) (*NIC, error) { - r := GetProjectNICRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - nicId: nicId, +func (a *APIClient) GetSecurityGroupExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroup, error) { + r := GetSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, } return r.Execute() } -type GetProjectRequestRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - requestId string +type GetSecurityGroupRuleRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + securityGroupId string + securityGroupRuleId string } -func (r GetProjectRequestRequest) Execute() (*Request, error) { +func (r GetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Request + localVarReturnValue *SecurityGroupRule ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectRequest") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSecurityGroupRule") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/requests/{requestId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(r.requestId, "requestId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -13609,11 +16872,17 @@ func (r GetProjectRequestRequest) Execute() (*Request, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.requestId) < 36 { - return localVarReturnValue, fmt.Errorf("requestId must have at least 36 elements") + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") } - if strlen(r.requestId) > 36 { - return localVarReturnValue, fmt.Errorf("requestId must have less than 36 elements") + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") + } + if strlen(r.securityGroupRuleId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupRuleId must have at least 36 elements") + } + if strlen(r.securityGroupRuleId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupRuleId must have less than 36 elements") } // to determine the Content-Type header @@ -13736,61 +17005,77 @@ func (r GetProjectRequestRequest) Execute() (*Request, error) { } /* -GetProjectRequest: Lookup a project request ID. +GetSecurityGroupRule: Get security group rule details. -Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. +Get details about a security group rule of a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param requestId The identifier (ID) of a STACKIT Request. - @return ApiGetProjectRequestRequest + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiGetSecurityGroupRuleRequest */ -func (a *APIClient) GetProjectRequest(ctx context.Context, projectId string, requestId string) ApiGetProjectRequestRequest { - return GetProjectRequestRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - requestId: requestId, +func (a *APIClient) GetSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest { + return GetSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, } } -func (a *APIClient) GetProjectRequestExecute(ctx context.Context, projectId string, requestId string) (*Request, error) { - r := GetProjectRequestRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - requestId: requestId, +func (a *APIClient) GetSecurityGroupRuleExecute(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) (*SecurityGroupRule, error) { + r := GetSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, } return r.Execute() } -type GetPublicIPRequest struct { +type GetServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string - publicIpId string + region string + serverId string + details *bool } -func (r GetPublicIPRequest) Execute() (*PublicIp, error) { +// Show detailed information about server. + +func (r GetServerRequest) Details(details bool) ApiGetServerRequest { + r.details = &details + return r +} + +func (r GetServerRequest) Execute() (*Server, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PublicIp + localVarReturnValue *Server ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPublicIP") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServer") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/public-ips/{publicIpId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -13801,13 +17086,16 @@ func (r GetPublicIPRequest) Execute() (*PublicIp, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.publicIpId) < 36 { - return localVarReturnValue, fmt.Errorf("publicIpId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.publicIpId) > 36 { - return localVarReturnValue, fmt.Errorf("publicIpId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } + if r.details != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -13928,61 +17216,66 @@ func (r GetPublicIPRequest) Execute() (*PublicIp, error) { } /* -GetPublicIP: Get details about a public IP. +GetServer: Get server details. -Get details about a public IP inside a project. +Get details about a server by its ID. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param publicIpId The identifier (ID) of a Public IP. - @return ApiGetPublicIPRequest + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerRequest */ -func (a *APIClient) GetPublicIP(ctx context.Context, projectId string, publicIpId string) ApiGetPublicIPRequest { - return GetPublicIPRequest{ +func (a *APIClient) GetServer(ctx context.Context, projectId string, region string, serverId string) ApiGetServerRequest { + return GetServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - publicIpId: publicIpId, + region: region, + serverId: serverId, } } -func (a *APIClient) GetPublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, error) { - r := GetPublicIPRequest{ +func (a *APIClient) GetServerExecute(ctx context.Context, projectId string, region string, serverId string) (*Server, error) { + r := GetServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - publicIpId: publicIpId, + region: region, + serverId: serverId, } return r.Execute() } -type GetSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string +type GetServerConsoleRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + serverId string } -func (r GetSecurityGroupRequest) Execute() (*SecurityGroup, error) { +func (r GetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroup + localVarReturnValue *ServerConsoleUrl ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSecurityGroup") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerConsole") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/console" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -13993,11 +17286,11 @@ func (r GetSecurityGroupRequest) Execute() (*SecurityGroup, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.securityGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } // to determine the Content-Type header @@ -14120,63 +17413,74 @@ func (r GetSecurityGroupRequest) Execute() (*SecurityGroup, error) { } /* -GetSecurityGroup: Get security group details. +GetServerConsole: Get server console. -Get details about a security group of a project. +Get a URL for server remote console. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiGetSecurityGroupRequest + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerConsoleRequest */ -func (a *APIClient) GetSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiGetSecurityGroupRequest { - return GetSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) GetServerConsole(ctx context.Context, projectId string, region string, serverId string) ApiGetServerConsoleRequest { + return GetServerConsoleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, } } -func (a *APIClient) GetSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) { - r := GetSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) GetServerConsoleExecute(ctx context.Context, projectId string, region string, serverId string) (*ServerConsoleUrl, error) { + r := GetServerConsoleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, } return r.Execute() } -type GetSecurityGroupRuleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string - securityGroupRuleId string +type GetServerLogRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + serverId string + length *int64 } -func (r GetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { +// Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. + +func (r GetServerLogRequest) Length(length int64) ApiGetServerLogRequest { + r.length = &length + return r +} + +func (r GetServerLogRequest) Execute() (*GetServerLog200Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroupRule + localVarReturnValue *GetServerLog200Response ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSecurityGroupRule") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerLog") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/log" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -14187,19 +17491,16 @@ func (r GetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") - } - if strlen(r.securityGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") - } - if strlen(r.securityGroupRuleId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupRuleId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.securityGroupRuleId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupRuleId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } + if r.length != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "length", r.length, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -14320,72 +17621,66 @@ func (r GetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { } /* -GetSecurityGroupRule: Get security group rule details. +GetServerLog: Get server log. -Get details about a security group rule of a project. +Get server console log. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. - @return ApiGetSecurityGroupRuleRequest + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerLogRequest */ -func (a *APIClient) GetSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest { - return GetSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, +func (a *APIClient) GetServerLog(ctx context.Context, projectId string, region string, serverId string) ApiGetServerLogRequest { + return GetServerLogRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, } } -func (a *APIClient) GetSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) (*SecurityGroupRule, error) { - r := GetSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, +func (a *APIClient) GetServerLogExecute(ctx context.Context, projectId string, region string, serverId string) (*GetServerLog200Response, error) { + r := GetServerLogRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, } return r.Execute() } -type GetServerRequest struct { +type GetSnapshotRequest struct { ctx context.Context apiService *DefaultApiService projectId string - serverId string - details *bool -} - -// Show detailed information about server. - -func (r GetServerRequest) Details(details bool) ApiGetServerRequest { - r.details = &details - return r + region string + snapshotId string } -func (r GetServerRequest) Execute() (*Server, error) { +func (r GetSnapshotRequest) Execute() (*Snapshot, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Server + localVarReturnValue *Snapshot ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServer") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSnapshot") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(r.snapshotId, "snapshotId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -14396,16 +17691,13 @@ func (r GetServerRequest) Execute() (*Server, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") + if strlen(r.snapshotId) < 36 { + return localVarReturnValue, fmt.Errorf("snapshotId must have at least 36 elements") } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.snapshotId) > 36 { + return localVarReturnValue, fmt.Errorf("snapshotId must have less than 36 elements") } - if r.details != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -14526,61 +17818,66 @@ func (r GetServerRequest) Execute() (*Server, error) { } /* -GetServer: Get server details. +GetSnapshot: Get details about a snapshot. -Get details about a server by its ID. +Get details about a block device snapshot. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerRequest + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiGetSnapshotRequest */ -func (a *APIClient) GetServer(ctx context.Context, projectId string, serverId string) ApiGetServerRequest { - return GetServerRequest{ +func (a *APIClient) GetSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiGetSnapshotRequest { + return GetSnapshotRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + region: region, + snapshotId: snapshotId, } } -func (a *APIClient) GetServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { - r := GetServerRequest{ +func (a *APIClient) GetSnapshotExecute(ctx context.Context, projectId string, region string, snapshotId string) (*Snapshot, error) { + r := GetSnapshotRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + region: region, + snapshotId: snapshotId, } return r.Execute() } -type GetServerConsoleRequest struct { +type GetVolumeRequest struct { ctx context.Context apiService *DefaultApiService projectId string - serverId string + region string + volumeId string } -func (r GetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { +func (r GetVolumeRequest) Execute() (*Volume, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ServerConsoleUrl + localVarReturnValue *Volume ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerConsole") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVolume") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/console" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -14591,11 +17888,11 @@ func (r GetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") + if strlen(r.volumeId) < 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.volumeId) > 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") } // to determine the Content-Type header @@ -14718,69 +18015,66 @@ func (r GetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { } /* -GetServerConsole: Get server console. +GetVolume: Get details about a volume. -Get a URL for server remote console. +Get details about a block device volume. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerConsoleRequest + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetVolumeRequest */ -func (a *APIClient) GetServerConsole(ctx context.Context, projectId string, serverId string) ApiGetServerConsoleRequest { - return GetServerConsoleRequest{ +func (a *APIClient) GetVolume(ctx context.Context, projectId string, region string, volumeId string) ApiGetVolumeRequest { + return GetVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + region: region, + volumeId: volumeId, } } -func (a *APIClient) GetServerConsoleExecute(ctx context.Context, projectId string, serverId string) (*ServerConsoleUrl, error) { - r := GetServerConsoleRequest{ +func (a *APIClient) GetVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) (*Volume, error) { + r := GetVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + region: region, + volumeId: volumeId, } return r.Execute() } -type GetServerLogRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - length *int64 -} - -// Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. - -func (r GetServerLogRequest) Length(length int64) ApiGetServerLogRequest { - r.length = &length - return r +type GetVolumePerformanceClassRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + volumePerformanceClass string } -func (r GetServerLogRequest) Execute() (*GetServerLog200Response, error) { +func (r GetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetServerLog200Response + localVarReturnValue *VolumePerformanceClass ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerLog") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVolumePerformanceClass") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/log" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volume-performance-classes/{volumePerformanceClass}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(r.volumePerformanceClass, "volumePerformanceClass")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -14791,16 +18085,10 @@ func (r GetServerLogRequest) Execute() (*GetServerLog200Response, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") - } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.volumePerformanceClass) > 127 { + return localVarReturnValue, fmt.Errorf("volumePerformanceClass must have less than 127 elements") } - if r.length != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "length", r.length, "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -14921,61 +18209,64 @@ func (r GetServerLogRequest) Execute() (*GetServerLog200Response, error) { } /* -GetServerLog: Get server log. +GetVolumePerformanceClass: Get details about a volume performance class. -Get server console log. +Get details about a specific volume performance class. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerLogRequest + @param region The STACKIT Region of the resources. + @param volumePerformanceClass The name of a STACKIT Volume performance class. + @return ApiGetVolumePerformanceClassRequest */ -func (a *APIClient) GetServerLog(ctx context.Context, projectId string, serverId string) ApiGetServerLogRequest { - return GetServerLogRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) GetVolumePerformanceClass(ctx context.Context, projectId string, region string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest { + return GetVolumePerformanceClassRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + volumePerformanceClass: volumePerformanceClass, } } -func (a *APIClient) GetServerLogExecute(ctx context.Context, projectId string, serverId string) (*GetServerLog200Response, error) { - r := GetServerLogRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) GetVolumePerformanceClassExecute(ctx context.Context, projectId string, region string, volumePerformanceClass string) (*VolumePerformanceClass, error) { + r := GetVolumePerformanceClassRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + volumePerformanceClass: volumePerformanceClass, } return r.Execute() } -type GetSnapshotRequest struct { +type ListAffinityGroupsRequest struct { ctx context.Context apiService *DefaultApiService projectId string - snapshotId string + region string } -func (r GetSnapshotRequest) Execute() (*Snapshot, error) { +func (r ListAffinityGroupsRequest) Execute() (*AffinityGroupListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Snapshot + localVarReturnValue *AffinityGroupListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSnapshot") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAffinityGroups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/snapshots/{snapshotId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/affinity-groups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(r.snapshotId, "snapshotId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -14986,12 +18277,6 @@ func (r GetSnapshotRequest) Execute() (*Snapshot, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.snapshotId) < 36 { - return localVarReturnValue, fmt.Errorf("snapshotId must have at least 36 elements") - } - if strlen(r.snapshotId) > 36 { - return localVarReturnValue, fmt.Errorf("snapshotId must have less than 36 elements") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -15086,6 +18371,17 @@ func (r GetSnapshotRequest) Execute() (*Snapshot, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -15113,61 +18409,63 @@ func (r GetSnapshotRequest) Execute() (*Snapshot, error) { } /* -GetSnapshot: Get details about a snapshot. +ListAffinityGroups: Get the affinity groups setup for a project. -Get details about a block device snapshot. +Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param snapshotId The identifier (ID) of a STACKIT Snapshot. - @return ApiGetSnapshotRequest + @param region The STACKIT Region of the resources. + @return ApiListAffinityGroupsRequest */ -func (a *APIClient) GetSnapshot(ctx context.Context, projectId string, snapshotId string) ApiGetSnapshotRequest { - return GetSnapshotRequest{ +func (a *APIClient) ListAffinityGroups(ctx context.Context, projectId string, region string) ApiListAffinityGroupsRequest { + return ListAffinityGroupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - snapshotId: snapshotId, + region: region, } } -func (a *APIClient) GetSnapshotExecute(ctx context.Context, projectId string, snapshotId string) (*Snapshot, error) { - r := GetSnapshotRequest{ +func (a *APIClient) ListAffinityGroupsExecute(ctx context.Context, projectId string, region string) (*AffinityGroupListResponse, error) { + r := ListAffinityGroupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - snapshotId: snapshotId, + region: region, } return r.Execute() } -type GetVolumeRequest struct { +type ListAttachedVolumesRequest struct { ctx context.Context apiService *DefaultApiService projectId string - volumeId string + region string + serverId string } -func (r GetVolumeRequest) Execute() (*Volume, error) { +func (r ListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Volume + localVarReturnValue *VolumeAttachmentListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVolume") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAttachedVolumes") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/volumes/{volumeId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -15178,11 +18476,11 @@ func (r GetVolumeRequest) Execute() (*Volume, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.volumeId) < 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.volumeId) > 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } // to determine the Content-Type header @@ -15305,74 +18603,66 @@ func (r GetVolumeRequest) Execute() (*Volume, error) { } /* -GetVolume: Get details about a volume. +ListAttachedVolumes: List all volume attachments of a server. -Get details about a block device volume. +Get a list of all volume attachments of a server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param volumeId The identifier (ID) of a STACKIT Volume. - @return ApiGetVolumeRequest + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListAttachedVolumesRequest */ -func (a *APIClient) GetVolume(ctx context.Context, projectId string, volumeId string) ApiGetVolumeRequest { - return GetVolumeRequest{ +func (a *APIClient) ListAttachedVolumes(ctx context.Context, projectId string, region string, serverId string) ApiListAttachedVolumesRequest { + return ListAttachedVolumesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + region: region, + serverId: serverId, } } -func (a *APIClient) GetVolumeExecute(ctx context.Context, projectId string, volumeId string) (*Volume, error) { - r := GetVolumeRequest{ +func (a *APIClient) ListAttachedVolumesExecute(ctx context.Context, projectId string, region string, serverId string) (*VolumeAttachmentListResponse, error) { + r := ListAttachedVolumesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + region: region, + serverId: serverId, } return r.Execute() } -type GetVolumePerformanceClassRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - volumePerformanceClass string +type ListAvailabilityZonesRequest struct { + ctx context.Context + apiService *DefaultApiService + region string } -func (r GetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, error) { +func (r ListAvailabilityZonesRequest) Execute() (*AvailabilityZoneListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VolumePerformanceClass + localVarReturnValue *AvailabilityZoneListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVolumePerformanceClass") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAvailabilityZones") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(r.volumePerformanceClass, "volumePerformanceClass")), -1) + localVarPath := localBasePath + "/v2/regions/{region}/availability-zones" + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.volumePerformanceClass) > 127 { - return localVarReturnValue, fmt.Errorf("volumePerformanceClass must have less than 127 elements") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -15494,59 +18784,66 @@ func (r GetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, er } /* -GetVolumePerformanceClass: Get details about a volume performance class. +ListAvailabilityZones: List all availability zones. -Get details about a specific volume performance class. +Get a list of all availability zones. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param volumePerformanceClass The name of a STACKIT Volume performance class. - @return ApiGetVolumePerformanceClassRequest + @param region The STACKIT Region of the resources. + @return ApiListAvailabilityZonesRequest */ -func (a *APIClient) GetVolumePerformanceClass(ctx context.Context, projectId string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest { - return GetVolumePerformanceClassRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumePerformanceClass: volumePerformanceClass, +func (a *APIClient) ListAvailabilityZones(ctx context.Context, region string) ApiListAvailabilityZonesRequest { + return ListAvailabilityZonesRequest{ + apiService: a.defaultApi, + ctx: ctx, + region: region, } } -func (a *APIClient) GetVolumePerformanceClassExecute(ctx context.Context, projectId string, volumePerformanceClass string) (*VolumePerformanceClass, error) { - r := GetVolumePerformanceClassRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumePerformanceClass: volumePerformanceClass, +func (a *APIClient) ListAvailabilityZonesExecute(ctx context.Context, region string) (*AvailabilityZoneListResponse, error) { + r := ListAvailabilityZonesRequest{ + apiService: a.defaultApi, + ctx: ctx, + region: region, } return r.Execute() } -type ListAffinityGroupsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string +type ListBackupsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + labelSelector *string } -func (r ListAffinityGroupsRequest) Execute() (*AffinityGroupListResponse, error) { +// Filter resources by labels. + +func (r ListBackupsRequest) LabelSelector(labelSelector string) ApiListBackupsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ListBackupsRequest) Execute() (*BackupListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AffinityGroupListResponse + localVarReturnValue *BackupListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAffinityGroups") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListBackups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/affinity-groups" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -15558,6 +18855,9 @@ func (r ListAffinityGroupsRequest) Execute() (*AffinityGroupListResponse, error) return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -15640,18 +18940,7 @@ func (r ListAffinityGroupsRequest) Execute() (*AffinityGroupListResponse, error) newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 404 { - var v Error - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 409 { + if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -15689,58 +18978,77 @@ func (r ListAffinityGroupsRequest) Execute() (*AffinityGroupListResponse, error) } /* -ListAffinityGroups: Get the affinity groups setup for a project. +ListBackups: List all backups inside a project. -Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). +Get a list of all backups inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListAffinityGroupsRequest + @param region The STACKIT Region of the resources. + @return ApiListBackupsRequest */ -func (a *APIClient) ListAffinityGroups(ctx context.Context, projectId string) ApiListAffinityGroupsRequest { - return ListAffinityGroupsRequest{ +func (a *APIClient) ListBackups(ctx context.Context, projectId string, region string) ApiListBackupsRequest { + return ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListAffinityGroupsExecute(ctx context.Context, projectId string) (*AffinityGroupListResponse, error) { - r := ListAffinityGroupsRequest{ +func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, region string) (*BackupListResponse, error) { + r := ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } -type ListAttachedVolumesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type ListImagesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + all *bool + labelSelector *string } -func (r ListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, error) { +// List all Images. + +func (r ListImagesRequest) All(all bool) ApiListImagesRequest { + r.all = &all + return r +} + +// Filter resources by labels. + +func (r ListImagesRequest) LabelSelector(labelSelector string) ApiListImagesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ListImagesRequest) Execute() (*ImageListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VolumeAttachmentListResponse + localVarReturnValue *ImageListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAttachedVolumes") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListImages") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -15751,13 +19059,13 @@ func (r ListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, er if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") + + if r.all != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "all", r.all, "") } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") } - // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -15878,62 +19186,73 @@ func (r ListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, er } /* -ListAttachedVolumes: List all volume attachments of a server. +ListImages: List all Images inside a project. -Get a list of all volume attachments of a server. +Get a list of all images inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiListAttachedVolumesRequest + @param region The STACKIT Region of the resources. + @return ApiListImagesRequest */ -func (a *APIClient) ListAttachedVolumes(ctx context.Context, projectId string, serverId string) ApiListAttachedVolumesRequest { - return ListAttachedVolumesRequest{ +func (a *APIClient) ListImages(ctx context.Context, projectId string, region string) ApiListImagesRequest { + return ListImagesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + region: region, } } -func (a *APIClient) ListAttachedVolumesExecute(ctx context.Context, projectId string, serverId string) (*VolumeAttachmentListResponse, error) { - r := ListAttachedVolumesRequest{ +func (a *APIClient) ListImagesExecute(ctx context.Context, projectId string, region string) (*ImageListResponse, error) { + r := ListImagesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + region: region, } return r.Execute() } -type ListAvailabilityZonesRequest struct { - ctx context.Context - apiService *DefaultApiService +type ListKeyPairsRequest struct { + ctx context.Context + apiService *DefaultApiService + labelSelector *string } -func (r ListAvailabilityZonesRequest) Execute() (*AvailabilityZoneListResponse, error) { +// Filter resources by labels. + +func (r ListKeyPairsRequest) LabelSelector(labelSelector string) ApiListKeyPairsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AvailabilityZoneListResponse + localVarReturnValue *KeyPairListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAvailabilityZones") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListKeyPairs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/availability-zones" + localVarPath := localBasePath + "/v2/keypairs" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -16054,61 +19373,63 @@ func (r ListAvailabilityZonesRequest) Execute() (*AvailabilityZoneListResponse, } /* -ListAvailabilityZones: List all availability zones. +ListKeyPairs: List all SSH keypairs for the requesting user. -Get a list of all availability zones. +Get a list of all SSH keypairs assigned to the requesting user. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListAvailabilityZonesRequest + @return ApiListKeyPairsRequest */ -func (a *APIClient) ListAvailabilityZones(ctx context.Context) ApiListAvailabilityZonesRequest { - return ListAvailabilityZonesRequest{ +func (a *APIClient) ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest { + return ListKeyPairsRequest{ apiService: a.defaultApi, ctx: ctx, } } -func (a *APIClient) ListAvailabilityZonesExecute(ctx context.Context) (*AvailabilityZoneListResponse, error) { - r := ListAvailabilityZonesRequest{ +func (a *APIClient) ListKeyPairsExecute(ctx context.Context) (*KeyPairListResponse, error) { + r := ListKeyPairsRequest{ apiService: a.defaultApi, ctx: ctx, } return r.Execute() } -type ListBackupsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string +type ListMachineTypesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + filter *string } -// Filter resources by labels. +// Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. -func (r ListBackupsRequest) LabelSelector(labelSelector string) ApiListBackupsRequest { - r.labelSelector = &labelSelector +func (r ListMachineTypesRequest) Filter(filter string) ApiListMachineTypesRequest { + r.filter = &filter return r } -func (r ListBackupsRequest) Execute() (*BackupListResponse, error) { +func (r ListMachineTypesRequest) Execute() (*MachineTypeListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *BackupListResponse + localVarReturnValue *MachineTypeListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListBackups") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListMachineTypes") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/backups" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/machine-types" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -16120,8 +19441,8 @@ func (r ListBackupsRequest) Execute() (*BackupListResponse, error) { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -16243,89 +19564,78 @@ func (r ListBackupsRequest) Execute() (*BackupListResponse, error) { } /* -ListBackups: List all backups inside a project. +ListMachineTypes: List all machine types available for a project. -Get a list of all backups inside a project. +Get a list of all machine type available in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListBackupsRequest + @param region The STACKIT Region of the resources. + @return ApiListMachineTypesRequest */ -func (a *APIClient) ListBackups(ctx context.Context, projectId string) ApiListBackupsRequest { - return ListBackupsRequest{ +func (a *APIClient) ListMachineTypes(ctx context.Context, projectId string, region string) ApiListMachineTypesRequest { + return ListMachineTypesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string) (*BackupListResponse, error) { - r := ListBackupsRequest{ +func (a *APIClient) ListMachineTypesExecute(ctx context.Context, projectId string, region string) (*MachineTypeListResponse, error) { + r := ListMachineTypesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } -type ListImagesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - all *bool - labelSelector *string -} - -// List all Images. - -func (r ListImagesRequest) All(all bool) ApiListImagesRequest { - r.all = &all - return r -} - -// Filter resources by labels. - -func (r ListImagesRequest) LabelSelector(labelSelector string) ApiListImagesRequest { - r.labelSelector = &labelSelector - return r +type ListNetworkAreaProjectsRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string } -func (r ListImagesRequest) Execute() (*ImageListResponse, error) { +func (r ListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ImageListResponse + localVarReturnValue *ProjectListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListImages") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreaProjects") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/images" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/projects" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - - if r.all != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "all", r.all, "") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -16446,70 +19756,80 @@ func (r ListImagesRequest) Execute() (*ImageListResponse, error) { } /* -ListImages: List all Images inside a project. +ListNetworkAreaProjects: List all projects using a network area. -Get a list of all images inside a project. +Get a list of all projects using a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListImagesRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaProjectsRequest */ -func (a *APIClient) ListImages(ctx context.Context, projectId string) ApiListImagesRequest { - return ListImagesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest { + return ListNetworkAreaProjectsRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } } -func (a *APIClient) ListImagesExecute(ctx context.Context, projectId string) (*ImageListResponse, error) { - r := ListImagesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListNetworkAreaProjectsExecute(ctx context.Context, organizationId string, areaId string) (*ProjectListResponse, error) { + r := ListNetworkAreaProjectsRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } return r.Execute() } -type ListKeyPairsRequest struct { - ctx context.Context - apiService *DefaultApiService - labelSelector *string -} - -// Filter resources by labels. - -func (r ListKeyPairsRequest) LabelSelector(labelSelector string) ApiListKeyPairsRequest { - r.labelSelector = &labelSelector - return r +type ListNetworkAreaRangesRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string } -func (r ListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { +func (r ListNetworkAreaRangesRequest) Execute() (*NetworkRangeListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *KeyPairListResponse + localVarReturnValue *NetworkRangeListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListKeyPairs") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreaRanges") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/keypairs" + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -16630,75 +19950,81 @@ func (r ListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { } /* -ListKeyPairs: List all SSH keypairs for the requesting user. +ListNetworkAreaRanges: List all network ranges in a network area. -Get a list of all SSH keypairs assigned to the requesting user. +Get a list of all network ranges in a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListKeyPairsRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListNetworkAreaRangesRequest */ -func (a *APIClient) ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest { - return ListKeyPairsRequest{ - apiService: a.defaultApi, - ctx: ctx, +func (a *APIClient) ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRangesRequest { + return ListNetworkAreaRangesRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } } -func (a *APIClient) ListKeyPairsExecute(ctx context.Context) (*KeyPairListResponse, error) { - r := ListKeyPairsRequest{ - apiService: a.defaultApi, - ctx: ctx, +func (a *APIClient) ListNetworkAreaRangesExecute(ctx context.Context, organizationId string, areaId string, region string) (*NetworkRangeListResponse, error) { + r := ListNetworkAreaRangesRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } return r.Execute() } -type ListMachineTypesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - filter *string -} - -// Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. - -func (r ListMachineTypesRequest) Filter(filter string) ApiListMachineTypesRequest { - r.filter = &filter - return r +type ListNetworkAreaRegionsRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string } -func (r ListMachineTypesRequest) Execute() (*MachineTypeListResponse, error) { +func (r ListNetworkAreaRegionsRequest) Execute() (*RegionalAreaListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *MachineTypeListResponse + localVarReturnValue *RegionalAreaListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListMachineTypes") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreaRegions") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/machine-types" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - - if r.filter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -16819,58 +20145,71 @@ func (r ListMachineTypesRequest) Execute() (*MachineTypeListResponse, error) { } /* -ListMachineTypes: List all machine types available for a project. +ListNetworkAreaRegions: List all configured regions in a network area. -Get a list of all machine type available in a project. +Get a list of all configured regions. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListMachineTypesRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaRegionsRequest */ -func (a *APIClient) ListMachineTypes(ctx context.Context, projectId string) ApiListMachineTypesRequest { - return ListMachineTypesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListNetworkAreaRegions(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRegionsRequest { + return ListNetworkAreaRegionsRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } } -func (a *APIClient) ListMachineTypesExecute(ctx context.Context, projectId string) (*MachineTypeListResponse, error) { - r := ListMachineTypesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListNetworkAreaRegionsExecute(ctx context.Context, organizationId string, areaId string) (*RegionalAreaListResponse, error) { + r := ListNetworkAreaRegionsRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } return r.Execute() } -type ListNetworkAreaProjectsRequest struct { +type ListNetworkAreaRoutesRequest struct { ctx context.Context apiService *DefaultApiService organizationId string areaId string + region string + labelSelector *string } -func (r ListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) { +// Filter resources by labels. + +func (r ListNetworkAreaRoutesRequest) LabelSelector(labelSelector string) ApiListNetworkAreaRoutesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ListNetworkAreaRoutesRequest) Execute() (*RouteListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ProjectListResponse + localVarReturnValue *RouteListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreaProjects") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreaRoutes") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/projects" + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes" localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -16888,6 +20227,9 @@ func (r ListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -17008,61 +20350,70 @@ func (r ListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) } /* -ListNetworkAreaProjects: List all projects using a network area. +ListNetworkAreaRoutes: List all network routes in a network area. -Get a list of all projects using a network area. +Get a list of all network routes defined in a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiListNetworkAreaProjectsRequest + @param region The STACKIT Region of the resources. + @return ApiListNetworkAreaRoutesRequest */ -func (a *APIClient) ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest { - return ListNetworkAreaProjectsRequest{ +func (a *APIClient) ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRoutesRequest { + return ListNetworkAreaRoutesRequest{ apiService: a.defaultApi, ctx: ctx, organizationId: organizationId, areaId: areaId, + region: region, } } -func (a *APIClient) ListNetworkAreaProjectsExecute(ctx context.Context, organizationId string, areaId string) (*ProjectListResponse, error) { - r := ListNetworkAreaProjectsRequest{ +func (a *APIClient) ListNetworkAreaRoutesExecute(ctx context.Context, organizationId string, areaId string, region string) (*RouteListResponse, error) { + r := ListNetworkAreaRoutesRequest{ apiService: a.defaultApi, ctx: ctx, organizationId: organizationId, areaId: areaId, + region: region, } return r.Execute() } -type ListNetworkAreaRangesRequest struct { +type ListNetworkAreasRequest struct { ctx context.Context apiService *DefaultApiService organizationId string - areaId string + labelSelector *string } -func (r ListNetworkAreaRangesRequest) Execute() (*NetworkRangeListResponse, error) { +// Filter resources by labels. + +func (r ListNetworkAreasRequest) LabelSelector(labelSelector string) ApiListNetworkAreasRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NetworkRangeListResponse + localVarReturnValue *NetworkAreaListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreaRanges") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreas") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas" localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -17073,13 +20424,10 @@ func (r ListNetworkAreaRangesRequest) Execute() (*NetworkRangeListResponse, erro if strlen(r.organizationId) > 36 { return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.areaId) < 36 { - return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") - } - if strlen(r.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") - } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -17200,84 +20548,75 @@ func (r ListNetworkAreaRangesRequest) Execute() (*NetworkRangeListResponse, erro } /* -ListNetworkAreaRanges: List all network ranges in a network area. +ListNetworkAreas: List all network areas in an organization. -Get a list of all network ranges in a network area. +Get a list of all visible network areas defined in an organization. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiListNetworkAreaRangesRequest + @return ApiListNetworkAreasRequest */ -func (a *APIClient) ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRangesRequest { - return ListNetworkAreaRangesRequest{ +func (a *APIClient) ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest { + return ListNetworkAreasRequest{ apiService: a.defaultApi, ctx: ctx, organizationId: organizationId, - areaId: areaId, } } -func (a *APIClient) ListNetworkAreaRangesExecute(ctx context.Context, organizationId string, areaId string) (*NetworkRangeListResponse, error) { - r := ListNetworkAreaRangesRequest{ +func (a *APIClient) ListNetworkAreasExecute(ctx context.Context, organizationId string) (*NetworkAreaListResponse, error) { + r := ListNetworkAreasRequest{ apiService: a.defaultApi, ctx: ctx, organizationId: organizationId, - areaId: areaId, } return r.Execute() } -type ListNetworkAreaRoutesRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - labelSelector *string +type ListNetworksRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + labelSelector *string } // Filter resources by labels. -func (r ListNetworkAreaRoutesRequest) LabelSelector(labelSelector string) ApiListNetworkAreaRoutesRequest { +func (r ListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { r.labelSelector = &labelSelector return r } -func (r ListNetworkAreaRoutesRequest) Execute() (*RouteListResponse, error) { +func (r ListNetworksRequest) Execute() (*NetworkListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *RouteListResponse + localVarReturnValue *NetworkListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreaRoutes") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } if r.labelSelector != nil { @@ -17403,76 +20742,86 @@ func (r ListNetworkAreaRoutesRequest) Execute() (*RouteListResponse, error) { } /* -ListNetworkAreaRoutes: List all network routes in a network area. +ListNetworks: List all networks inside a project. -Get a list of all network routes defined in a network area. +Get a list of all networks inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiListNetworkAreaRoutesRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListNetworksRequest */ -func (a *APIClient) ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRoutesRequest { - return ListNetworkAreaRoutesRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest { + return ListNetworksRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, } } -func (a *APIClient) ListNetworkAreaRoutesExecute(ctx context.Context, organizationId string, areaId string) (*RouteListResponse, error) { - r := ListNetworkAreaRoutesRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) ListNetworksExecute(ctx context.Context, projectId string, region string) (*NetworkListResponse, error) { + r := ListNetworksRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, } return r.Execute() } -type ListNetworkAreasRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - labelSelector *string +type ListNicsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + networkId string + labelSelector *string } // Filter resources by labels. -func (r ListNetworkAreasRequest) LabelSelector(labelSelector string) ApiListNetworkAreasRequest { +func (r ListNicsRequest) LabelSelector(labelSelector string) ApiListNicsRequest { r.labelSelector = &labelSelector return r } -func (r ListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) { +func (r ListNicsRequest) Execute() (*NICListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NetworkAreaListResponse + localVarReturnValue *NICListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreas") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNics") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") } if r.labelSelector != nil { @@ -17598,64 +20947,72 @@ func (r ListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) { } /* -ListNetworkAreas: List all network areas in an organization. +ListNics: List all network interfaces inside a network. -Get a list of all visible network areas defined in an organization. +Get a list of all network interfaces inside a network. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @return ApiListNetworkAreasRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiListNicsRequest */ -func (a *APIClient) ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest { - return ListNetworkAreasRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, +func (a *APIClient) ListNics(ctx context.Context, projectId string, region string, networkId string) ApiListNicsRequest { + return ListNicsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, } } -func (a *APIClient) ListNetworkAreasExecute(ctx context.Context, organizationId string) (*NetworkAreaListResponse, error) { - r := ListNetworkAreasRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, +func (a *APIClient) ListNicsExecute(ctx context.Context, projectId string, region string, networkId string) (*NICListResponse, error) { + r := ListNicsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, } return r.Execute() } -type ListNetworksRequest struct { +type ListProjectNICsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string labelSelector *string } // Filter resources by labels. -func (r ListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { +func (r ListProjectNICsRequest) LabelSelector(labelSelector string) ApiListProjectNICsRequest { r.labelSelector = &labelSelector return r } -func (r ListNetworksRequest) Execute() (*NetworkListResponse, error) { +func (r ListProjectNICsRequest) Execute() (*NICListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NetworkListResponse + localVarReturnValue *NICListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworks") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListProjectNICs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/networks" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/nics" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -17790,86 +21147,62 @@ func (r ListNetworksRequest) Execute() (*NetworkListResponse, error) { } /* -ListNetworks: List all networks inside a project. +ListProjectNICs: List all network interfaces inside a project. -Get a list of all networks inside a project. +Get a list of all network interfaces inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListNetworksRequest + @param region The STACKIT Region of the resources. + @return ApiListProjectNICsRequest */ -func (a *APIClient) ListNetworks(ctx context.Context, projectId string) ApiListNetworksRequest { - return ListNetworksRequest{ +func (a *APIClient) ListProjectNICs(ctx context.Context, projectId string, region string) ApiListProjectNICsRequest { + return ListProjectNICsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListNetworksExecute(ctx context.Context, projectId string) (*NetworkListResponse, error) { - r := ListNetworksRequest{ +func (a *APIClient) ListProjectNICsExecute(ctx context.Context, projectId string, region string) (*NICListResponse, error) { + r := ListProjectNICsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } -type ListNicsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ListNicsRequest) LabelSelector(labelSelector string) ApiListNicsRequest { - r.labelSelector = &labelSelector - return r +type ListPublicIPRangesRequest struct { + ctx context.Context + apiService *DefaultApiService } -func (r ListNicsRequest) Execute() (*NICListResponse, error) { +func (r ListPublicIPRangesRequest) Execute() (*PublicNetworkListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NICListResponse + localVarReturnValue *PublicNetworkListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNics") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPublicIPRanges") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}/nics" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath := localBasePath + "/v2/networks/public-ip-ranges" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") - } - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -17990,67 +21323,63 @@ func (r ListNicsRequest) Execute() (*NICListResponse, error) { } /* -ListNics: List all network interfaces inside a network. +ListPublicIPRanges: List all public IP ranges. -Get a list of all network interfaces inside a network. +Get a list of all public IP ranges that STACKIT uses. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiListNicsRequest + @return ApiListPublicIPRangesRequest */ -func (a *APIClient) ListNics(ctx context.Context, projectId string, networkId string) ApiListNicsRequest { - return ListNicsRequest{ +func (a *APIClient) ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest { + return ListPublicIPRangesRequest{ apiService: a.defaultApi, ctx: ctx, - projectId: projectId, - networkId: networkId, } } -func (a *APIClient) ListNicsExecute(ctx context.Context, projectId string, networkId string) (*NICListResponse, error) { - r := ListNicsRequest{ +func (a *APIClient) ListPublicIPRangesExecute(ctx context.Context) (*PublicNetworkListResponse, error) { + r := ListPublicIPRangesRequest{ apiService: a.defaultApi, ctx: ctx, - projectId: projectId, - networkId: networkId, } return r.Execute() } -type ListProjectNICsRequest struct { +type ListPublicIPsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string labelSelector *string } // Filter resources by labels. -func (r ListProjectNICsRequest) LabelSelector(labelSelector string) ApiListProjectNICsRequest { +func (r ListPublicIPsRequest) LabelSelector(labelSelector string) ApiListPublicIPsRequest { r.labelSelector = &labelSelector return r } -func (r ListProjectNICsRequest) Execute() (*NICListResponse, error) { +func (r ListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NICListResponse + localVarReturnValue *PublicIpListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListProjectNICs") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPublicIPs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/nics" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/public-ips" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -18185,58 +21514,71 @@ func (r ListProjectNICsRequest) Execute() (*NICListResponse, error) { } /* -ListProjectNICs: List all network interfaces inside a project. +ListPublicIPs: List all public IPs inside a project. -Get a list of all network interfaces inside a project. +Get a list of all public IPs inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListProjectNICsRequest + @param region The STACKIT Region of the resources. + @return ApiListPublicIPsRequest */ -func (a *APIClient) ListProjectNICs(ctx context.Context, projectId string) ApiListProjectNICsRequest { - return ListProjectNICsRequest{ +func (a *APIClient) ListPublicIPs(ctx context.Context, projectId string, region string) ApiListPublicIPsRequest { + return ListPublicIPsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListProjectNICsExecute(ctx context.Context, projectId string) (*NICListResponse, error) { - r := ListProjectNICsRequest{ +func (a *APIClient) ListPublicIPsExecute(ctx context.Context, projectId string, region string) (*PublicIpListResponse, error) { + r := ListPublicIPsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } -type ListPublicIPRangesRequest struct { +type ListQuotasRequest struct { ctx context.Context apiService *DefaultApiService + projectId string + region string } -func (r ListPublicIPRangesRequest) Execute() (*PublicNetworkListResponse, error) { +func (r ListQuotasRequest) Execute() (*QuotaListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PublicNetworkListResponse + localVarReturnValue *QuotaListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPublicIPRanges") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListQuotas") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/networks/public-ip-ranges" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/quotas" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -18358,70 +21700,94 @@ func (r ListPublicIPRangesRequest) Execute() (*PublicNetworkListResponse, error) } /* -ListPublicIPRanges: List all public IP ranges. +ListQuotas: List project quotas. -Get a list of all public IP ranges that STACKIT uses. +List quota limits and usage for project resources. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListPublicIPRangesRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListQuotasRequest */ -func (a *APIClient) ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest { - return ListPublicIPRangesRequest{ +func (a *APIClient) ListQuotas(ctx context.Context, projectId string, region string) ApiListQuotasRequest { + return ListQuotasRequest{ apiService: a.defaultApi, ctx: ctx, + projectId: projectId, + region: region, } } -func (a *APIClient) ListPublicIPRangesExecute(ctx context.Context) (*PublicNetworkListResponse, error) { - r := ListPublicIPRangesRequest{ +func (a *APIClient) ListQuotasExecute(ctx context.Context, projectId string, region string) (*QuotaListResponse, error) { + r := ListQuotasRequest{ apiService: a.defaultApi, ctx: ctx, + projectId: projectId, + region: region, } return r.Execute() } -type ListPublicIPsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string +type ListRoutesOfRoutingTableRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string + labelSelector *string } // Filter resources by labels. -func (r ListPublicIPsRequest) LabelSelector(labelSelector string) ApiListPublicIPsRequest { +func (r ListRoutesOfRoutingTableRequest) LabelSelector(labelSelector string) ApiListRoutesOfRoutingTableRequest { r.labelSelector = &labelSelector return r } -func (r ListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { +func (r ListRoutesOfRoutingTableRequest) Execute() (*RouteListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PublicIpListResponse + localVarReturnValue *RouteListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPublicIPs") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListRoutesOfRoutingTable") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/public-ips" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(r.routingTableId, "routingTableId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have less than 36 elements") } if r.labelSelector != nil { @@ -18547,67 +21913,97 @@ func (r ListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { } /* -ListPublicIPs: List all public IPs inside a project. +ListRoutesOfRoutingTable: List all routes in a routing table. -Get a list of all public IPs inside a project. +Get a list of all routes in a routing table. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListPublicIPsRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiListRoutesOfRoutingTableRequest */ -func (a *APIClient) ListPublicIPs(ctx context.Context, projectId string) ApiListPublicIPsRequest { - return ListPublicIPsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest { + return ListRoutesOfRoutingTableRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, } } -func (a *APIClient) ListPublicIPsExecute(ctx context.Context, projectId string) (*PublicIpListResponse, error) { - r := ListPublicIPsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListRoutesOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RouteListResponse, error) { + r := ListRoutesOfRoutingTableRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, } return r.Execute() } -type ListQuotasRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string +type ListRoutingTablesOfAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + labelSelector *string } -func (r ListQuotasRequest) Execute() (*QuotaListResponse, error) { +// Filter resources by labels. + +func (r ListRoutingTablesOfAreaRequest) LabelSelector(labelSelector string) ApiListRoutingTablesOfAreaRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ListRoutingTablesOfAreaRequest) Execute() (*RoutingTableListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *QuotaListResponse + localVarReturnValue *RoutingTableListResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListQuotas") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListRoutingTablesOfArea") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/quotas" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") } - // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -18728,27 +22124,33 @@ func (r ListQuotasRequest) Execute() (*QuotaListResponse, error) { } /* -ListQuotas: List project quotas. +ListRoutingTablesOfArea: List all routing tables in a network area. -List quota limits and usage for project resources. +Get a list of all routing tables in a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListQuotasRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListRoutingTablesOfAreaRequest */ -func (a *APIClient) ListQuotas(ctx context.Context, projectId string) ApiListQuotasRequest { - return ListQuotasRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest { + return ListRoutingTablesOfAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } } -func (a *APIClient) ListQuotasExecute(ctx context.Context, projectId string) (*QuotaListResponse, error) { - r := ListQuotasRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListRoutingTablesOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string) (*RoutingTableListResponse, error) { + r := ListRoutingTablesOfAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } return r.Execute() } @@ -18757,6 +22159,7 @@ type ListSecurityGroupRulesRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string securityGroupId string } @@ -18777,8 +22180,9 @@ func (r ListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListResponse return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) @@ -18923,23 +22327,26 @@ Get a list of all rules inside a security group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiListSecurityGroupRulesRequest */ -func (a *APIClient) ListSecurityGroupRules(ctx context.Context, projectId string, securityGroupId string) ApiListSecurityGroupRulesRequest { +func (a *APIClient) ListSecurityGroupRules(ctx context.Context, projectId string, region string, securityGroupId string) ApiListSecurityGroupRulesRequest { return ListSecurityGroupRulesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, securityGroupId: securityGroupId, } } -func (a *APIClient) ListSecurityGroupRulesExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroupRuleListResponse, error) { +func (a *APIClient) ListSecurityGroupRulesExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroupRuleListResponse, error) { r := ListSecurityGroupRulesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, securityGroupId: securityGroupId, } return r.Execute() @@ -18949,6 +22356,7 @@ type ListSecurityGroupsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string labelSelector *string } @@ -18976,8 +22384,9 @@ func (r ListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, error) return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -19118,33 +22527,37 @@ Get a list of all security groups inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListSecurityGroupsRequest */ -func (a *APIClient) ListSecurityGroups(ctx context.Context, projectId string) ApiListSecurityGroupsRequest { +func (a *APIClient) ListSecurityGroups(ctx context.Context, projectId string, region string) ApiListSecurityGroupsRequest { return ListSecurityGroupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListSecurityGroupsExecute(ctx context.Context, projectId string) (*SecurityGroupListResponse, error) { +func (a *APIClient) ListSecurityGroupsExecute(ctx context.Context, projectId string, region string) (*SecurityGroupListResponse, error) { r := ListSecurityGroupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } -type ListServerNicsRequest struct { +type ListServerNICsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string } -func (r ListServerNicsRequest) Execute() (*NICListResponse, error) { +func (r ListServerNICsRequest) Execute() (*NICListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -19156,13 +22569,14 @@ func (r ListServerNicsRequest) Execute() (*NICListResponse, error) { if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListServerNics") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListServerNICs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/nics" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/nics" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) @@ -19301,29 +22715,32 @@ func (r ListServerNicsRequest) Execute() (*NICListResponse, error) { } /* -ListServerNics: Get all network interfaces. +ListServerNICs: Get all network interfaces. Get all network interfaces attached to the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. - @return ApiListServerNicsRequest + @return ApiListServerNICsRequest */ -func (a *APIClient) ListServerNics(ctx context.Context, projectId string, serverId string) ApiListServerNicsRequest { - return ListServerNicsRequest{ +func (a *APIClient) ListServerNICs(ctx context.Context, projectId string, region string, serverId string) ApiListServerNICsRequest { + return ListServerNICsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } } -func (a *APIClient) ListServerNicsExecute(ctx context.Context, projectId string, serverId string) (*NICListResponse, error) { - r := ListServerNicsRequest{ +func (a *APIClient) ListServerNICsExecute(ctx context.Context, projectId string, region string, serverId string) (*NICListResponse, error) { + r := ListServerNICsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } return r.Execute() @@ -19333,6 +22750,7 @@ type ListServerServiceAccountsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string } @@ -19353,8 +22771,9 @@ func (r ListServerServiceAccountsRequest) Execute() (*ServiceAccountMailListResp return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service-accounts" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) @@ -19499,23 +22918,26 @@ Get the list of the service accounts of the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiListServerServiceAccountsRequest */ -func (a *APIClient) ListServerServiceAccounts(ctx context.Context, projectId string, serverId string) ApiListServerServiceAccountsRequest { +func (a *APIClient) ListServerServiceAccounts(ctx context.Context, projectId string, region string, serverId string) ApiListServerServiceAccountsRequest { return ListServerServiceAccountsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } } -func (a *APIClient) ListServerServiceAccountsExecute(ctx context.Context, projectId string, serverId string) (*ServiceAccountMailListResponse, error) { +func (a *APIClient) ListServerServiceAccountsExecute(ctx context.Context, projectId string, region string, serverId string) (*ServiceAccountMailListResponse, error) { r := ListServerServiceAccountsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } return r.Execute() @@ -19525,6 +22947,7 @@ type ListServersRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string details *bool labelSelector *string } @@ -19560,8 +22983,9 @@ func (r ListServersRequest) Execute() (*ServerListResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -19705,40 +23129,44 @@ Get a list of all servers inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListServersRequest */ -func (a *APIClient) ListServers(ctx context.Context, projectId string) ApiListServersRequest { +func (a *APIClient) ListServers(ctx context.Context, projectId string, region string) ApiListServersRequest { return ListServersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListServersExecute(ctx context.Context, projectId string) (*ServerListResponse, error) { +func (a *APIClient) ListServersExecute(ctx context.Context, projectId string, region string) (*ServerListResponse, error) { r := ListServersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } -type ListSnapshotsRequest struct { +type ListSnapshotsInProjectRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string labelSelector *string } // Filter resources by labels. -func (r ListSnapshotsRequest) LabelSelector(labelSelector string) ApiListSnapshotsRequest { +func (r ListSnapshotsInProjectRequest) LabelSelector(labelSelector string) ApiListSnapshotsInProjectRequest { r.labelSelector = &labelSelector return r } -func (r ListSnapshotsRequest) Execute() (*SnapshotListResponse, error) { +func (r ListSnapshotsInProjectRequest) Execute() (*SnapshotListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -19750,13 +23178,14 @@ func (r ListSnapshotsRequest) Execute() (*SnapshotListResponse, error) { if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSnapshots") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSnapshotsInProject") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/snapshots" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/snapshots" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -19891,27 +23320,30 @@ func (r ListSnapshotsRequest) Execute() (*SnapshotListResponse, error) { } /* -ListSnapshots: List all snapshots inside a project. +ListSnapshotsInProject: List all snapshots inside a project. Get a list of all snapshots inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListSnapshotsRequest + @param region The STACKIT Region of the resources. + @return ApiListSnapshotsInProjectRequest */ -func (a *APIClient) ListSnapshots(ctx context.Context, projectId string) ApiListSnapshotsRequest { - return ListSnapshotsRequest{ +func (a *APIClient) ListSnapshotsInProject(ctx context.Context, projectId string, region string) ApiListSnapshotsInProjectRequest { + return ListSnapshotsInProjectRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListSnapshotsExecute(ctx context.Context, projectId string) (*SnapshotListResponse, error) { - r := ListSnapshotsRequest{ +func (a *APIClient) ListSnapshotsInProjectExecute(ctx context.Context, projectId string, region string) (*SnapshotListResponse, error) { + r := ListSnapshotsInProjectRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -19920,6 +23352,7 @@ type ListVolumePerformanceClassesRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string labelSelector *string } @@ -19947,8 +23380,9 @@ func (r ListVolumePerformanceClassesRequest) Execute() (*VolumePerformanceClassL return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/volume-performance-classes" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volume-performance-classes" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -20089,21 +23523,24 @@ Get a list of all volume performance classes available inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListVolumePerformanceClassesRequest */ -func (a *APIClient) ListVolumePerformanceClasses(ctx context.Context, projectId string) ApiListVolumePerformanceClassesRequest { +func (a *APIClient) ListVolumePerformanceClasses(ctx context.Context, projectId string, region string) ApiListVolumePerformanceClassesRequest { return ListVolumePerformanceClassesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListVolumePerformanceClassesExecute(ctx context.Context, projectId string) (*VolumePerformanceClassListResponse, error) { +func (a *APIClient) ListVolumePerformanceClassesExecute(ctx context.Context, projectId string, region string) (*VolumePerformanceClassListResponse, error) { r := ListVolumePerformanceClassesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -20112,6 +23549,7 @@ type ListVolumesRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string labelSelector *string } @@ -20139,8 +23577,9 @@ func (r ListVolumesRequest) Execute() (*VolumeListResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/volumes" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volumes" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -20281,21 +23720,24 @@ Get a list of all volumes inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @return ApiListVolumesRequest */ -func (a *APIClient) ListVolumes(ctx context.Context, projectId string) ApiListVolumesRequest { +func (a *APIClient) ListVolumes(ctx context.Context, projectId string, region string) ApiListVolumesRequest { return ListVolumesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListVolumesExecute(ctx context.Context, projectId string) (*VolumeListResponse, error) { +func (a *APIClient) ListVolumesExecute(ctx context.Context, projectId string, region string) (*VolumeListResponse, error) { r := ListVolumesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -20304,6 +23746,7 @@ type PartialUpdateNetworkRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string networkId string partialUpdateNetworkPayload *PartialUpdateNetworkPayload } @@ -20331,8 +23774,9 @@ func (r PartialUpdateNetworkRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) localVarHeaderParams := make(map[string]string) @@ -20472,23 +23916,26 @@ Update the settings of a network inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return ApiPartialUpdateNetworkRequest */ -func (a *APIClient) PartialUpdateNetwork(ctx context.Context, projectId string, networkId string) ApiPartialUpdateNetworkRequest { +func (a *APIClient) PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest { return PartialUpdateNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, networkId: networkId, } } -func (a *APIClient) PartialUpdateNetworkExecute(ctx context.Context, projectId string, networkId string) error { +func (a *APIClient) PartialUpdateNetworkExecute(ctx context.Context, projectId string, region string, networkId string) error { r := PartialUpdateNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, networkId: networkId, } return r.Execute() @@ -20502,7 +23949,7 @@ type PartialUpdateNetworkAreaRequest struct { partialUpdateNetworkAreaPayload *PartialUpdateNetworkAreaPayload } -// Request to update an area. +// Request to update an Area. func (r PartialUpdateNetworkAreaRequest) PartialUpdateNetworkAreaPayload(partialUpdateNetworkAreaPayload PartialUpdateNetworkAreaPayload) ApiPartialUpdateNetworkAreaRequest { r.partialUpdateNetworkAreaPayload = &partialUpdateNetworkAreaPayload @@ -20526,7 +23973,7 @@ func (r PartialUpdateNetworkAreaRequest) Execute() (*NetworkArea, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}" + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}" localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) @@ -20703,6 +24150,7 @@ type RebootServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string action *string } @@ -20730,8 +24178,9 @@ func (r RebootServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/reboot" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/reboot" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) @@ -20880,23 +24329,26 @@ Reboot the server. A soft reboot will attempt to gracefully shut down the server @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiRebootServerRequest */ -func (a *APIClient) RebootServer(ctx context.Context, projectId string, serverId string) ApiRebootServerRequest { +func (a *APIClient) RebootServer(ctx context.Context, projectId string, region string, serverId string) ApiRebootServerRequest { return RebootServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } } -func (a *APIClient) RebootServerExecute(ctx context.Context, projectId string, serverId string) error { +func (a *APIClient) RebootServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := RebootServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } return r.Execute() @@ -20906,6 +24358,7 @@ type RemoveNetworkFromServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string networkId string } @@ -20926,8 +24379,9 @@ func (r RemoveNetworkFromServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/networks/{networkId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) @@ -21069,25 +24523,28 @@ Detach and delete all network interfaces associated with the specified network f @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param networkId The identifier (ID) of a STACKIT Network. @return ApiRemoveNetworkFromServerRequest */ -func (a *APIClient) RemoveNetworkFromServer(ctx context.Context, projectId string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest { +func (a *APIClient) RemoveNetworkFromServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest { return RemoveNetworkFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, networkId: networkId, } } -func (a *APIClient) RemoveNetworkFromServerExecute(ctx context.Context, projectId string, serverId string, networkId string) error { +func (a *APIClient) RemoveNetworkFromServerExecute(ctx context.Context, projectId string, region string, serverId string, networkId string) error { r := RemoveNetworkFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, networkId: networkId, } @@ -21098,6 +24555,7 @@ type RemoveNicFromServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string nicId string } @@ -21118,8 +24576,9 @@ func (r RemoveNicFromServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/nics/{nicId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) @@ -21261,25 +24720,28 @@ Detach a network interface from a server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param nicId The identifier (ID) of a network interface. @return ApiRemoveNicFromServerRequest */ -func (a *APIClient) RemoveNicFromServer(ctx context.Context, projectId string, serverId string, nicId string) ApiRemoveNicFromServerRequest { +func (a *APIClient) RemoveNicFromServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiRemoveNicFromServerRequest { return RemoveNicFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, nicId: nicId, } } -func (a *APIClient) RemoveNicFromServerExecute(ctx context.Context, projectId string, serverId string, nicId string) error { +func (a *APIClient) RemoveNicFromServerExecute(ctx context.Context, projectId string, region string, serverId string, nicId string) error { r := RemoveNicFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, nicId: nicId, } @@ -21290,6 +24752,7 @@ type RemovePublicIpFromServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string publicIpId string } @@ -21310,8 +24773,9 @@ func (r RemovePublicIpFromServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/public-ips/{publicIpId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) @@ -21464,25 +24928,28 @@ Dissociate a public IP on an existing server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param publicIpId The identifier (ID) of a Public IP. @return ApiRemovePublicIpFromServerRequest */ -func (a *APIClient) RemovePublicIpFromServer(ctx context.Context, projectId string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest { +func (a *APIClient) RemovePublicIpFromServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest { return RemovePublicIpFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, publicIpId: publicIpId, } } -func (a *APIClient) RemovePublicIpFromServerExecute(ctx context.Context, projectId string, serverId string, publicIpId string) error { +func (a *APIClient) RemovePublicIpFromServerExecute(ctx context.Context, projectId string, region string, serverId string, publicIpId string) error { r := RemovePublicIpFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, publicIpId: publicIpId, } @@ -21493,6 +24960,7 @@ type RemoveSecurityGroupFromServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string securityGroupId string } @@ -21513,8 +24981,9 @@ func (r RemoveSecurityGroupFromServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/security-groups/{securityGroupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) @@ -21667,25 +25136,28 @@ Remove a server from a attached security group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiRemoveSecurityGroupFromServerRequest */ -func (a *APIClient) RemoveSecurityGroupFromServer(ctx context.Context, projectId string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest { +func (a *APIClient) RemoveSecurityGroupFromServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest { return RemoveSecurityGroupFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, securityGroupId: securityGroupId, } } -func (a *APIClient) RemoveSecurityGroupFromServerExecute(ctx context.Context, projectId string, serverId string, securityGroupId string) error { +func (a *APIClient) RemoveSecurityGroupFromServerExecute(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) error { r := RemoveSecurityGroupFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, securityGroupId: securityGroupId, } @@ -21696,6 +25168,7 @@ type RemoveServiceAccountFromServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string serviceAccountMail string } @@ -21717,8 +25190,9 @@ func (r RemoveServiceAccountFromServerRequest) Execute() (*ServiceAccountMailLis return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts/{serviceAccountMail}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(r.serviceAccountMail, "serviceAccountMail")), -1) @@ -21878,25 +25352,28 @@ Detach an additional service account from the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param serviceAccountMail The e-mail address of a service account. @return ApiRemoveServiceAccountFromServerRequest */ -func (a *APIClient) RemoveServiceAccountFromServer(ctx context.Context, projectId string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest { +func (a *APIClient) RemoveServiceAccountFromServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest { return RemoveServiceAccountFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, serviceAccountMail: serviceAccountMail, } } -func (a *APIClient) RemoveServiceAccountFromServerExecute(ctx context.Context, projectId string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) { +func (a *APIClient) RemoveServiceAccountFromServerExecute(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) { r := RemoveServiceAccountFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, serviceAccountMail: serviceAccountMail, } @@ -21907,6 +25384,7 @@ type RemoveVolumeFromServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string volumeId string } @@ -21927,8 +25405,9 @@ func (r RemoveVolumeFromServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) @@ -22081,25 +25560,28 @@ Detach an existing volume from an existing server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiRemoveVolumeFromServerRequest */ -func (a *APIClient) RemoveVolumeFromServer(ctx context.Context, projectId string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest { +func (a *APIClient) RemoveVolumeFromServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest { return RemoveVolumeFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, volumeId: volumeId, } } -func (a *APIClient) RemoveVolumeFromServerExecute(ctx context.Context, projectId string, serverId string, volumeId string) error { +func (a *APIClient) RemoveVolumeFromServerExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) error { r := RemoveVolumeFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, volumeId: volumeId, } @@ -22110,6 +25592,7 @@ type RescueServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string rescueServerPayload *RescueServerPayload } @@ -22137,8 +25620,9 @@ func (r RescueServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/rescue" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/rescue" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) @@ -22289,23 +25773,26 @@ Rescue an existing server. It is shutdown and the initial image is attached as t @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiRescueServerRequest */ -func (a *APIClient) RescueServer(ctx context.Context, projectId string, serverId string) ApiRescueServerRequest { +func (a *APIClient) RescueServer(ctx context.Context, projectId string, region string, serverId string) ApiRescueServerRequest { return RescueServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } } -func (a *APIClient) RescueServerExecute(ctx context.Context, projectId string, serverId string) error { +func (a *APIClient) RescueServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := RescueServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } return r.Execute() @@ -22315,6 +25802,7 @@ type ResizeServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string resizeServerPayload *ResizeServerPayload } @@ -22342,8 +25830,9 @@ func (r ResizeServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/resize" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/resize" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) @@ -22494,23 +25983,26 @@ Resize the server to the given machine type. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiResizeServerRequest */ -func (a *APIClient) ResizeServer(ctx context.Context, projectId string, serverId string) ApiResizeServerRequest { +func (a *APIClient) ResizeServer(ctx context.Context, projectId string, region string, serverId string) ApiResizeServerRequest { return ResizeServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } } -func (a *APIClient) ResizeServerExecute(ctx context.Context, projectId string, serverId string) error { +func (a *APIClient) ResizeServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := ResizeServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } return r.Execute() @@ -22520,6 +26012,7 @@ type ResizeVolumeRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string volumeId string resizeVolumePayload *ResizeVolumePayload } @@ -22547,8 +26040,9 @@ func (r ResizeVolumeRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/volumes/{volumeId}/resize" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}/resize" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) localVarHeaderParams := make(map[string]string) @@ -22696,23 +26190,26 @@ Update the size of a block device volume. The new volume size must be larger tha @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiResizeVolumeRequest */ -func (a *APIClient) ResizeVolume(ctx context.Context, projectId string, volumeId string) ApiResizeVolumeRequest { +func (a *APIClient) ResizeVolume(ctx context.Context, projectId string, region string, volumeId string) ApiResizeVolumeRequest { return ResizeVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, volumeId: volumeId, } } -func (a *APIClient) ResizeVolumeExecute(ctx context.Context, projectId string, volumeId string) error { +func (a *APIClient) ResizeVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) error { r := ResizeVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, volumeId: volumeId, } return r.Execute() @@ -22722,6 +26219,7 @@ type RestoreBackupRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string backupId string } @@ -22741,8 +26239,9 @@ func (r RestoreBackupRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/backups/{backupId}/restore" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/backups/{backupId}/restore" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) @@ -22877,23 +26376,26 @@ Restores a Backup to the existing Volume it references to. The use of this endpo @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param backupId The identifier (ID) of a STACKIT Backup. @return ApiRestoreBackupRequest */ -func (a *APIClient) RestoreBackup(ctx context.Context, projectId string, backupId string) ApiRestoreBackupRequest { +func (a *APIClient) RestoreBackup(ctx context.Context, projectId string, region string, backupId string) ApiRestoreBackupRequest { return RestoreBackupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, backupId: backupId, } } -func (a *APIClient) RestoreBackupExecute(ctx context.Context, projectId string, backupId string) error { +func (a *APIClient) RestoreBackupExecute(ctx context.Context, projectId string, region string, backupId string) error { r := RestoreBackupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, backupId: backupId, } return r.Execute() @@ -22903,6 +26405,7 @@ type SetImageShareRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string imageId string setImageSharePayload *SetImageSharePayload } @@ -22931,8 +26434,9 @@ func (r SetImageShareRequest) Execute() (*ImageShare, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/share" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) localVarHeaderParams := make(map[string]string) @@ -23082,23 +26586,26 @@ Set share of an Image. New Options will replace existing settings. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiSetImageShareRequest */ -func (a *APIClient) SetImageShare(ctx context.Context, projectId string, imageId string) ApiSetImageShareRequest { +func (a *APIClient) SetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiSetImageShareRequest { return SetImageShareRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, imageId: imageId, } } -func (a *APIClient) SetImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) { +func (a *APIClient) SetImageShareExecute(ctx context.Context, projectId string, region string, imageId string) (*ImageShare, error) { r := SetImageShareRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, imageId: imageId, } return r.Execute() @@ -23108,6 +26615,7 @@ type StartServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string } @@ -23127,8 +26635,9 @@ func (r StartServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/start" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/start" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) @@ -23274,23 +26783,26 @@ Start an existing server or allocates the server if deallocated. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiStartServerRequest */ -func (a *APIClient) StartServer(ctx context.Context, projectId string, serverId string) ApiStartServerRequest { +func (a *APIClient) StartServer(ctx context.Context, projectId string, region string, serverId string) ApiStartServerRequest { return StartServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } } -func (a *APIClient) StartServerExecute(ctx context.Context, projectId string, serverId string) error { +func (a *APIClient) StartServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := StartServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } return r.Execute() @@ -23300,6 +26812,7 @@ type StopServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string } @@ -23319,8 +26832,9 @@ func (r StopServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/stop" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/stop" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) @@ -23466,23 +26980,26 @@ Stops an existing server. The server will remain on the Hypervisor and will be c @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiStopServerRequest */ -func (a *APIClient) StopServer(ctx context.Context, projectId string, serverId string) ApiStopServerRequest { +func (a *APIClient) StopServer(ctx context.Context, projectId string, region string, serverId string) ApiStopServerRequest { return StopServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } } -func (a *APIClient) StopServerExecute(ctx context.Context, projectId string, serverId string) error { +func (a *APIClient) StopServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := StopServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } return r.Execute() @@ -23492,6 +27009,7 @@ type UnrescueServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string } @@ -23511,8 +27029,9 @@ func (r UnrescueServerRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/unrescue" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/unrescue" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) @@ -23658,23 +27177,26 @@ Unrescue an existing server. The original boot volume is attached as boot volume @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiUnrescueServerRequest */ -func (a *APIClient) UnrescueServer(ctx context.Context, projectId string, serverId string) ApiUnrescueServerRequest { +func (a *APIClient) UnrescueServer(ctx context.Context, projectId string, region string, serverId string) ApiUnrescueServerRequest { return UnrescueServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } } -func (a *APIClient) UnrescueServerExecute(ctx context.Context, projectId string, serverId string) error { +func (a *APIClient) UnrescueServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := UnrescueServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } return r.Execute() @@ -23684,6 +27206,7 @@ type UpdateAttachedVolumeRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string volumeId string updateAttachedVolumePayload *UpdateAttachedVolumePayload @@ -23713,8 +27236,9 @@ func (r UpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) @@ -23871,25 +27395,28 @@ Update the properties of an existing Volume Attachment. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiUpdateAttachedVolumeRequest */ -func (a *APIClient) UpdateAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest { +func (a *APIClient) UpdateAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest { return UpdateAttachedVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, volumeId: volumeId, } } -func (a *APIClient) UpdateAttachedVolumeExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) { +func (a *APIClient) UpdateAttachedVolumeExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) (*VolumeAttachment, error) { r := UpdateAttachedVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, volumeId: volumeId, } @@ -23900,6 +27427,7 @@ type UpdateBackupRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string backupId string updateBackupPayload *UpdateBackupPayload } @@ -23928,8 +27456,9 @@ func (r UpdateBackupRequest) Execute() (*Backup, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/backups/{backupId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/backups/{backupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) @@ -24079,23 +27608,26 @@ Update name or labels of the backup. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param backupId The identifier (ID) of a STACKIT Backup. @return ApiUpdateBackupRequest */ -func (a *APIClient) UpdateBackup(ctx context.Context, projectId string, backupId string) ApiUpdateBackupRequest { +func (a *APIClient) UpdateBackup(ctx context.Context, projectId string, region string, backupId string) ApiUpdateBackupRequest { return UpdateBackupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, backupId: backupId, } } -func (a *APIClient) UpdateBackupExecute(ctx context.Context, projectId string, backupId string) (*Backup, error) { +func (a *APIClient) UpdateBackupExecute(ctx context.Context, projectId string, region string, backupId string) (*Backup, error) { r := UpdateBackupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, backupId: backupId, } return r.Execute() @@ -24105,6 +27637,7 @@ type UpdateImageRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string imageId string updateImagePayload *UpdateImagePayload } @@ -24133,8 +27666,9 @@ func (r UpdateImageRequest) Execute() (*Image, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) localVarHeaderParams := make(map[string]string) @@ -24284,54 +27818,67 @@ Update the properties of an existing Image inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiUpdateImageRequest */ -func (a *APIClient) UpdateImage(ctx context.Context, projectId string, imageId string) ApiUpdateImageRequest { +func (a *APIClient) UpdateImage(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageRequest { return UpdateImageRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, imageId: imageId, } } -func (a *APIClient) UpdateImageExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { +func (a *APIClient) UpdateImageExecute(ctx context.Context, projectId string, region string, imageId string) (*Image, error) { r := UpdateImageRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, imageId: imageId, } return r.Execute() } -type UpdateImageScopeLocalRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string +type UpdateImageShareRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + imageId string + updateImageSharePayload *UpdateImageSharePayload +} + +// Update an Image Share. + +func (r UpdateImageShareRequest) UpdateImageSharePayload(updateImageSharePayload UpdateImageSharePayload) ApiUpdateImageShareRequest { + r.updateImageSharePayload = &updateImageSharePayload + return r } -func (r UpdateImageScopeLocalRequest) Execute() (*Image, error) { +func (r UpdateImageShareRequest) Execute() (*ImageShare, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Image + localVarReturnValue *ImageShare ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateImageScopeLocal") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateImageShare") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/publish" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) localVarHeaderParams := make(map[string]string) @@ -24349,9 +27896,12 @@ func (r UpdateImageScopeLocalRequest) Execute() (*Image, error) { if strlen(r.imageId) > 36 { return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") } + if r.updateImageSharePayload == nil { + return localVarReturnValue, fmt.Errorf("updateImageSharePayload is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -24367,6 +27917,8 @@ func (r UpdateImageScopeLocalRequest) Execute() (*Image, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.updateImageSharePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -24470,80 +28022,287 @@ func (r UpdateImageScopeLocalRequest) Execute() (*Image, error) { } /* -UpdateImageScopeLocal: Update Image Scope to Local. +UpdateImageShare: Update image share. -Update the scope property of an existing Image inside a project to local. +Update share of an Image. Projects will be appended to existing list. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. - @return ApiUpdateImageScopeLocalRequest + @return ApiUpdateImageShareRequest */ -func (a *APIClient) UpdateImageScopeLocal(ctx context.Context, projectId string, imageId string) ApiUpdateImageScopeLocalRequest { - return UpdateImageScopeLocalRequest{ +func (a *APIClient) UpdateImageShare(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageShareRequest { + return UpdateImageShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +func (a *APIClient) UpdateImageShareExecute(ctx context.Context, projectId string, region string, imageId string) (*ImageShare, error) { + r := UpdateImageShareRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, imageId: imageId, } + return r.Execute() +} + +type UpdateKeyPairRequest struct { + ctx context.Context + apiService *DefaultApiService + keypairName string + updateKeyPairPayload *UpdateKeyPairPayload +} + +// Request an update of an SSH keypair. + +func (r UpdateKeyPairRequest) UpdateKeyPairPayload(updateKeyPairPayload UpdateKeyPairPayload) ApiUpdateKeyPairRequest { + r.updateKeyPairPayload = &updateKeyPairPayload + return r +} + +func (r UpdateKeyPairRequest) Execute() (*Keypair, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Keypair + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateKeyPair") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(r.keypairName, "keypairName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.keypairName) > 127 { + return localVarReturnValue, fmt.Errorf("keypairName must have less than 127 elements") + } + if r.updateKeyPairPayload == nil { + return localVarReturnValue, fmt.Errorf("updateKeyPairPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateKeyPairPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +UpdateKeyPair: Update information of an SSH keypair. + +Update labels of the SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiUpdateKeyPairRequest +*/ +func (a *APIClient) UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest { + return UpdateKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, + } +} + +func (a *APIClient) UpdateKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) { + r := UpdateKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, + } + return r.Execute() } -func (a *APIClient) UpdateImageScopeLocalExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { - r := UpdateImageScopeLocalRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, - } - return r.Execute() +type UpdateNetworkAreaRegionRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + updateNetworkAreaRegionPayload *UpdateNetworkAreaRegionPayload } -type UpdateImageScopePublicRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string +// Request an update of a regional network area. + +func (r UpdateNetworkAreaRegionRequest) UpdateNetworkAreaRegionPayload(updateNetworkAreaRegionPayload UpdateNetworkAreaRegionPayload) ApiUpdateNetworkAreaRegionRequest { + r.updateNetworkAreaRegionPayload = &updateNetworkAreaRegionPayload + return r } -func (r UpdateImageScopePublicRequest) Execute() (*Image, error) { +func (r UpdateNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { var ( - localVarHTTPMethod = http.MethodPut + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Image + localVarReturnValue *RegionalArea ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateImageScopePublic") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateNetworkAreaRegion") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/publish" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.imageId) < 36 { - return localVarReturnValue, fmt.Errorf("imageId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.imageId) > 36 { - return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + } + if r.updateNetworkAreaRegionPayload == nil { + return localVarReturnValue, fmt.Errorf("updateNetworkAreaRegionPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -24559,6 +28318,8 @@ func (r UpdateImageScopePublicRequest) Execute() (*Image, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.updateNetworkAreaRegionPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -24635,6 +28396,17 @@ func (r UpdateImageScopePublicRequest) Execute() (*Image, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -24662,87 +28434,100 @@ func (r UpdateImageScopePublicRequest) Execute() (*Image, error) { } /* -UpdateImageScopePublic: Update Image Scope to Public. +UpdateNetworkAreaRegion: Update a region for a network area. -Update the scope property of an existing Image inside a project to public. +Update a new region for a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiUpdateImageScopePublicRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiUpdateNetworkAreaRegionRequest */ -func (a *APIClient) UpdateImageScopePublic(ctx context.Context, projectId string, imageId string) ApiUpdateImageScopePublicRequest { - return UpdateImageScopePublicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +func (a *APIClient) UpdateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiUpdateNetworkAreaRegionRequest { + return UpdateNetworkAreaRegionRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } } -func (a *APIClient) UpdateImageScopePublicExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { - r := UpdateImageScopePublicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +func (a *APIClient) UpdateNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) (*RegionalArea, error) { + r := UpdateNetworkAreaRegionRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, } return r.Execute() } -type UpdateImageShareRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string - updateImageSharePayload *UpdateImageSharePayload +type UpdateNetworkAreaRouteRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routeId string + updateNetworkAreaRoutePayload *UpdateNetworkAreaRoutePayload } -// Update an Image Share. +// Request an update of a network route. -func (r UpdateImageShareRequest) UpdateImageSharePayload(updateImageSharePayload UpdateImageSharePayload) ApiUpdateImageShareRequest { - r.updateImageSharePayload = &updateImageSharePayload +func (r UpdateNetworkAreaRouteRequest) UpdateNetworkAreaRoutePayload(updateNetworkAreaRoutePayload UpdateNetworkAreaRoutePayload) ApiUpdateNetworkAreaRouteRequest { + r.updateNetworkAreaRoutePayload = &updateNetworkAreaRoutePayload return r } -func (r UpdateImageShareRequest) Execute() (*ImageShare, error) { +func (r UpdateNetworkAreaRouteRequest) Execute() (*Route, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ImageShare + localVarReturnValue *Route ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateImageShare") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateNetworkAreaRoute") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/share" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(r.routeId, "routeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.imageId) < 36 { - return localVarReturnValue, fmt.Errorf("imageId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.imageId) > 36 { - return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } - if r.updateImageSharePayload == nil { - return localVarReturnValue, fmt.Errorf("updateImageSharePayload is required and must be specified") + if strlen(r.routeId) < 36 { + return localVarReturnValue, fmt.Errorf("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, fmt.Errorf("routeId must have less than 36 elements") + } + if r.updateNetworkAreaRoutePayload == nil { + return localVarReturnValue, fmt.Errorf("updateNetworkAreaRoutePayload is required and must be specified") } // to determine the Content-Type header @@ -24763,7 +28548,7 @@ func (r UpdateImageShareRequest) Execute() (*ImageShare, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateImageSharePayload + localVarPostBody = r.updateNetworkAreaRoutePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -24867,76 +28652,103 @@ func (r UpdateImageShareRequest) Execute() (*ImageShare, error) { } /* -UpdateImageShare: Update image share. +UpdateNetworkAreaRoute: Update a network route. -Update share of an Image. Projects will be appended to existing list. +Update a network route defined in a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiUpdateImageShareRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateNetworkAreaRouteRequest */ -func (a *APIClient) UpdateImageShare(ctx context.Context, projectId string, imageId string) ApiUpdateImageShareRequest { - return UpdateImageShareRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +func (a *APIClient) UpdateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiUpdateNetworkAreaRouteRequest { + return UpdateNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, } } -func (a *APIClient) UpdateImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) { - r := UpdateImageShareRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +func (a *APIClient) UpdateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string, routeId string) (*Route, error) { + r := UpdateNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, } return r.Execute() } -type UpdateKeyPairRequest struct { - ctx context.Context - apiService *DefaultApiService - keypairName string - updateKeyPairPayload *UpdateKeyPairPayload +type UpdateNicRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + networkId string + nicId string + updateNicPayload *UpdateNicPayload } -// Request an update of an SSH keypair. +// Request an update of a network interface. -func (r UpdateKeyPairRequest) UpdateKeyPairPayload(updateKeyPairPayload UpdateKeyPairPayload) ApiUpdateKeyPairRequest { - r.updateKeyPairPayload = &updateKeyPairPayload +func (r UpdateNicRequest) UpdateNicPayload(updateNicPayload UpdateNicPayload) ApiUpdateNicRequest { + r.updateNicPayload = &updateNicPayload return r } -func (r UpdateKeyPairRequest) Execute() (*Keypair, error) { +func (r UpdateNicRequest) Execute() (*NIC, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Keypair + localVarReturnValue *NIC ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateKeyPair") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateNic") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/keypairs/{keypairName}" - localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(r.keypairName, "keypairName")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.keypairName) > 127 { - return localVarReturnValue, fmt.Errorf("keypairName must have less than 127 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if r.updateKeyPairPayload == nil { - return localVarReturnValue, fmt.Errorf("updateKeyPairPayload is required and must be specified") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return localVarReturnValue, fmt.Errorf("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, fmt.Errorf("nicId must have less than 36 elements") + } + if r.updateNicPayload == nil { + return localVarReturnValue, fmt.Errorf("updateNicPayload is required and must be specified") } // to determine the Content-Type header @@ -24957,7 +28769,7 @@ func (r UpdateKeyPairRequest) Execute() (*Keypair, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateKeyPairPayload + localVarPostBody = r.updateNicPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -25034,6 +28846,17 @@ func (r UpdateKeyPairRequest) Execute() (*Keypair, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -25061,92 +28884,95 @@ func (r UpdateKeyPairRequest) Execute() (*Keypair, error) { } /* -UpdateKeyPair: Update information of an SSH keypair. +UpdateNic: Update a network interface. -Update labels of the SSH keypair. +Update the properties of an existing network interface inside a network. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param keypairName The name of an SSH keypair. - @return ApiUpdateKeyPairRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiUpdateNicRequest */ -func (a *APIClient) UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest { - return UpdateKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +func (a *APIClient) UpdateNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiUpdateNicRequest { + return UpdateNicRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, } -} - -func (a *APIClient) UpdateKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) { - r := UpdateKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +} + +func (a *APIClient) UpdateNicExecute(ctx context.Context, projectId string, region string, networkId string, nicId string) (*NIC, error) { + r := UpdateNicRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, } return r.Execute() } -type UpdateNetworkAreaRouteRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string - routeId string - updateNetworkAreaRoutePayload *UpdateNetworkAreaRoutePayload +type UpdatePublicIPRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + publicIpId string + updatePublicIPPayload *UpdatePublicIPPayload } -// Request an update of a network route. +// Request an update of a public IP. -func (r UpdateNetworkAreaRouteRequest) UpdateNetworkAreaRoutePayload(updateNetworkAreaRoutePayload UpdateNetworkAreaRoutePayload) ApiUpdateNetworkAreaRouteRequest { - r.updateNetworkAreaRoutePayload = &updateNetworkAreaRoutePayload +func (r UpdatePublicIPRequest) UpdatePublicIPPayload(updatePublicIPPayload UpdatePublicIPPayload) ApiUpdatePublicIPRequest { + r.updatePublicIPPayload = &updatePublicIPPayload return r } -func (r UpdateNetworkAreaRouteRequest) Execute() (*Route, error) { +func (r UpdatePublicIPRequest) Execute() (*PublicIp, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Route + localVarReturnValue *PublicIp ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateNetworkAreaRoute") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdatePublicIP") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(r.routeId, "routeId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.routeId) < 36 { - return localVarReturnValue, fmt.Errorf("routeId must have at least 36 elements") + if strlen(r.publicIpId) < 36 { + return localVarReturnValue, fmt.Errorf("publicIpId must have at least 36 elements") } - if strlen(r.routeId) > 36 { - return localVarReturnValue, fmt.Errorf("routeId must have less than 36 elements") + if strlen(r.publicIpId) > 36 { + return localVarReturnValue, fmt.Errorf("publicIpId must have less than 36 elements") } - if r.updateNetworkAreaRoutePayload == nil { - return localVarReturnValue, fmt.Errorf("updateNetworkAreaRoutePayload is required and must be specified") + if r.updatePublicIPPayload == nil { + return localVarReturnValue, fmt.Errorf("updatePublicIPPayload is required and must be specified") } // to determine the Content-Type header @@ -25167,7 +28993,7 @@ func (r UpdateNetworkAreaRouteRequest) Execute() (*Route, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateNetworkAreaRoutePayload + localVarPostBody = r.updatePublicIPPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -25271,98 +29097,108 @@ func (r UpdateNetworkAreaRouteRequest) Execute() (*Route, error) { } /* -UpdateNetworkAreaRoute: Update a network route. +UpdatePublicIP: Update a public IP. -Update a network route defined in a network area. +Update the properties of an existing public IP inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @param routeId The identifier (ID) of a STACKIT Route. - @return ApiUpdateNetworkAreaRouteRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiUpdatePublicIPRequest */ -func (a *APIClient) UpdateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiUpdateNetworkAreaRouteRequest { - return UpdateNetworkAreaRouteRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - routeId: routeId, +func (a *APIClient) UpdatePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiUpdatePublicIPRequest { + return UpdatePublicIPRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, } } -func (a *APIClient) UpdateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, routeId string) (*Route, error) { - r := UpdateNetworkAreaRouteRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, - routeId: routeId, +func (a *APIClient) UpdatePublicIPExecute(ctx context.Context, projectId string, region string, publicIpId string) (*PublicIp, error) { + r := UpdatePublicIPRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, } return r.Execute() } -type UpdateNicRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - nicId string - updateNicPayload *UpdateNicPayload +type UpdateRouteOfRoutingTableRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string + routeId string + updateRouteOfRoutingTablePayload *UpdateRouteOfRoutingTablePayload } -// Request an update of a network interface. +// Request an update of a route in a routing table. -func (r UpdateNicRequest) UpdateNicPayload(updateNicPayload UpdateNicPayload) ApiUpdateNicRequest { - r.updateNicPayload = &updateNicPayload +func (r UpdateRouteOfRoutingTableRequest) UpdateRouteOfRoutingTablePayload(updateRouteOfRoutingTablePayload UpdateRouteOfRoutingTablePayload) ApiUpdateRouteOfRoutingTableRequest { + r.updateRouteOfRoutingTablePayload = &updateRouteOfRoutingTablePayload return r } -func (r UpdateNicRequest) Execute() (*NIC, error) { +func (r UpdateRouteOfRoutingTableRequest) Execute() (*Route, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NIC + localVarReturnValue *Route ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateNic") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateRouteOfRoutingTable") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(r.routingTableId, "routingTableId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(r.routeId, "routeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } - if strlen(r.nicId) < 36 { - return localVarReturnValue, fmt.Errorf("nicId must have at least 36 elements") + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have at least 36 elements") } - if strlen(r.nicId) > 36 { - return localVarReturnValue, fmt.Errorf("nicId must have less than 36 elements") + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have less than 36 elements") } - if r.updateNicPayload == nil { - return localVarReturnValue, fmt.Errorf("updateNicPayload is required and must be specified") + if strlen(r.routeId) < 36 { + return localVarReturnValue, fmt.Errorf("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, fmt.Errorf("routeId must have less than 36 elements") + } + if r.updateRouteOfRoutingTablePayload == nil { + return localVarReturnValue, fmt.Errorf("updateRouteOfRoutingTablePayload is required and must be specified") } // to determine the Content-Type header @@ -25383,7 +29219,7 @@ func (r UpdateNicRequest) Execute() (*NIC, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateNicPayload + localVarPostBody = r.updateRouteOfRoutingTablePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -25460,17 +29296,6 @@ func (r UpdateNicRequest) Execute() (*NIC, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -25498,90 +29323,106 @@ func (r UpdateNicRequest) Execute() (*NIC, error) { } /* -UpdateNic: Update a network interface. +UpdateRouteOfRoutingTable: Update a route of a routing table. -Update the properties of an existing network interface inside a network. +Update a route defined in a routing table. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @param nicId The identifier (ID) of a network interface. - @return ApiUpdateNicRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateRouteOfRoutingTableRequest */ -func (a *APIClient) UpdateNic(ctx context.Context, projectId string, networkId string, nicId string) ApiUpdateNicRequest { - return UpdateNicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - nicId: nicId, +func (a *APIClient) UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest { + return UpdateRouteOfRoutingTableRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, } } -func (a *APIClient) UpdateNicExecute(ctx context.Context, projectId string, networkId string, nicId string) (*NIC, error) { - r := UpdateNicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - nicId: nicId, +func (a *APIClient) UpdateRouteOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) (*Route, error) { + r := UpdateRouteOfRoutingTableRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, } return r.Execute() } -type UpdatePublicIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - publicIpId string - updatePublicIPPayload *UpdatePublicIPPayload +type UpdateRoutingTableOfAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + region string + routingTableId string + updateRoutingTableOfAreaPayload *UpdateRoutingTableOfAreaPayload } -// Request an update of a public IP. +// Request an update of a routing table. -func (r UpdatePublicIPRequest) UpdatePublicIPPayload(updatePublicIPPayload UpdatePublicIPPayload) ApiUpdatePublicIPRequest { - r.updatePublicIPPayload = &updatePublicIPPayload +func (r UpdateRoutingTableOfAreaRequest) UpdateRoutingTableOfAreaPayload(updateRoutingTableOfAreaPayload UpdateRoutingTableOfAreaPayload) ApiUpdateRoutingTableOfAreaRequest { + r.updateRoutingTableOfAreaPayload = &updateRoutingTableOfAreaPayload return r } -func (r UpdatePublicIPRequest) Execute() (*PublicIp, error) { +func (r UpdateRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PublicIp + localVarReturnValue *RoutingTable ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdatePublicIP") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateRoutingTableOfArea") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/public-ips/{publicIpId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(r.routingTableId, "routingTableId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.publicIpId) < 36 { - return localVarReturnValue, fmt.Errorf("publicIpId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.publicIpId) > 36 { - return localVarReturnValue, fmt.Errorf("publicIpId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } - if r.updatePublicIPPayload == nil { - return localVarReturnValue, fmt.Errorf("updatePublicIPPayload is required and must be specified") + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, fmt.Errorf("routingTableId must have less than 36 elements") + } + if r.updateRoutingTableOfAreaPayload == nil { + return localVarReturnValue, fmt.Errorf("updateRoutingTableOfAreaPayload is required and must be specified") } // to determine the Content-Type header @@ -25602,7 +29443,7 @@ func (r UpdatePublicIPRequest) Execute() (*PublicIp, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updatePublicIPPayload + localVarPostBody = r.updateRoutingTableOfAreaPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -25706,30 +29547,36 @@ func (r UpdatePublicIPRequest) Execute() (*PublicIp, error) { } /* -UpdatePublicIP: Update a public IP. +UpdateRoutingTableOfArea: Update a routing table. -Update the properties of an existing public IP inside a project. +Update a routing table defined in a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param publicIpId The identifier (ID) of a Public IP. - @return ApiUpdatePublicIPRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiUpdateRoutingTableOfAreaRequest */ -func (a *APIClient) UpdatePublicIP(ctx context.Context, projectId string, publicIpId string) ApiUpdatePublicIPRequest { - return UpdatePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - publicIpId: publicIpId, +func (a *APIClient) UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest { + return UpdateRoutingTableOfAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, } } -func (a *APIClient) UpdatePublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, error) { - r := UpdatePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - publicIpId: publicIpId, +func (a *APIClient) UpdateRoutingTableOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RoutingTable, error) { + r := UpdateRoutingTableOfAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, } return r.Execute() } @@ -25738,6 +29585,7 @@ type UpdateSecurityGroupRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string securityGroupId string updateSecurityGroupPayload *UpdateSecurityGroupPayload } @@ -25766,8 +29614,9 @@ func (r UpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) @@ -25917,23 +29766,26 @@ Update labels of the security group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiUpdateSecurityGroupRequest */ -func (a *APIClient) UpdateSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiUpdateSecurityGroupRequest { +func (a *APIClient) UpdateSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiUpdateSecurityGroupRequest { return UpdateSecurityGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, securityGroupId: securityGroupId, } } -func (a *APIClient) UpdateSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) { +func (a *APIClient) UpdateSecurityGroupExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroup, error) { r := UpdateSecurityGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, securityGroupId: securityGroupId, } return r.Execute() @@ -25943,6 +29795,7 @@ type UpdateServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string updateServerPayload *UpdateServerPayload } @@ -25971,8 +29824,9 @@ func (r UpdateServerRequest) Execute() (*Server, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) @@ -26122,23 +29976,26 @@ Update name or labels of the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiUpdateServerRequest */ -func (a *APIClient) UpdateServer(ctx context.Context, projectId string, serverId string) ApiUpdateServerRequest { +func (a *APIClient) UpdateServer(ctx context.Context, projectId string, region string, serverId string) ApiUpdateServerRequest { return UpdateServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } } -func (a *APIClient) UpdateServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { +func (a *APIClient) UpdateServerExecute(ctx context.Context, projectId string, region string, serverId string) (*Server, error) { r := UpdateServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, } return r.Execute() @@ -26148,6 +30005,7 @@ type UpdateSnapshotRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string snapshotId string updateSnapshotPayload *UpdateSnapshotPayload } @@ -26176,8 +30034,9 @@ func (r UpdateSnapshotRequest) Execute() (*Snapshot, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/snapshots/{snapshotId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(r.snapshotId, "snapshotId")), -1) localVarHeaderParams := make(map[string]string) @@ -26327,23 +30186,26 @@ Update information like name or labels of the snapshot. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param snapshotId The identifier (ID) of a STACKIT Snapshot. @return ApiUpdateSnapshotRequest */ -func (a *APIClient) UpdateSnapshot(ctx context.Context, projectId string, snapshotId string) ApiUpdateSnapshotRequest { +func (a *APIClient) UpdateSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiUpdateSnapshotRequest { return UpdateSnapshotRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, snapshotId: snapshotId, } } -func (a *APIClient) UpdateSnapshotExecute(ctx context.Context, projectId string, snapshotId string) (*Snapshot, error) { +func (a *APIClient) UpdateSnapshotExecute(ctx context.Context, projectId string, region string, snapshotId string) (*Snapshot, error) { r := UpdateSnapshotRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, snapshotId: snapshotId, } return r.Execute() @@ -26353,6 +30215,7 @@ type UpdateVolumeRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string volumeId string updateVolumePayload *UpdateVolumePayload } @@ -26381,8 +30244,9 @@ func (r UpdateVolumeRequest) Execute() (*Volume, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/volumes/{volumeId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) localVarHeaderParams := make(map[string]string) @@ -26532,23 +30396,26 @@ Update name, description or labels of the volume. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiUpdateVolumeRequest */ -func (a *APIClient) UpdateVolume(ctx context.Context, projectId string, volumeId string) ApiUpdateVolumeRequest { +func (a *APIClient) UpdateVolume(ctx context.Context, projectId string, region string, volumeId string) ApiUpdateVolumeRequest { return UpdateVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, volumeId: volumeId, } } -func (a *APIClient) UpdateVolumeExecute(ctx context.Context, projectId string, volumeId string) (*Volume, error) { +func (a *APIClient) UpdateVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) (*Volume, error) { r := UpdateVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, volumeId: volumeId, } return r.Execute() diff --git a/services/iaas/api_default_test.go b/services/iaas/api_default_test.go index 04f123bcd..87ea93371 100644 --- a/services/iaas/api_default_test.go +++ b/services/iaas/api_default_test.go @@ -24,9 +24,11 @@ import ( func Test_iaas_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService AddNetworkToServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/networks/{networkId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) networkIdValue := randString(36) @@ -65,10 +67,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue networkId := networkIdValue - reqErr := apiClient.AddNetworkToServer(context.Background(), projectId, serverId, networkId).Execute() + reqErr := apiClient.AddNetworkToServer(context.Background(), projectId, region, serverId, networkId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -76,9 +79,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService AddNicToServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/nics/{nicId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) nicIdValue := randString(36) @@ -117,10 +122,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue nicId := nicIdValue - reqErr := apiClient.AddNicToServer(context.Background(), projectId, serverId, nicId).Execute() + reqErr := apiClient.AddNicToServer(context.Background(), projectId, region, serverId, nicId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -128,9 +134,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService AddPublicIpToServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/public-ips/{publicIpId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) publicIpIdValue := randString(36) @@ -169,20 +177,144 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue publicIpId := publicIpIdValue - reqErr := apiClient.AddPublicIpToServer(context.Background(), projectId, serverId, publicIpId).Execute() + reqErr := apiClient.AddPublicIpToServer(context.Background(), projectId, region, serverId, publicIpId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) + t.Run("Test DefaultApiService AddRoutesToRoutingTable", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + routingTableIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(routingTableIdValue, "routingTableId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := RouteListResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaas_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue + addRoutesToRoutingTablePayload := AddRoutesToRoutingTablePayload{} + + resp, reqErr := apiClient.AddRoutesToRoutingTable(context.Background(), organizationId, areaId, region, routingTableId).AddRoutesToRoutingTablePayload(addRoutesToRoutingTablePayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService AddRoutingTableToArea", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := RoutingTable{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaas_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + addRoutingTableToAreaPayload := AddRoutingTableToAreaPayload{} + + resp, reqErr := apiClient.AddRoutingTableToArea(context.Background(), organizationId, areaId, region).AddRoutingTableToAreaPayload(addRoutingTableToAreaPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService AddSecurityGroupToServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/security-groups/{securityGroupId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) securityGroupIdValue := randString(36) @@ -221,10 +353,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue securityGroupId := securityGroupIdValue - reqErr := apiClient.AddSecurityGroupToServer(context.Background(), projectId, serverId, securityGroupId).Execute() + reqErr := apiClient.AddSecurityGroupToServer(context.Background(), projectId, region, serverId, securityGroupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -232,9 +365,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService AddServiceAccountToServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts/{serviceAccountMail}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) serviceAccountMailValue := randString(255) @@ -276,10 +411,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue serviceAccountMail := serviceAccountMailValue - resp, reqErr := apiClient.AddServiceAccountToServer(context.Background(), projectId, serverId, serviceAccountMail).Execute() + resp, reqErr := apiClient.AddServiceAccountToServer(context.Background(), projectId, region, serverId, serviceAccountMail).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -290,9 +426,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService AddVolumeToServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) volumeIdValue := randString(36) @@ -334,10 +472,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue volumeId := volumeIdValue - resp, reqErr := apiClient.AddVolumeToServer(context.Background(), projectId, serverId, volumeId).Execute() + resp, reqErr := apiClient.AddVolumeToServer(context.Background(), projectId, region, serverId, volumeId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -348,9 +487,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateAffinityGroup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/affinity-groups" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/affinity-groups" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -388,9 +529,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue createAffinityGroupPayload := CreateAffinityGroupPayload{} - resp, reqErr := apiClient.CreateAffinityGroup(context.Background(), projectId).CreateAffinityGroupPayload(createAffinityGroupPayload).Execute() + resp, reqErr := apiClient.CreateAffinityGroup(context.Background(), projectId, region).CreateAffinityGroupPayload(createAffinityGroupPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -401,9 +543,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateBackup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/backups" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/backups" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -441,9 +585,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue createBackupPayload := CreateBackupPayload{} - resp, reqErr := apiClient.CreateBackup(context.Background(), projectId).CreateBackupPayload(createBackupPayload).Execute() + resp, reqErr := apiClient.CreateBackup(context.Background(), projectId, region).CreateBackupPayload(createBackupPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -454,9 +599,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateImage", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/images" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/images" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -494,9 +641,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue createImagePayload := CreateImagePayload{} - resp, reqErr := apiClient.CreateImage(context.Background(), projectId).CreateImagePayload(createImagePayload).Execute() + resp, reqErr := apiClient.CreateImage(context.Background(), projectId, region).CreateImagePayload(createImagePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -507,7 +655,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateKeyPair", func(t *testing.T) { - _apiUrlPath := "/v1/keypairs" + _apiUrlPath := "/v2/keypairs" testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -557,9 +705,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateNetwork", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/networks" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/networks" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -597,9 +747,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue createNetworkPayload := CreateNetworkPayload{} - resp, reqErr := apiClient.CreateNetwork(context.Background(), projectId).CreateNetworkPayload(createNetworkPayload).Execute() + resp, reqErr := apiClient.CreateNetwork(context.Background(), projectId, region).CreateNetworkPayload(createNetworkPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -610,7 +761,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateNetworkArea", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas" + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas" organizationIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) @@ -663,11 +814,13 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateNetworkAreaRange", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges" organizationIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) areaIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -706,9 +859,69 @@ func Test_iaas_DefaultApiService(t *testing.T) { organizationId := organizationIdValue areaId := areaIdValue + region := regionValue createNetworkAreaRangePayload := CreateNetworkAreaRangePayload{} - resp, reqErr := apiClient.CreateNetworkAreaRange(context.Background(), organizationId, areaId).CreateNetworkAreaRangePayload(createNetworkAreaRangePayload).Execute() + resp, reqErr := apiClient.CreateNetworkAreaRange(context.Background(), organizationId, areaId, region).CreateNetworkAreaRangePayload(createNetworkAreaRangePayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService CreateNetworkAreaRegion", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := RegionalArea{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaas_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + createNetworkAreaRegionPayload := CreateNetworkAreaRegionPayload{} + + resp, reqErr := apiClient.CreateNetworkAreaRegion(context.Background(), organizationId, areaId, region).CreateNetworkAreaRegionPayload(createNetworkAreaRegionPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -719,11 +932,13 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateNetworkAreaRoute", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas/{areaId}/routes" + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes" organizationIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) areaIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -762,9 +977,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { organizationId := organizationIdValue areaId := areaIdValue + region := regionValue createNetworkAreaRoutePayload := CreateNetworkAreaRoutePayload{} - resp, reqErr := apiClient.CreateNetworkAreaRoute(context.Background(), organizationId, areaId).CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload).Execute() + resp, reqErr := apiClient.CreateNetworkAreaRoute(context.Background(), organizationId, areaId, region).CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -775,9 +991,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateNic", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/networks/{networkId}/nics" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) networkIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) @@ -817,10 +1035,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue networkId := networkIdValue createNicPayload := CreateNicPayload{} - resp, reqErr := apiClient.CreateNic(context.Background(), projectId, networkId).CreateNicPayload(createNicPayload).Execute() + resp, reqErr := apiClient.CreateNic(context.Background(), projectId, region, networkId).CreateNicPayload(createNicPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -831,9 +1050,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreatePublicIP", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/public-ips" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/public-ips" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -871,9 +1092,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue createPublicIPPayload := CreatePublicIPPayload{} - resp, reqErr := apiClient.CreatePublicIP(context.Background(), projectId).CreatePublicIPPayload(createPublicIPPayload).Execute() + resp, reqErr := apiClient.CreatePublicIP(context.Background(), projectId, region).CreatePublicIPPayload(createPublicIPPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -884,9 +1106,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateSecurityGroup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/security-groups" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/security-groups" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -924,9 +1148,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue createSecurityGroupPayload := CreateSecurityGroupPayload{} - resp, reqErr := apiClient.CreateSecurityGroup(context.Background(), projectId).CreateSecurityGroupPayload(createSecurityGroupPayload).Execute() + resp, reqErr := apiClient.CreateSecurityGroup(context.Background(), projectId, region).CreateSecurityGroupPayload(createSecurityGroupPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -937,9 +1162,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateSecurityGroupRule", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) securityGroupIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) @@ -979,10 +1206,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue securityGroupId := securityGroupIdValue createSecurityGroupRulePayload := CreateSecurityGroupRulePayload{} - resp, reqErr := apiClient.CreateSecurityGroupRule(context.Background(), projectId, securityGroupId).CreateSecurityGroupRulePayload(createSecurityGroupRulePayload).Execute() + resp, reqErr := apiClient.CreateSecurityGroupRule(context.Background(), projectId, region, securityGroupId).CreateSecurityGroupRulePayload(createSecurityGroupRulePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -993,9 +1221,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -1033,9 +1263,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue createServerPayload := CreateServerPayload{} - resp, reqErr := apiClient.CreateServer(context.Background(), projectId).CreateServerPayload(createServerPayload).Execute() + resp, reqErr := apiClient.CreateServer(context.Background(), projectId, region).CreateServerPayload(createServerPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1046,9 +1277,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateSnapshot", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/snapshots" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/snapshots" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -1086,9 +1319,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue createSnapshotPayload := CreateSnapshotPayload{} - resp, reqErr := apiClient.CreateSnapshot(context.Background(), projectId).CreateSnapshotPayload(createSnapshotPayload).Execute() + resp, reqErr := apiClient.CreateSnapshot(context.Background(), projectId, region).CreateSnapshotPayload(createSnapshotPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1099,9 +1333,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateVolume", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/volumes" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/volumes" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -1139,9 +1375,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue createVolumePayload := CreateVolumePayload{} - resp, reqErr := apiClient.CreateVolume(context.Background(), projectId).CreateVolumePayload(createVolumePayload).Execute() + resp, reqErr := apiClient.CreateVolume(context.Background(), projectId, region).CreateVolumePayload(createVolumePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1152,9 +1389,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeallocateServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/deallocate" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/deallocate" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -1191,9 +1430,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue - reqErr := apiClient.DeallocateServer(context.Background(), projectId, serverId).Execute() + reqErr := apiClient.DeallocateServer(context.Background(), projectId, region, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1201,9 +1441,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteAffinityGroup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/affinity-groups/{affinityGroupId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/affinity-groups/{affinityGroupId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) affinityGroupIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(affinityGroupIdValue, "affinityGroupId")), -1) @@ -1240,9 +1482,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue affinityGroupId := affinityGroupIdValue - reqErr := apiClient.DeleteAffinityGroup(context.Background(), projectId, affinityGroupId).Execute() + reqErr := apiClient.DeleteAffinityGroup(context.Background(), projectId, region, affinityGroupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1250,9 +1493,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteBackup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/backups/{backupId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/backups/{backupId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) backupIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) @@ -1289,9 +1534,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue backupId := backupIdValue - reqErr := apiClient.DeleteBackup(context.Background(), projectId, backupId).Execute() + reqErr := apiClient.DeleteBackup(context.Background(), projectId, region, backupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1299,9 +1545,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteImage", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/images/{imageId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/images/{imageId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) imageIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) @@ -1338,9 +1586,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue imageId := imageIdValue - reqErr := apiClient.DeleteImage(context.Background(), projectId, imageId).Execute() + reqErr := apiClient.DeleteImage(context.Background(), projectId, region, imageId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1348,9 +1597,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteImageShare", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/images/{imageId}/share" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) imageIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) @@ -1387,9 +1638,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue imageId := imageIdValue - reqErr := apiClient.DeleteImageShare(context.Background(), projectId, imageId).Execute() + reqErr := apiClient.DeleteImageShare(context.Background(), projectId, region, imageId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1397,9 +1649,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteImageShareConsumer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share/{consumerProjectId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) imageIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) consumerProjectIdValue := randString(36) @@ -1438,10 +1692,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue imageId := imageIdValue consumerProjectId := consumerProjectIdValue - reqErr := apiClient.DeleteImageShareConsumer(context.Background(), projectId, imageId, consumerProjectId).Execute() + reqErr := apiClient.DeleteImageShareConsumer(context.Background(), projectId, region, imageId, consumerProjectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1449,7 +1704,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteKeyPair", func(t *testing.T) { - _apiUrlPath := "/v1/keypairs/{keypairName}" + _apiUrlPath := "/v2/keypairs/{keypairName}" keypairNameValue := randString(127) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) @@ -1495,9 +1750,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteNetwork", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/networks/{networkId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/networks/{networkId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) networkIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) @@ -1534,9 +1791,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue networkId := networkIdValue - reqErr := apiClient.DeleteNetwork(context.Background(), projectId, networkId).Execute() + reqErr := apiClient.DeleteNetwork(context.Background(), projectId, region, networkId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1544,7 +1802,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteNetworkArea", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas/{areaId}" + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}" organizationIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) areaIdValue := randString(36) @@ -1593,11 +1851,13 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteNetworkAreaRange", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges/{networkRangeId}" organizationIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) areaIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) networkRangeIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(networkRangeIdValue, "networkRangeId")), -1) @@ -1635,23 +1895,24 @@ func Test_iaas_DefaultApiService(t *testing.T) { organizationId := organizationIdValue areaId := areaIdValue + region := regionValue networkRangeId := networkRangeIdValue - reqErr := apiClient.DeleteNetworkAreaRange(context.Background(), organizationId, areaId, networkRangeId).Execute() + reqErr := apiClient.DeleteNetworkAreaRange(context.Background(), organizationId, areaId, region, networkRangeId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService DeleteNetworkAreaRoute", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + t.Run("Test DefaultApiService DeleteNetworkAreaRegion", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" organizationIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) areaIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) - routeIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -1687,23 +1948,25 @@ func Test_iaas_DefaultApiService(t *testing.T) { organizationId := organizationIdValue areaId := areaIdValue - routeId := routeIdValue + region := regionValue - reqErr := apiClient.DeleteNetworkAreaRoute(context.Background(), organizationId, areaId, routeId).Execute() + reqErr := apiClient.DeleteNetworkAreaRegion(context.Background(), organizationId, areaId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService DeleteNic", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) - nicIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) + t.Run("Test DefaultApiService DeleteNetworkAreaRoute", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + routeIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -1737,23 +2000,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - networkId := networkIdValue - nicId := nicIdValue + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routeId := routeIdValue - reqErr := apiClient.DeleteNic(context.Background(), projectId, networkId, nicId).Execute() + reqErr := apiClient.DeleteNetworkAreaRoute(context.Background(), organizationId, areaId, region, routeId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService DeletePublicIP", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/public-ips/{publicIpId}" + t.Run("Test DefaultApiService DeleteNic", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - publicIpIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + networkIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + nicIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -1788,21 +2056,25 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue - publicIpId := publicIpIdValue + region := regionValue + networkId := networkIdValue + nicId := nicIdValue - reqErr := apiClient.DeletePublicIP(context.Background(), projectId, publicIpId).Execute() + reqErr := apiClient.DeleteNic(context.Background(), projectId, region, networkId, nicId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService DeleteSecurityGroup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/security-groups/{securityGroupId}" + t.Run("Test DefaultApiService DeletePublicIP", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + publicIpIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -1837,23 +2109,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue - securityGroupId := securityGroupIdValue + region := regionValue + publicIpId := publicIpIdValue - reqErr := apiClient.DeleteSecurityGroup(context.Background(), projectId, securityGroupId).Execute() + reqErr := apiClient.DeletePublicIP(context.Background(), projectId, region, publicIpId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService DeleteSecurityGroupRule", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) - securityGroupRuleIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(securityGroupRuleIdValue, "securityGroupRuleId")), -1) + t.Run("Test DefaultApiService DeleteRouteFromRoutingTable", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + routingTableIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(routingTableIdValue, "routingTableId")), -1) + routeIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -1887,23 +2164,29 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - securityGroupId := securityGroupIdValue - securityGroupRuleId := securityGroupRuleIdValue + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue + routeId := routeIdValue - reqErr := apiClient.DeleteSecurityGroupRule(context.Background(), projectId, securityGroupId, securityGroupRuleId).Execute() + reqErr := apiClient.DeleteRouteFromRoutingTable(context.Background(), organizationId, areaId, region, routingTableId, routeId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService DeleteServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + t.Run("Test DefaultApiService DeleteRoutingTableFromArea", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + routingTableIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(routingTableIdValue, "routingTableId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -1937,22 +2220,26 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - serverId := serverIdValue + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue - reqErr := apiClient.DeleteServer(context.Background(), projectId, serverId).Execute() + reqErr := apiClient.DeleteRoutingTableFromArea(context.Background(), organizationId, areaId, region, routingTableId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService DeleteSnapshot", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/snapshots/{snapshotId}" + t.Run("Test DefaultApiService DeleteSecurityGroup", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - snapshotIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(snapshotIdValue, "snapshotId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + securityGroupIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -1987,21 +2274,26 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue - snapshotId := snapshotIdValue + region := regionValue + securityGroupId := securityGroupIdValue - reqErr := apiClient.DeleteSnapshot(context.Background(), projectId, snapshotId).Execute() + reqErr := apiClient.DeleteSecurityGroup(context.Background(), projectId, region, securityGroupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService DeleteVolume", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/volumes/{volumeId}" + t.Run("Test DefaultApiService DeleteSecurityGroupRule", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - volumeIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + securityGroupIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + securityGroupRuleIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(securityGroupRuleIdValue, "securityGroupRuleId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -2036,26 +2328,186 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue - volumeId := volumeIdValue + region := regionValue + securityGroupId := securityGroupIdValue + securityGroupRuleId := securityGroupRuleIdValue - reqErr := apiClient.DeleteVolume(context.Background(), projectId, volumeId).Execute() + reqErr := apiClient.DeleteSecurityGroupRule(context.Background(), projectId, region, securityGroupId, securityGroupRuleId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService GetAffinityGroup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/affinity-groups/{affinityGroupId}" + t.Run("Test DefaultApiService DeleteServer", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - affinityGroupIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(affinityGroupIdValue, "affinityGroupId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + serverIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := AffinityGroup{} - w.Header().Add("Content-Type", "application/json") + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaas_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := projectIdValue + region := regionValue + serverId := serverIdValue + + reqErr := apiClient.DeleteServer(context.Background(), projectId, region, serverId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteSnapshot", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" + projectIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + snapshotIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(snapshotIdValue, "snapshotId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaas_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := projectIdValue + region := regionValue + snapshotId := snapshotIdValue + + reqErr := apiClient.DeleteSnapshot(context.Background(), projectId, region, snapshotId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteVolume", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}" + projectIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + volumeIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaas_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := projectIdValue + region := regionValue + volumeId := volumeIdValue + + reqErr := apiClient.DeleteVolume(context.Background(), projectId, region, volumeId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService GetAffinityGroup", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/affinity-groups/{affinityGroupId}" + projectIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + affinityGroupIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(affinityGroupIdValue, "affinityGroupId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := AffinityGroup{} + w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) @@ -2088,9 +2540,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue affinityGroupId := affinityGroupIdValue - resp, reqErr := apiClient.GetAffinityGroup(context.Background(), projectId, affinityGroupId).Execute() + resp, reqErr := apiClient.GetAffinityGroup(context.Background(), projectId, region, affinityGroupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2101,9 +2554,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetAttachedVolume", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) volumeIdValue := randString(36) @@ -2145,10 +2600,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue volumeId := volumeIdValue - resp, reqErr := apiClient.GetAttachedVolume(context.Background(), projectId, serverId, volumeId).Execute() + resp, reqErr := apiClient.GetAttachedVolume(context.Background(), projectId, region, serverId, volumeId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2159,9 +2615,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetBackup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/backups/{backupId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/backups/{backupId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) backupIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) @@ -2201,9 +2659,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue backupId := backupIdValue - resp, reqErr := apiClient.GetBackup(context.Background(), projectId, backupId).Execute() + resp, reqErr := apiClient.GetBackup(context.Background(), projectId, region, backupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2214,9 +2673,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetImage", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/images/{imageId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/images/{imageId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) imageIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) @@ -2256,9 +2717,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue imageId := imageIdValue - resp, reqErr := apiClient.GetImage(context.Background(), projectId, imageId).Execute() + resp, reqErr := apiClient.GetImage(context.Background(), projectId, region, imageId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2269,9 +2731,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetImageShare", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/images/{imageId}/share" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) imageIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) @@ -2311,9 +2775,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue imageId := imageIdValue - resp, reqErr := apiClient.GetImageShare(context.Background(), projectId, imageId).Execute() + resp, reqErr := apiClient.GetImageShare(context.Background(), projectId, region, imageId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2324,9 +2789,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetImageShareConsumer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share/{consumerProjectId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) imageIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) consumerProjectIdValue := randString(36) @@ -2368,10 +2835,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue imageId := imageIdValue consumerProjectId := consumerProjectIdValue - resp, reqErr := apiClient.GetImageShareConsumer(context.Background(), projectId, imageId, consumerProjectId).Execute() + resp, reqErr := apiClient.GetImageShareConsumer(context.Background(), projectId, region, imageId, consumerProjectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2382,7 +2850,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetKeyPair", func(t *testing.T) { - _apiUrlPath := "/v1/keypairs/{keypairName}" + _apiUrlPath := "/v2/keypairs/{keypairName}" keypairNameValue := randString(127) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) @@ -2434,9 +2902,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetMachineType", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/machine-types/{machineType}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/machine-types/{machineType}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) machineTypeValue := randString(127) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"machineType"+"}", url.PathEscape(ParameterValueToString(machineTypeValue, "machineType")), -1) @@ -2476,9 +2946,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue machineType := machineTypeValue - resp, reqErr := apiClient.GetMachineType(context.Background(), projectId, machineType).Execute() + resp, reqErr := apiClient.GetMachineType(context.Background(), projectId, region, machineType).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2489,9 +2960,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetNetwork", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/networks/{networkId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/networks/{networkId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) networkIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) @@ -2531,9 +3004,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue networkId := networkIdValue - resp, reqErr := apiClient.GetNetwork(context.Background(), projectId, networkId).Execute() + resp, reqErr := apiClient.GetNetwork(context.Background(), projectId, region, networkId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2544,7 +3018,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetNetworkArea", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas/{areaId}" + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}" organizationIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) areaIdValue := randString(36) @@ -2599,11 +3073,13 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetNetworkAreaRange", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges/{networkRangeId}" organizationIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) areaIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) networkRangeIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(networkRangeIdValue, "networkRangeId")), -1) @@ -2644,9 +3120,68 @@ func Test_iaas_DefaultApiService(t *testing.T) { organizationId := organizationIdValue areaId := areaIdValue + region := regionValue networkRangeId := networkRangeIdValue - resp, reqErr := apiClient.GetNetworkAreaRange(context.Background(), organizationId, areaId, networkRangeId).Execute() + resp, reqErr := apiClient.GetNetworkAreaRange(context.Background(), organizationId, areaId, region, networkRangeId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetNetworkAreaRegion", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := RegionalArea{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaas_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + + resp, reqErr := apiClient.GetNetworkAreaRegion(context.Background(), organizationId, areaId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2657,11 +3192,13 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetNetworkAreaRoute", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" organizationIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) areaIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) routeIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -1) @@ -2702,9 +3239,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { organizationId := organizationIdValue areaId := areaIdValue + region := regionValue routeId := routeIdValue - resp, reqErr := apiClient.GetNetworkAreaRoute(context.Background(), organizationId, areaId, routeId).Execute() + resp, reqErr := apiClient.GetNetworkAreaRoute(context.Background(), organizationId, areaId, region, routeId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2715,9 +3253,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetNic", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) networkIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) nicIdValue := randString(36) @@ -2759,10 +3299,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue networkId := networkIdValue nicId := nicIdValue - resp, reqErr := apiClient.GetNic(context.Background(), projectId, networkId, nicId).Execute() + resp, reqErr := apiClient.GetNic(context.Background(), projectId, region, networkId, nicId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2773,7 +3314,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetOrganizationRequest", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/requests/{requestId}" + _apiUrlPath := "/v2/organizations/{organizationId}/requests/{requestId}" organizationIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) requestIdValue := randString(36) @@ -2828,7 +3369,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetProjectDetails", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}" + _apiUrlPath := "/v2/projects/{projectId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) @@ -2880,9 +3421,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetProjectNIC", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/nics/{nicId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/nics/{nicId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) nicIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) @@ -2922,9 +3465,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue nicId := nicIdValue - resp, reqErr := apiClient.GetProjectNIC(context.Background(), projectId, nicId).Execute() + resp, reqErr := apiClient.GetProjectNIC(context.Background(), projectId, region, nicId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2935,9 +3479,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetProjectRequest", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/requests/{requestId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/requests/{requestId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) requestIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(requestIdValue, "requestId")), -1) @@ -2977,9 +3523,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue requestId := requestIdValue - resp, reqErr := apiClient.GetProjectRequest(context.Background(), projectId, requestId).Execute() + resp, reqErr := apiClient.GetProjectRequest(context.Background(), projectId, region, requestId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2990,9 +3537,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetPublicIP", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/public-ips/{publicIpId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) publicIpIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) @@ -3032,9 +3581,135 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue publicIpId := publicIpIdValue - resp, reqErr := apiClient.GetPublicIP(context.Background(), projectId, publicIpId).Execute() + resp, reqErr := apiClient.GetPublicIP(context.Background(), projectId, region, publicIpId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetRouteOfRoutingTable", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + routingTableIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(routingTableIdValue, "routingTableId")), -1) + routeIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := Route{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaas_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue + routeId := routeIdValue + + resp, reqErr := apiClient.GetRouteOfRoutingTable(context.Background(), organizationId, areaId, region, routingTableId, routeId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetRoutingTableOfArea", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + routingTableIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(routingTableIdValue, "routingTableId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := RoutingTable{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaas_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue + + resp, reqErr := apiClient.GetRoutingTableOfArea(context.Background(), organizationId, areaId, region, routingTableId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3045,9 +3720,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetSecurityGroup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/security-groups/{securityGroupId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) securityGroupIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) @@ -3087,9 +3764,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue securityGroupId := securityGroupIdValue - resp, reqErr := apiClient.GetSecurityGroup(context.Background(), projectId, securityGroupId).Execute() + resp, reqErr := apiClient.GetSecurityGroup(context.Background(), projectId, region, securityGroupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3100,9 +3778,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetSecurityGroupRule", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) securityGroupIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) securityGroupRuleIdValue := randString(36) @@ -3144,10 +3824,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue securityGroupId := securityGroupIdValue securityGroupRuleId := securityGroupRuleIdValue - resp, reqErr := apiClient.GetSecurityGroupRule(context.Background(), projectId, securityGroupId, securityGroupRuleId).Execute() + resp, reqErr := apiClient.GetSecurityGroupRule(context.Background(), projectId, region, securityGroupId, securityGroupRuleId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3158,9 +3839,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -3200,9 +3883,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue - resp, reqErr := apiClient.GetServer(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.GetServer(context.Background(), projectId, region, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3213,9 +3897,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetServerConsole", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/console" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/console" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -3255,9 +3941,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue - resp, reqErr := apiClient.GetServerConsole(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.GetServerConsole(context.Background(), projectId, region, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3268,9 +3955,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetServerLog", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/log" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/log" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -3310,9 +3999,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue - resp, reqErr := apiClient.GetServerLog(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.GetServerLog(context.Background(), projectId, region, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3323,9 +4013,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetSnapshot", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/snapshots/{snapshotId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) snapshotIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(snapshotIdValue, "snapshotId")), -1) @@ -3365,9 +4057,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue snapshotId := snapshotIdValue - resp, reqErr := apiClient.GetSnapshot(context.Background(), projectId, snapshotId).Execute() + resp, reqErr := apiClient.GetSnapshot(context.Background(), projectId, region, snapshotId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3378,9 +4071,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetVolume", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/volumes/{volumeId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) volumeIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) @@ -3420,9 +4115,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue volumeId := volumeIdValue - resp, reqErr := apiClient.GetVolume(context.Background(), projectId, volumeId).Execute() + resp, reqErr := apiClient.GetVolume(context.Background(), projectId, region, volumeId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3433,9 +4129,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetVolumePerformanceClass", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/volume-performance-classes/{volumePerformanceClass}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) volumePerformanceClassValue := randString(127) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(volumePerformanceClassValue, "volumePerformanceClass")), -1) @@ -3475,9 +4173,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue volumePerformanceClass := volumePerformanceClassValue - resp, reqErr := apiClient.GetVolumePerformanceClass(context.Background(), projectId, volumePerformanceClass).Execute() + resp, reqErr := apiClient.GetVolumePerformanceClass(context.Background(), projectId, region, volumePerformanceClass).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3488,9 +4187,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListAffinityGroups", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/affinity-groups" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/affinity-groups" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -3528,8 +4229,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue - resp, reqErr := apiClient.ListAffinityGroups(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListAffinityGroups(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3540,9 +4242,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListAttachedVolumes", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/volume-attachments" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -3582,9 +4286,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue - resp, reqErr := apiClient.ListAttachedVolumes(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.ListAttachedVolumes(context.Background(), projectId, region, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3595,7 +4300,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListAvailabilityZones", func(t *testing.T) { - _apiUrlPath := "/v1/availability-zones" + _apiUrlPath := "/v2/regions/{region}/availability-zones" + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -3632,7 +4339,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - resp, reqErr := apiClient.ListAvailabilityZones(context.Background()).Execute() + region := regionValue + + resp, reqErr := apiClient.ListAvailabilityZones(context.Background(), region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3643,9 +4352,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListBackups", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/backups" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/backups" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -3683,8 +4394,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue - resp, reqErr := apiClient.ListBackups(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListBackups(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3695,9 +4407,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListImages", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/images" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/images" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -3735,8 +4449,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue - resp, reqErr := apiClient.ListImages(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListImages(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3747,7 +4462,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListKeyPairs", func(t *testing.T) { - _apiUrlPath := "/v1/keypairs" + _apiUrlPath := "/v2/keypairs" testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -3795,9 +4510,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListMachineTypes", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/machine-types" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/machine-types" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -3834,9 +4551,178 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue + projectId := projectIdValue + region := regionValue + + resp, reqErr := apiClient.ListMachineTypes(context.Background(), projectId, region).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListNetworkAreaProjects", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/projects" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := ProjectListResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaas_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + organizationId := organizationIdValue + areaId := areaIdValue + + resp, reqErr := apiClient.ListNetworkAreaProjects(context.Background(), organizationId, areaId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListNetworkAreaRanges", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := NetworkRangeListResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaas_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + + resp, reqErr := apiClient.ListNetworkAreaRanges(context.Background(), organizationId, areaId, region).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListNetworkAreaRegions", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := RegionalAreaListResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaas_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + organizationId := organizationIdValue + areaId := areaIdValue - resp, reqErr := apiClient.ListMachineTypes(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListNetworkAreaRegions(context.Background(), organizationId, areaId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3846,16 +4732,18 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListNetworkAreaProjects", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas/{areaId}/projects" + t.Run("Test DefaultApiService ListNetworkAreaRoutes", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes" organizationIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) areaIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ProjectListResponse{} + data := RouteListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3890,8 +4778,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { organizationId := organizationIdValue areaId := areaIdValue + region := regionValue - resp, reqErr := apiClient.ListNetworkAreaProjects(context.Background(), organizationId, areaId).Execute() + resp, reqErr := apiClient.ListNetworkAreaRoutes(context.Background(), organizationId, areaId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3901,16 +4790,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListNetworkAreaRanges", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" + t.Run("Test DefaultApiService ListNetworkAreas", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas" organizationIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NetworkRangeListResponse{} + data := NetworkAreaListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3944,9 +4831,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { } organizationId := organizationIdValue - areaId := areaIdValue - resp, reqErr := apiClient.ListNetworkAreaRanges(context.Background(), organizationId, areaId).Execute() + resp, reqErr := apiClient.ListNetworkAreas(context.Background(), organizationId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3956,16 +4842,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListNetworkAreaRoutes", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas/{areaId}/routes" - organizationIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + t.Run("Test DefaultApiService ListNetworks", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/networks" + projectIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := RouteListResponse{} + data := NetworkListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3998,10 +4884,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := organizationIdValue - areaId := areaIdValue + projectId := projectIdValue + region := regionValue - resp, reqErr := apiClient.ListNetworkAreaRoutes(context.Background(), organizationId, areaId).Execute() + resp, reqErr := apiClient.ListNetworks(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4011,14 +4897,18 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListNetworkAreas", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas" - organizationIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + t.Run("Test DefaultApiService ListNics", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics" + projectIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + networkIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NetworkAreaListResponse{} + data := NICListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -4051,9 +4941,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := organizationIdValue + projectId := projectIdValue + region := regionValue + networkId := networkIdValue - resp, reqErr := apiClient.ListNetworkAreas(context.Background(), organizationId).Execute() + resp, reqErr := apiClient.ListNics(context.Background(), projectId, region, networkId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4063,14 +4955,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListNetworks", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/networks" + t.Run("Test DefaultApiService ListProjectNICs", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/nics" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NetworkListResponse{} + data := NICListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -4104,8 +4998,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue - resp, reqErr := apiClient.ListNetworks(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListProjectNICs(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4115,16 +5010,12 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListNics", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/networks/{networkId}/nics" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + t.Run("Test DefaultApiService ListPublicIPRanges", func(t *testing.T) { + _apiUrlPath := "/v2/networks/public-ip-ranges" testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NICListResponse{} + data := PublicNetworkListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -4157,10 +5048,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - networkId := networkIdValue - - resp, reqErr := apiClient.ListNics(context.Background(), projectId, networkId).Execute() + resp, reqErr := apiClient.ListPublicIPRanges(context.Background()).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4170,14 +5058,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListProjectNICs", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/nics" + t.Run("Test DefaultApiService ListPublicIPs", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/public-ips" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NICListResponse{} + data := PublicIpListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -4211,8 +5101,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue - resp, reqErr := apiClient.ListProjectNICs(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListPublicIPs(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4222,12 +5113,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListPublicIPRanges", func(t *testing.T) { - _apiUrlPath := "/v1/networks/public-ip-ranges" + t.Run("Test DefaultApiService ListQuotas", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/quotas" + projectIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := PublicNetworkListResponse{} + data := QuotaListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -4260,7 +5155,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - resp, reqErr := apiClient.ListPublicIPRanges(context.Background()).Execute() + projectId := projectIdValue + region := regionValue + + resp, reqErr := apiClient.ListQuotas(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4270,14 +5168,20 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListPublicIPs", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/public-ips" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + t.Run("Test DefaultApiService ListRoutesOfRoutingTable", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + routingTableIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(routingTableIdValue, "routingTableId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := PublicIpListResponse{} + data := RouteListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -4310,9 +5214,12 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue - resp, reqErr := apiClient.ListPublicIPs(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListRoutesOfRoutingTable(context.Background(), organizationId, areaId, region, routingTableId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4322,14 +5229,18 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListQuotas", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/quotas" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + t.Run("Test DefaultApiService ListRoutingTablesOfArea", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := QuotaListResponse{} + data := RoutingTableListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -4362,9 +5273,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue - resp, reqErr := apiClient.ListQuotas(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListRoutingTablesOfArea(context.Background(), organizationId, areaId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4375,9 +5288,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListSecurityGroupRules", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) securityGroupIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) @@ -4417,9 +5332,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue securityGroupId := securityGroupIdValue - resp, reqErr := apiClient.ListSecurityGroupRules(context.Background(), projectId, securityGroupId).Execute() + resp, reqErr := apiClient.ListSecurityGroupRules(context.Background(), projectId, region, securityGroupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4430,9 +5346,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListSecurityGroups", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/security-groups" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/security-groups" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -4470,8 +5388,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue - resp, reqErr := apiClient.ListSecurityGroups(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListSecurityGroups(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4481,10 +5400,12 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListServerNics", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/nics" + t.Run("Test DefaultApiService ListServerNICs", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/nics" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -4524,9 +5445,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue - resp, reqErr := apiClient.ListServerNics(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.ListServerNICs(context.Background(), projectId, region, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4537,9 +5459,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListServerServiceAccounts", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/service-accounts" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -4579,9 +5503,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue - resp, reqErr := apiClient.ListServerServiceAccounts(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.ListServerServiceAccounts(context.Background(), projectId, region, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4592,9 +5517,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListServers", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -4632,8 +5559,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue - resp, reqErr := apiClient.ListServers(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListServers(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4643,10 +5571,12 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListSnapshots", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/snapshots" + t.Run("Test DefaultApiService ListSnapshotsInProject", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/snapshots" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -4684,8 +5614,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue - resp, reqErr := apiClient.ListSnapshots(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListSnapshotsInProject(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4696,9 +5627,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListVolumePerformanceClasses", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/volume-performance-classes" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/volume-performance-classes" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -4736,8 +5669,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue - resp, reqErr := apiClient.ListVolumePerformanceClasses(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListVolumePerformanceClasses(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4748,9 +5682,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListVolumes", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/volumes" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/volumes" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -4788,8 +5724,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue - resp, reqErr := apiClient.ListVolumes(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListVolumes(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4800,9 +5737,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService PartialUpdateNetwork", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/networks/{networkId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/networks/{networkId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) networkIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) @@ -4839,10 +5778,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue networkId := networkIdValue partialUpdateNetworkPayload := PartialUpdateNetworkPayload{} - reqErr := apiClient.PartialUpdateNetwork(context.Background(), projectId, networkId).PartialUpdateNetworkPayload(partialUpdateNetworkPayload).Execute() + reqErr := apiClient.PartialUpdateNetwork(context.Background(), projectId, region, networkId).PartialUpdateNetworkPayload(partialUpdateNetworkPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4850,7 +5790,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService PartialUpdateNetworkArea", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas/{areaId}" + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}" organizationIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) areaIdValue := randString(36) @@ -4906,9 +5846,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RebootServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/reboot" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/reboot" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -4945,9 +5887,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue - reqErr := apiClient.RebootServer(context.Background(), projectId, serverId).Execute() + reqErr := apiClient.RebootServer(context.Background(), projectId, region, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4955,9 +5898,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RemoveNetworkFromServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/networks/{networkId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) networkIdValue := randString(36) @@ -4996,10 +5941,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue networkId := networkIdValue - reqErr := apiClient.RemoveNetworkFromServer(context.Background(), projectId, serverId, networkId).Execute() + reqErr := apiClient.RemoveNetworkFromServer(context.Background(), projectId, region, serverId, networkId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5007,9 +5953,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RemoveNicFromServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/nics/{nicId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) nicIdValue := randString(36) @@ -5048,10 +5996,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue nicId := nicIdValue - reqErr := apiClient.RemoveNicFromServer(context.Background(), projectId, serverId, nicId).Execute() + reqErr := apiClient.RemoveNicFromServer(context.Background(), projectId, region, serverId, nicId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5059,9 +6008,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RemovePublicIpFromServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/public-ips/{publicIpId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) publicIpIdValue := randString(36) @@ -5100,10 +6051,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue publicIpId := publicIpIdValue - reqErr := apiClient.RemovePublicIpFromServer(context.Background(), projectId, serverId, publicIpId).Execute() + reqErr := apiClient.RemovePublicIpFromServer(context.Background(), projectId, region, serverId, publicIpId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5111,9 +6063,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RemoveSecurityGroupFromServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/security-groups/{securityGroupId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) securityGroupIdValue := randString(36) @@ -5152,10 +6106,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue securityGroupId := securityGroupIdValue - reqErr := apiClient.RemoveSecurityGroupFromServer(context.Background(), projectId, serverId, securityGroupId).Execute() + reqErr := apiClient.RemoveSecurityGroupFromServer(context.Background(), projectId, region, serverId, securityGroupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5163,9 +6118,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RemoveServiceAccountFromServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts/{serviceAccountMail}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) serviceAccountMailValue := randString(255) @@ -5207,10 +6164,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue serviceAccountMail := serviceAccountMailValue - resp, reqErr := apiClient.RemoveServiceAccountFromServer(context.Background(), projectId, serverId, serviceAccountMail).Execute() + resp, reqErr := apiClient.RemoveServiceAccountFromServer(context.Background(), projectId, region, serverId, serviceAccountMail).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5221,9 +6179,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RemoveVolumeFromServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) volumeIdValue := randString(36) @@ -5262,10 +6222,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue volumeId := volumeIdValue - reqErr := apiClient.RemoveVolumeFromServer(context.Background(), projectId, serverId, volumeId).Execute() + reqErr := apiClient.RemoveVolumeFromServer(context.Background(), projectId, region, serverId, volumeId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5273,9 +6234,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RescueServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/rescue" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/rescue" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -5312,10 +6275,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue rescueServerPayload := RescueServerPayload{} - reqErr := apiClient.RescueServer(context.Background(), projectId, serverId).RescueServerPayload(rescueServerPayload).Execute() + reqErr := apiClient.RescueServer(context.Background(), projectId, region, serverId).RescueServerPayload(rescueServerPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5323,9 +6287,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ResizeServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/resize" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/resize" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -5362,10 +6328,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue resizeServerPayload := ResizeServerPayload{} - reqErr := apiClient.ResizeServer(context.Background(), projectId, serverId).ResizeServerPayload(resizeServerPayload).Execute() + reqErr := apiClient.ResizeServer(context.Background(), projectId, region, serverId).ResizeServerPayload(resizeServerPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5373,9 +6340,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ResizeVolume", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/volumes/{volumeId}/resize" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}/resize" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) volumeIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) @@ -5412,9 +6381,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue volumeId := volumeIdValue - reqErr := apiClient.ResizeVolume(context.Background(), projectId, volumeId).Execute() + reqErr := apiClient.ResizeVolume(context.Background(), projectId, region, volumeId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5422,9 +6392,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RestoreBackup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/backups/{backupId}/restore" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/backups/{backupId}/restore" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) backupIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) @@ -5461,9 +6433,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue backupId := backupIdValue - reqErr := apiClient.RestoreBackup(context.Background(), projectId, backupId).Execute() + reqErr := apiClient.RestoreBackup(context.Background(), projectId, region, backupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5471,9 +6444,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService SetImageShare", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/images/{imageId}/share" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) imageIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) @@ -5513,10 +6488,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue imageId := imageIdValue setImageSharePayload := SetImageSharePayload{} - resp, reqErr := apiClient.SetImageShare(context.Background(), projectId, imageId).SetImageSharePayload(setImageSharePayload).Execute() + resp, reqErr := apiClient.SetImageShare(context.Background(), projectId, region, imageId).SetImageSharePayload(setImageSharePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5527,9 +6503,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService StartServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/start" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/start" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -5566,9 +6544,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue - reqErr := apiClient.StartServer(context.Background(), projectId, serverId).Execute() + reqErr := apiClient.StartServer(context.Background(), projectId, region, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5576,9 +6555,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService StopServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/stop" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/stop" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -5615,9 +6596,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue - reqErr := apiClient.StopServer(context.Background(), projectId, serverId).Execute() + reqErr := apiClient.StopServer(context.Background(), projectId, region, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5625,9 +6607,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UnrescueServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/unrescue" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/unrescue" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -5664,9 +6648,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue - reqErr := apiClient.UnrescueServer(context.Background(), projectId, serverId).Execute() + reqErr := apiClient.UnrescueServer(context.Background(), projectId, region, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5674,9 +6659,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateAttachedVolume", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) volumeIdValue := randString(36) @@ -5718,11 +6705,12 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue volumeId := volumeIdValue updateAttachedVolumePayload := UpdateAttachedVolumePayload{} - resp, reqErr := apiClient.UpdateAttachedVolume(context.Background(), projectId, serverId, volumeId).UpdateAttachedVolumePayload(updateAttachedVolumePayload).Execute() + resp, reqErr := apiClient.UpdateAttachedVolume(context.Background(), projectId, region, serverId, volumeId).UpdateAttachedVolumePayload(updateAttachedVolumePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5733,9 +6721,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateBackup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/backups/{backupId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/backups/{backupId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) backupIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) @@ -5775,10 +6765,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue backupId := backupIdValue updateBackupPayload := UpdateBackupPayload{} - resp, reqErr := apiClient.UpdateBackup(context.Background(), projectId, backupId).UpdateBackupPayload(updateBackupPayload).Execute() + resp, reqErr := apiClient.UpdateBackup(context.Background(), projectId, region, backupId).UpdateBackupPayload(updateBackupPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5789,9 +6780,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateImage", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/images/{imageId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/images/{imageId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) imageIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) @@ -5831,10 +6824,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue imageId := imageIdValue updateImagePayload := UpdateImagePayload{} - resp, reqErr := apiClient.UpdateImage(context.Background(), projectId, imageId).UpdateImagePayload(updateImagePayload).Execute() + resp, reqErr := apiClient.UpdateImage(context.Background(), projectId, region, imageId).UpdateImagePayload(updateImagePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5844,16 +6838,18 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateImageScopeLocal", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/images/{imageId}/publish" + t.Run("Test DefaultApiService UpdateImageShare", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) imageIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Image{} + data := ImageShare{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -5887,9 +6883,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue imageId := imageIdValue + updateImageSharePayload := UpdateImageSharePayload{} - resp, reqErr := apiClient.UpdateImageScopeLocal(context.Background(), projectId, imageId).Execute() + resp, reqErr := apiClient.UpdateImageShare(context.Background(), projectId, region, imageId).UpdateImageSharePayload(updateImageSharePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5899,16 +6897,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateImageScopePublic", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/images/{imageId}/publish" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - imageIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + t.Run("Test DefaultApiService UpdateKeyPair", func(t *testing.T) { + _apiUrlPath := "/v2/keypairs/{keypairName}" + keypairNameValue := randString(127) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Image{} + data := Keypair{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -5941,10 +6937,10 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - imageId := imageIdValue + keypairName := keypairNameValue + updateKeyPairPayload := UpdateKeyPairPayload{} - resp, reqErr := apiClient.UpdateImageScopePublic(context.Background(), projectId, imageId).Execute() + resp, reqErr := apiClient.UpdateKeyPair(context.Background(), keypairName).UpdateKeyPairPayload(updateKeyPairPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -5954,16 +6950,18 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateImageShare", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/images/{imageId}/share" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - imageIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + t.Run("Test DefaultApiService UpdateNetworkAreaRegion", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ImageShare{} + data := RegionalArea{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -5996,11 +6994,12 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - imageId := imageIdValue - updateImageSharePayload := UpdateImageSharePayload{} + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + updateNetworkAreaRegionPayload := UpdateNetworkAreaRegionPayload{} - resp, reqErr := apiClient.UpdateImageShare(context.Background(), projectId, imageId).UpdateImageSharePayload(updateImageSharePayload).Execute() + resp, reqErr := apiClient.UpdateNetworkAreaRegion(context.Background(), organizationId, areaId, region).UpdateNetworkAreaRegionPayload(updateNetworkAreaRegionPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6010,14 +7009,20 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateKeyPair", func(t *testing.T) { - _apiUrlPath := "/v1/keypairs/{keypairName}" - keypairNameValue := randString(127) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) + t.Run("Test DefaultApiService UpdateNetworkAreaRoute", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + routeIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Keypair{} + data := Route{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6050,10 +7055,13 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - keypairName := keypairNameValue - updateKeyPairPayload := UpdateKeyPairPayload{} + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routeId := routeIdValue + updateNetworkAreaRoutePayload := UpdateNetworkAreaRoutePayload{} - resp, reqErr := apiClient.UpdateKeyPair(context.Background(), keypairName).UpdateKeyPairPayload(updateKeyPairPayload).Execute() + resp, reqErr := apiClient.UpdateNetworkAreaRoute(context.Background(), organizationId, areaId, region, routeId).UpdateNetworkAreaRoutePayload(updateNetworkAreaRoutePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6063,18 +7071,20 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateNetworkAreaRoute", func(t *testing.T) { - _apiUrlPath := "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" - organizationIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) - routeIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -1) + t.Run("Test DefaultApiService UpdateNic", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" + projectIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + networkIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + nicIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Route{} + data := NIC{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6107,12 +7117,13 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := organizationIdValue - areaId := areaIdValue - routeId := routeIdValue - updateNetworkAreaRoutePayload := UpdateNetworkAreaRoutePayload{} + projectId := projectIdValue + region := regionValue + networkId := networkIdValue + nicId := nicIdValue + updateNicPayload := UpdateNicPayload{} - resp, reqErr := apiClient.UpdateNetworkAreaRoute(context.Background(), organizationId, areaId, routeId).UpdateNetworkAreaRoutePayload(updateNetworkAreaRoutePayload).Execute() + resp, reqErr := apiClient.UpdateNic(context.Background(), projectId, region, networkId, nicId).UpdateNicPayload(updateNicPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6122,18 +7133,18 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateNic", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + t.Run("Test DefaultApiService UpdatePublicIP", func(t *testing.T) { + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) - nicIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + publicIpIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := NIC{} + data := PublicIp{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6167,11 +7178,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue - networkId := networkIdValue - nicId := nicIdValue - updateNicPayload := UpdateNicPayload{} + region := regionValue + publicIpId := publicIpIdValue + updatePublicIPPayload := UpdatePublicIPPayload{} - resp, reqErr := apiClient.UpdateNic(context.Background(), projectId, networkId, nicId).UpdateNicPayload(updateNicPayload).Execute() + resp, reqErr := apiClient.UpdatePublicIP(context.Background(), projectId, region, publicIpId).UpdatePublicIPPayload(updatePublicIPPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6181,16 +7192,22 @@ func Test_iaas_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdatePublicIP", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/public-ips/{publicIpId}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - publicIpIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) + t.Run("Test DefaultApiService UpdateRouteOfRoutingTable", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + routingTableIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(routingTableIdValue, "routingTableId")), -1) + routeIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := PublicIp{} + data := Route{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -6223,11 +7240,76 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := projectIdValue - publicIpId := publicIpIdValue - updatePublicIPPayload := UpdatePublicIPPayload{} + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue + routeId := routeIdValue + updateRouteOfRoutingTablePayload := UpdateRouteOfRoutingTablePayload{} + + resp, reqErr := apiClient.UpdateRouteOfRoutingTable(context.Background(), organizationId, areaId, region, routingTableId, routeId).UpdateRouteOfRoutingTablePayload(updateRouteOfRoutingTablePayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService UpdateRoutingTableOfArea", func(t *testing.T) { + _apiUrlPath := "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + organizationIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + routingTableIdValue := randString(36) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routingTableId"+"}", url.PathEscape(ParameterValueToString(routingTableIdValue, "routingTableId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := RoutingTable{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaas_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + organizationId := organizationIdValue + areaId := areaIdValue + region := regionValue + routingTableId := routingTableIdValue + updateRoutingTableOfAreaPayload := UpdateRoutingTableOfAreaPayload{} - resp, reqErr := apiClient.UpdatePublicIP(context.Background(), projectId, publicIpId).UpdatePublicIPPayload(updatePublicIPPayload).Execute() + resp, reqErr := apiClient.UpdateRoutingTableOfArea(context.Background(), organizationId, areaId, region, routingTableId).UpdateRoutingTableOfAreaPayload(updateRoutingTableOfAreaPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6238,9 +7320,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateSecurityGroup", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/security-groups/{securityGroupId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) securityGroupIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) @@ -6280,10 +7364,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue securityGroupId := securityGroupIdValue updateSecurityGroupPayload := UpdateSecurityGroupPayload{} - resp, reqErr := apiClient.UpdateSecurityGroup(context.Background(), projectId, securityGroupId).UpdateSecurityGroupPayload(updateSecurityGroupPayload).Execute() + resp, reqErr := apiClient.UpdateSecurityGroup(context.Background(), projectId, region, securityGroupId).UpdateSecurityGroupPayload(updateSecurityGroupPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6294,9 +7379,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateServer", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/servers/{serverId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) @@ -6336,10 +7423,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue serverId := serverIdValue updateServerPayload := UpdateServerPayload{} - resp, reqErr := apiClient.UpdateServer(context.Background(), projectId, serverId).UpdateServerPayload(updateServerPayload).Execute() + resp, reqErr := apiClient.UpdateServer(context.Background(), projectId, region, serverId).UpdateServerPayload(updateServerPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6350,9 +7438,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateSnapshot", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/snapshots/{snapshotId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) snapshotIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(snapshotIdValue, "snapshotId")), -1) @@ -6392,10 +7482,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue snapshotId := snapshotIdValue updateSnapshotPayload := UpdateSnapshotPayload{} - resp, reqErr := apiClient.UpdateSnapshot(context.Background(), projectId, snapshotId).UpdateSnapshotPayload(updateSnapshotPayload).Execute() + resp, reqErr := apiClient.UpdateSnapshot(context.Background(), projectId, region, snapshotId).UpdateSnapshotPayload(updateSnapshotPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -6406,9 +7497,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateVolume", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/volumes/{volumeId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) volumeIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) @@ -6448,10 +7541,11 @@ func Test_iaas_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue volumeId := volumeIdValue updateVolumePayload := UpdateVolumePayload{} - resp, reqErr := apiClient.UpdateVolume(context.Background(), projectId, volumeId).UpdateVolumePayload(updateVolumePayload).Execute() + resp, reqErr := apiClient.UpdateVolume(context.Background(), projectId, region, volumeId).UpdateVolumePayload(updateVolumePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) diff --git a/services/iaas/client.go b/services/iaas/client.go index 97b97dc58..60e072679 100644 --- a/services/iaas/client.go +++ b/services/iaas/client.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the IaaS-API API v1 +// APIClient manages communication with the IaaS-API API v2 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration diff --git a/services/iaas/configuration.go b/services/iaas/configuration.go index 14bf49eab..b20c092ec 100644 --- a/services/iaas/configuration.go +++ b/services/iaas/configuration.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,15 +22,12 @@ func NewConfiguration() *config.Configuration { Debug: false, Servers: config.ServerConfigurations{ { - URL: "https://iaas.api.{region}stackit.cloud", + URL: "https://iaas.api.stackit.cloud", Description: "No description provided", Variables: map[string]config.ServerVariable{ "region": { Description: "No description provided", - DefaultValue: "eu01.", - EnumValues: []string{ - "eu01.", - }, + DefaultValue: "global", }, }, }, diff --git a/services/iaas/model_add_routes_to_routing_table_payload.go b/services/iaas/model_add_routes_to_routing_table_payload.go new file mode 100644 index 000000000..00592a7eb --- /dev/null +++ b/services/iaas/model_add_routes_to_routing_table_payload.go @@ -0,0 +1,126 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the AddRoutesToRoutingTablePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddRoutesToRoutingTablePayload{} + +/* + types and functions for items +*/ + +// isArray +type AddRoutesToRoutingTablePayloadGetItemsAttributeType = *[]Route +type AddRoutesToRoutingTablePayloadGetItemsArgType = []Route +type AddRoutesToRoutingTablePayloadGetItemsRetType = []Route + +func getAddRoutesToRoutingTablePayloadGetItemsAttributeTypeOk(arg AddRoutesToRoutingTablePayloadGetItemsAttributeType) (ret AddRoutesToRoutingTablePayloadGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAddRoutesToRoutingTablePayloadGetItemsAttributeType(arg *AddRoutesToRoutingTablePayloadGetItemsAttributeType, val AddRoutesToRoutingTablePayloadGetItemsRetType) { + *arg = &val +} + +// AddRoutesToRoutingTablePayload Object represents a request to add network routes. +type AddRoutesToRoutingTablePayload struct { + // A list of routes. + // REQUIRED + Items AddRoutesToRoutingTablePayloadGetItemsAttributeType `json:"items" required:"true"` +} + +type _AddRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload + +// NewAddRoutesToRoutingTablePayload instantiates a new AddRoutesToRoutingTablePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddRoutesToRoutingTablePayload(items AddRoutesToRoutingTablePayloadGetItemsArgType) *AddRoutesToRoutingTablePayload { + this := AddRoutesToRoutingTablePayload{} + setAddRoutesToRoutingTablePayloadGetItemsAttributeType(&this.Items, items) + return &this +} + +// NewAddRoutesToRoutingTablePayloadWithDefaults instantiates a new AddRoutesToRoutingTablePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddRoutesToRoutingTablePayloadWithDefaults() *AddRoutesToRoutingTablePayload { + this := AddRoutesToRoutingTablePayload{} + return &this +} + +// GetItems returns the Items field value +func (o *AddRoutesToRoutingTablePayload) GetItems() (ret AddRoutesToRoutingTablePayloadGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *AddRoutesToRoutingTablePayload) GetItemsOk() (ret AddRoutesToRoutingTablePayloadGetItemsRetType, ok bool) { + return getAddRoutesToRoutingTablePayloadGetItemsAttributeTypeOk(o.Items) +} + +// SetItems sets field value +func (o *AddRoutesToRoutingTablePayload) SetItems(v AddRoutesToRoutingTablePayloadGetItemsRetType) { + setAddRoutesToRoutingTablePayloadGetItemsAttributeType(&o.Items, v) +} + +func (o AddRoutesToRoutingTablePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getAddRoutesToRoutingTablePayloadGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } + return toSerialize, nil +} + +type NullableAddRoutesToRoutingTablePayload struct { + value *AddRoutesToRoutingTablePayload + isSet bool +} + +func (v NullableAddRoutesToRoutingTablePayload) Get() *AddRoutesToRoutingTablePayload { + return v.value +} + +func (v *NullableAddRoutesToRoutingTablePayload) Set(val *AddRoutesToRoutingTablePayload) { + v.value = val + v.isSet = true +} + +func (v NullableAddRoutesToRoutingTablePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableAddRoutesToRoutingTablePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddRoutesToRoutingTablePayload(val *AddRoutesToRoutingTablePayload) *NullableAddRoutesToRoutingTablePayload { + return &NullableAddRoutesToRoutingTablePayload{value: val, isSet: true} +} + +func (v NullableAddRoutesToRoutingTablePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddRoutesToRoutingTablePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_add_routes_to_routing_table_payload_test.go b/services/iaas/model_add_routes_to_routing_table_payload_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_add_routes_to_routing_table_payload_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_add_routing_table_to_area_payload.go b/services/iaas/model_add_routing_table_to_area_payload.go new file mode 100644 index 000000000..3564d435d --- /dev/null +++ b/services/iaas/model_add_routing_table_to_area_payload.go @@ -0,0 +1,517 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" + "time" +) + +// checks if the AddRoutingTableToAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddRoutingTableToAreaPayload{} + +/* + types and functions for createdAt +*/ + +// isDateTime +type AddRoutingTableToAreaPayloadGetCreatedAtAttributeType = *time.Time +type AddRoutingTableToAreaPayloadGetCreatedAtArgType = time.Time +type AddRoutingTableToAreaPayloadGetCreatedAtRetType = time.Time + +func getAddRoutingTableToAreaPayloadGetCreatedAtAttributeTypeOk(arg AddRoutingTableToAreaPayloadGetCreatedAtAttributeType) (ret AddRoutingTableToAreaPayloadGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAddRoutingTableToAreaPayloadGetCreatedAtAttributeType(arg *AddRoutingTableToAreaPayloadGetCreatedAtAttributeType, val AddRoutingTableToAreaPayloadGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for default +*/ + +// isBoolean +type AddRoutingTableToAreaPayloadgetDefaultAttributeType = *bool +type AddRoutingTableToAreaPayloadgetDefaultArgType = bool +type AddRoutingTableToAreaPayloadgetDefaultRetType = bool + +func getAddRoutingTableToAreaPayloadgetDefaultAttributeTypeOk(arg AddRoutingTableToAreaPayloadgetDefaultAttributeType) (ret AddRoutingTableToAreaPayloadgetDefaultRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAddRoutingTableToAreaPayloadgetDefaultAttributeType(arg *AddRoutingTableToAreaPayloadgetDefaultAttributeType, val AddRoutingTableToAreaPayloadgetDefaultRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type AddRoutingTableToAreaPayloadGetDescriptionAttributeType = *string + +func getAddRoutingTableToAreaPayloadGetDescriptionAttributeTypeOk(arg AddRoutingTableToAreaPayloadGetDescriptionAttributeType) (ret AddRoutingTableToAreaPayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAddRoutingTableToAreaPayloadGetDescriptionAttributeType(arg *AddRoutingTableToAreaPayloadGetDescriptionAttributeType, val AddRoutingTableToAreaPayloadGetDescriptionRetType) { + *arg = &val +} + +type AddRoutingTableToAreaPayloadGetDescriptionArgType = string +type AddRoutingTableToAreaPayloadGetDescriptionRetType = string + +/* + types and functions for dynamicRoutes +*/ + +// isBoolean +type AddRoutingTableToAreaPayloadgetDynamicRoutesAttributeType = *bool +type AddRoutingTableToAreaPayloadgetDynamicRoutesArgType = bool +type AddRoutingTableToAreaPayloadgetDynamicRoutesRetType = bool + +func getAddRoutingTableToAreaPayloadgetDynamicRoutesAttributeTypeOk(arg AddRoutingTableToAreaPayloadgetDynamicRoutesAttributeType) (ret AddRoutingTableToAreaPayloadgetDynamicRoutesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAddRoutingTableToAreaPayloadgetDynamicRoutesAttributeType(arg *AddRoutingTableToAreaPayloadgetDynamicRoutesAttributeType, val AddRoutingTableToAreaPayloadgetDynamicRoutesRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type AddRoutingTableToAreaPayloadGetIdAttributeType = *string + +func getAddRoutingTableToAreaPayloadGetIdAttributeTypeOk(arg AddRoutingTableToAreaPayloadGetIdAttributeType) (ret AddRoutingTableToAreaPayloadGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAddRoutingTableToAreaPayloadGetIdAttributeType(arg *AddRoutingTableToAreaPayloadGetIdAttributeType, val AddRoutingTableToAreaPayloadGetIdRetType) { + *arg = &val +} + +type AddRoutingTableToAreaPayloadGetIdArgType = string +type AddRoutingTableToAreaPayloadGetIdRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type AddRoutingTableToAreaPayloadGetLabelsAttributeType = *map[string]interface{} +type AddRoutingTableToAreaPayloadGetLabelsArgType = map[string]interface{} +type AddRoutingTableToAreaPayloadGetLabelsRetType = map[string]interface{} + +func getAddRoutingTableToAreaPayloadGetLabelsAttributeTypeOk(arg AddRoutingTableToAreaPayloadGetLabelsAttributeType) (ret AddRoutingTableToAreaPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAddRoutingTableToAreaPayloadGetLabelsAttributeType(arg *AddRoutingTableToAreaPayloadGetLabelsAttributeType, val AddRoutingTableToAreaPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type AddRoutingTableToAreaPayloadGetNameAttributeType = *string + +func getAddRoutingTableToAreaPayloadGetNameAttributeTypeOk(arg AddRoutingTableToAreaPayloadGetNameAttributeType) (ret AddRoutingTableToAreaPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAddRoutingTableToAreaPayloadGetNameAttributeType(arg *AddRoutingTableToAreaPayloadGetNameAttributeType, val AddRoutingTableToAreaPayloadGetNameRetType) { + *arg = &val +} + +type AddRoutingTableToAreaPayloadGetNameArgType = string +type AddRoutingTableToAreaPayloadGetNameRetType = string + +/* + types and functions for systemRoutes +*/ + +// isBoolean +type AddRoutingTableToAreaPayloadgetSystemRoutesAttributeType = *bool +type AddRoutingTableToAreaPayloadgetSystemRoutesArgType = bool +type AddRoutingTableToAreaPayloadgetSystemRoutesRetType = bool + +func getAddRoutingTableToAreaPayloadgetSystemRoutesAttributeTypeOk(arg AddRoutingTableToAreaPayloadgetSystemRoutesAttributeType) (ret AddRoutingTableToAreaPayloadgetSystemRoutesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAddRoutingTableToAreaPayloadgetSystemRoutesAttributeType(arg *AddRoutingTableToAreaPayloadgetSystemRoutesAttributeType, val AddRoutingTableToAreaPayloadgetSystemRoutesRetType) { + *arg = &val +} + +/* + types and functions for updatedAt +*/ + +// isDateTime +type AddRoutingTableToAreaPayloadGetUpdatedAtAttributeType = *time.Time +type AddRoutingTableToAreaPayloadGetUpdatedAtArgType = time.Time +type AddRoutingTableToAreaPayloadGetUpdatedAtRetType = time.Time + +func getAddRoutingTableToAreaPayloadGetUpdatedAtAttributeTypeOk(arg AddRoutingTableToAreaPayloadGetUpdatedAtAttributeType) (ret AddRoutingTableToAreaPayloadGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAddRoutingTableToAreaPayloadGetUpdatedAtAttributeType(arg *AddRoutingTableToAreaPayloadGetUpdatedAtAttributeType, val AddRoutingTableToAreaPayloadGetUpdatedAtRetType) { + *arg = &val +} + +// AddRoutingTableToAreaPayload An object representing a routing table. +type AddRoutingTableToAreaPayload struct { + // Date-time when resource was created. + CreatedAt AddRoutingTableToAreaPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // This is the default routing table. It can't be deleted and is used if the user does not specify it otherwise. + Default AddRoutingTableToAreaPayloadgetDefaultAttributeType `json:"default,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description AddRoutingTableToAreaPayloadGetDescriptionAttributeType `json:"description,omitempty"` + // A config setting for a routing table which allows propagation of dynamic routes to this routing table. + DynamicRoutes AddRoutingTableToAreaPayloadgetDynamicRoutesAttributeType `json:"dynamicRoutes,omitempty"` + // Universally Unique Identifier (UUID). + Id AddRoutingTableToAreaPayloadGetIdAttributeType `json:"id,omitempty"` + // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. + Labels AddRoutingTableToAreaPayloadGetLabelsAttributeType `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + // REQUIRED + Name AddRoutingTableToAreaPayloadGetNameAttributeType `json:"name" required:"true"` + SystemRoutes AddRoutingTableToAreaPayloadgetSystemRoutesAttributeType `json:"systemRoutes,omitempty"` + // Date-time when resource was last updated. + UpdatedAt AddRoutingTableToAreaPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` +} + +type _AddRoutingTableToAreaPayload AddRoutingTableToAreaPayload + +// NewAddRoutingTableToAreaPayload instantiates a new AddRoutingTableToAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddRoutingTableToAreaPayload(name AddRoutingTableToAreaPayloadGetNameArgType) *AddRoutingTableToAreaPayload { + this := AddRoutingTableToAreaPayload{} + setAddRoutingTableToAreaPayloadGetNameAttributeType(&this.Name, name) + return &this +} + +// NewAddRoutingTableToAreaPayloadWithDefaults instantiates a new AddRoutingTableToAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddRoutingTableToAreaPayloadWithDefaults() *AddRoutingTableToAreaPayload { + this := AddRoutingTableToAreaPayload{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetCreatedAt() (res AddRoutingTableToAreaPayloadGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetCreatedAtOk() (ret AddRoutingTableToAreaPayloadGetCreatedAtRetType, ok bool) { + return getAddRoutingTableToAreaPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AddRoutingTableToAreaPayload) SetCreatedAt(v AddRoutingTableToAreaPayloadGetCreatedAtRetType) { + setAddRoutingTableToAreaPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetDefault() (res AddRoutingTableToAreaPayloadgetDefaultRetType) { + res, _ = o.GetDefaultOk() + return +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetDefaultOk() (ret AddRoutingTableToAreaPayloadgetDefaultRetType, ok bool) { + return getAddRoutingTableToAreaPayloadgetDefaultAttributeTypeOk(o.Default) +} + +// HasDefault returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasDefault() bool { + _, ok := o.GetDefaultOk() + return ok +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *AddRoutingTableToAreaPayload) SetDefault(v AddRoutingTableToAreaPayloadgetDefaultRetType) { + setAddRoutingTableToAreaPayloadgetDefaultAttributeType(&o.Default, v) +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetDescription() (res AddRoutingTableToAreaPayloadGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetDescriptionOk() (ret AddRoutingTableToAreaPayloadGetDescriptionRetType, ok bool) { + return getAddRoutingTableToAreaPayloadGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AddRoutingTableToAreaPayload) SetDescription(v AddRoutingTableToAreaPayloadGetDescriptionRetType) { + setAddRoutingTableToAreaPayloadGetDescriptionAttributeType(&o.Description, v) +} + +// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetDynamicRoutes() (res AddRoutingTableToAreaPayloadgetDynamicRoutesRetType) { + res, _ = o.GetDynamicRoutesOk() + return +} + +// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetDynamicRoutesOk() (ret AddRoutingTableToAreaPayloadgetDynamicRoutesRetType, ok bool) { + return getAddRoutingTableToAreaPayloadgetDynamicRoutesAttributeTypeOk(o.DynamicRoutes) +} + +// HasDynamicRoutes returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasDynamicRoutes() bool { + _, ok := o.GetDynamicRoutesOk() + return ok +} + +// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +func (o *AddRoutingTableToAreaPayload) SetDynamicRoutes(v AddRoutingTableToAreaPayloadgetDynamicRoutesRetType) { + setAddRoutingTableToAreaPayloadgetDynamicRoutesAttributeType(&o.DynamicRoutes, v) +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetId() (res AddRoutingTableToAreaPayloadGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetIdOk() (ret AddRoutingTableToAreaPayloadGetIdRetType, ok bool) { + return getAddRoutingTableToAreaPayloadGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *AddRoutingTableToAreaPayload) SetId(v AddRoutingTableToAreaPayloadGetIdRetType) { + setAddRoutingTableToAreaPayloadGetIdAttributeType(&o.Id, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetLabels() (res AddRoutingTableToAreaPayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetLabelsOk() (ret AddRoutingTableToAreaPayloadGetLabelsRetType, ok bool) { + return getAddRoutingTableToAreaPayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *AddRoutingTableToAreaPayload) SetLabels(v AddRoutingTableToAreaPayloadGetLabelsRetType) { + setAddRoutingTableToAreaPayloadGetLabelsAttributeType(&o.Labels, v) +} + +// GetName returns the Name field value +func (o *AddRoutingTableToAreaPayload) GetName() (ret AddRoutingTableToAreaPayloadGetNameRetType) { + ret, _ = o.GetNameOk() + return ret +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetNameOk() (ret AddRoutingTableToAreaPayloadGetNameRetType, ok bool) { + return getAddRoutingTableToAreaPayloadGetNameAttributeTypeOk(o.Name) +} + +// SetName sets field value +func (o *AddRoutingTableToAreaPayload) SetName(v AddRoutingTableToAreaPayloadGetNameRetType) { + setAddRoutingTableToAreaPayloadGetNameAttributeType(&o.Name, v) +} + +// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetSystemRoutes() (res AddRoutingTableToAreaPayloadgetSystemRoutesRetType) { + res, _ = o.GetSystemRoutesOk() + return +} + +// GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetSystemRoutesOk() (ret AddRoutingTableToAreaPayloadgetSystemRoutesRetType, ok bool) { + return getAddRoutingTableToAreaPayloadgetSystemRoutesAttributeTypeOk(o.SystemRoutes) +} + +// HasSystemRoutes returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasSystemRoutes() bool { + _, ok := o.GetSystemRoutesOk() + return ok +} + +// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +func (o *AddRoutingTableToAreaPayload) SetSystemRoutes(v AddRoutingTableToAreaPayloadgetSystemRoutesRetType) { + setAddRoutingTableToAreaPayloadgetSystemRoutesAttributeType(&o.SystemRoutes, v) +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetUpdatedAt() (res AddRoutingTableToAreaPayloadGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetUpdatedAtOk() (ret AddRoutingTableToAreaPayloadGetUpdatedAtRetType, ok bool) { + return getAddRoutingTableToAreaPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasUpdatedAt() bool { + _, ok := o.GetUpdatedAtOk() + return ok +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *AddRoutingTableToAreaPayload) SetUpdatedAt(v AddRoutingTableToAreaPayloadGetUpdatedAtRetType) { + setAddRoutingTableToAreaPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) +} + +func (o AddRoutingTableToAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getAddRoutingTableToAreaPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getAddRoutingTableToAreaPayloadgetDefaultAttributeTypeOk(o.Default); ok { + toSerialize["Default"] = val + } + if val, ok := getAddRoutingTableToAreaPayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getAddRoutingTableToAreaPayloadgetDynamicRoutesAttributeTypeOk(o.DynamicRoutes); ok { + toSerialize["DynamicRoutes"] = val + } + if val, ok := getAddRoutingTableToAreaPayloadGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getAddRoutingTableToAreaPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getAddRoutingTableToAreaPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getAddRoutingTableToAreaPayloadgetSystemRoutesAttributeTypeOk(o.SystemRoutes); ok { + toSerialize["SystemRoutes"] = val + } + if val, ok := getAddRoutingTableToAreaPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val + } + return toSerialize, nil +} + +type NullableAddRoutingTableToAreaPayload struct { + value *AddRoutingTableToAreaPayload + isSet bool +} + +func (v NullableAddRoutingTableToAreaPayload) Get() *AddRoutingTableToAreaPayload { + return v.value +} + +func (v *NullableAddRoutingTableToAreaPayload) Set(val *AddRoutingTableToAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableAddRoutingTableToAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableAddRoutingTableToAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddRoutingTableToAreaPayload(val *AddRoutingTableToAreaPayload) *NullableAddRoutingTableToAreaPayload { + return &NullableAddRoutingTableToAreaPayload{value: val, isSet: true} +} + +func (v NullableAddRoutingTableToAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddRoutingTableToAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_add_routing_table_to_area_payload_test.go b/services/iaas/model_add_routing_table_to_area_payload_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_add_routing_table_to_area_payload_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_add_volume_to_server_payload.go b/services/iaas/model_add_volume_to_server_payload.go index 5c50e14b0..bf313878a 100644 --- a/services/iaas/model_add_volume_to_server_payload.go +++ b/services/iaas/model_add_volume_to_server_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_add_volume_to_server_payload_test.go b/services/iaas/model_add_volume_to_server_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_add_volume_to_server_payload_test.go +++ b/services/iaas/model_add_volume_to_server_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_affinity_group.go b/services/iaas/model_affinity_group.go index 31edab77f..9e5dac4fc 100644 --- a/services/iaas/model_affinity_group.go +++ b/services/iaas/model_affinity_group.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_affinity_group_list_response.go b/services/iaas/model_affinity_group_list_response.go index 2901a7466..5aaa44730 100644 --- a/services/iaas/model_affinity_group_list_response.go +++ b/services/iaas/model_affinity_group_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_affinity_group_list_response_test.go b/services/iaas/model_affinity_group_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_affinity_group_list_response_test.go +++ b/services/iaas/model_affinity_group_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_affinity_group_test.go b/services/iaas/model_affinity_group_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_affinity_group_test.go +++ b/services/iaas/model_affinity_group_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_allowed_addresses_inner.go b/services/iaas/model_allowed_addresses_inner.go index 6dc39258b..02e6f4d8d 100644 --- a/services/iaas/model_allowed_addresses_inner.go +++ b/services/iaas/model_allowed_addresses_inner.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_allowed_addresses_inner_test.go b/services/iaas/model_allowed_addresses_inner_test.go index ce31523dd..fa32364f1 100644 --- a/services/iaas/model_allowed_addresses_inner_test.go +++ b/services/iaas/model_allowed_addresses_inner_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_area_id.go b/services/iaas/model_area_id.go index b27e8bea8..ec835bf97 100644 --- a/services/iaas/model_area_id.go +++ b/services/iaas/model_area_id.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_area_id_test.go b/services/iaas/model_area_id_test.go index e6412b94a..92ab3ca3d 100644 --- a/services/iaas/model_area_id_test.go +++ b/services/iaas/model_area_id_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_availability_zone_list_response.go b/services/iaas/model_availability_zone_list_response.go index e65a3fa0c..34146090d 100644 --- a/services/iaas/model_availability_zone_list_response.go +++ b/services/iaas/model_availability_zone_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_availability_zone_list_response_test.go b/services/iaas/model_availability_zone_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_availability_zone_list_response_test.go +++ b/services/iaas/model_availability_zone_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_backup.go b/services/iaas/model_backup.go index d9be5a336..ad9bd7134 100644 --- a/services/iaas/model_backup.go +++ b/services/iaas/model_backup.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_backup_list_response.go b/services/iaas/model_backup_list_response.go index de964b885..8181daa1e 100644 --- a/services/iaas/model_backup_list_response.go +++ b/services/iaas/model_backup_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_backup_list_response_test.go b/services/iaas/model_backup_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_backup_list_response_test.go +++ b/services/iaas/model_backup_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_backup_source.go b/services/iaas/model_backup_source.go index 82d667f5a..f40929932 100644 --- a/services/iaas/model_backup_source.go +++ b/services/iaas/model_backup_source.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_backup_source_test.go b/services/iaas/model_backup_source_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_backup_source_test.go +++ b/services/iaas/model_backup_source_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_backup_test.go b/services/iaas/model_backup_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_backup_test.go +++ b/services/iaas/model_backup_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_base_security_group_rule.go b/services/iaas/model_base_security_group_rule.go index e5976e31e..fa3eb56f7 100644 --- a/services/iaas/model_base_security_group_rule.go +++ b/services/iaas/model_base_security_group_rule.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_base_security_group_rule_test.go b/services/iaas/model_base_security_group_rule_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_base_security_group_rule_test.go +++ b/services/iaas/model_base_security_group_rule_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_boot_volume.go b/services/iaas/model_boot_volume.go index c7a875502..6f075ac0d 100644 --- a/services/iaas/model_boot_volume.go +++ b/services/iaas/model_boot_volume.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_boot_volume_source.go b/services/iaas/model_boot_volume_source.go index c30f06989..4fb08c372 100644 --- a/services/iaas/model_boot_volume_source.go +++ b/services/iaas/model_boot_volume_source.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_boot_volume_source_test.go b/services/iaas/model_boot_volume_source_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_boot_volume_source_test.go +++ b/services/iaas/model_boot_volume_source_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_boot_volume_test.go b/services/iaas/model_boot_volume_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_boot_volume_test.go +++ b/services/iaas/model_boot_volume_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_affinity_group_payload.go b/services/iaas/model_create_affinity_group_payload.go index 9357c4c64..c9af3fbf5 100644 --- a/services/iaas/model_create_affinity_group_payload.go +++ b/services/iaas/model_create_affinity_group_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_affinity_group_payload_test.go b/services/iaas/model_create_affinity_group_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_affinity_group_payload_test.go +++ b/services/iaas/model_create_affinity_group_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_backup_payload.go b/services/iaas/model_create_backup_payload.go index 0ec328547..78b84a47a 100644 --- a/services/iaas/model_create_backup_payload.go +++ b/services/iaas/model_create_backup_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_backup_payload_test.go b/services/iaas/model_create_backup_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_backup_payload_test.go +++ b/services/iaas/model_create_backup_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_image_payload.go b/services/iaas/model_create_image_payload.go index 655a9970c..95eb4adb1 100644 --- a/services/iaas/model_create_image_payload.go +++ b/services/iaas/model_create_image_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_image_payload_test.go b/services/iaas/model_create_image_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_image_payload_test.go +++ b/services/iaas/model_create_image_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_key_pair_payload.go b/services/iaas/model_create_key_pair_payload.go index 9e94dec76..d856e0a83 100644 --- a/services/iaas/model_create_key_pair_payload.go +++ b/services/iaas/model_create_key_pair_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_key_pair_payload_test.go b/services/iaas/model_create_key_pair_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_key_pair_payload_test.go +++ b/services/iaas/model_create_key_pair_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_network_area_payload.go b/services/iaas/model_create_network_area_payload.go index 8bc10afc1..5d937aa78 100644 --- a/services/iaas/model_create_network_area_payload.go +++ b/services/iaas/model_create_network_area_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,26 +17,6 @@ import ( // checks if the CreateNetworkAreaPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateNetworkAreaPayload{} -/* - types and functions for addressFamily -*/ - -// isModel -type CreateNetworkAreaPayloadGetAddressFamilyAttributeType = *CreateAreaAddressFamily -type CreateNetworkAreaPayloadGetAddressFamilyArgType = CreateAreaAddressFamily -type CreateNetworkAreaPayloadGetAddressFamilyRetType = CreateAreaAddressFamily - -func getCreateNetworkAreaPayloadGetAddressFamilyAttributeTypeOk(arg CreateNetworkAreaPayloadGetAddressFamilyAttributeType) (ret CreateNetworkAreaPayloadGetAddressFamilyRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setCreateNetworkAreaPayloadGetAddressFamilyAttributeType(arg *CreateNetworkAreaPayloadGetAddressFamilyAttributeType, val CreateNetworkAreaPayloadGetAddressFamilyRetType) { - *arg = &val -} - /* types and functions for labels */ @@ -78,13 +58,10 @@ func setCreateNetworkAreaPayloadGetNameAttributeType(arg *CreateNetworkAreaPaylo type CreateNetworkAreaPayloadGetNameArgType = string type CreateNetworkAreaPayloadGetNameRetType = string -// CreateNetworkAreaPayload struct for CreateNetworkAreaPayload +// CreateNetworkAreaPayload Object that represents the network area create request. type CreateNetworkAreaPayload struct { - // REQUIRED - AddressFamily CreateNetworkAreaPayloadGetAddressFamilyAttributeType `json:"addressFamily" required:"true"` // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Labels CreateNetworkAreaPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. // REQUIRED Name CreateNetworkAreaPayloadGetNameAttributeType `json:"name" required:"true"` } @@ -95,9 +72,8 @@ type _CreateNetworkAreaPayload CreateNetworkAreaPayload // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCreateNetworkAreaPayload(addressFamily CreateNetworkAreaPayloadGetAddressFamilyArgType, name CreateNetworkAreaPayloadGetNameArgType) *CreateNetworkAreaPayload { +func NewCreateNetworkAreaPayload(name CreateNetworkAreaPayloadGetNameArgType) *CreateNetworkAreaPayload { this := CreateNetworkAreaPayload{} - setCreateNetworkAreaPayloadGetAddressFamilyAttributeType(&this.AddressFamily, addressFamily) setCreateNetworkAreaPayloadGetNameAttributeType(&this.Name, name) return &this } @@ -110,23 +86,6 @@ func NewCreateNetworkAreaPayloadWithDefaults() *CreateNetworkAreaPayload { return &this } -// GetAddressFamily returns the AddressFamily field value -func (o *CreateNetworkAreaPayload) GetAddressFamily() (ret CreateNetworkAreaPayloadGetAddressFamilyRetType) { - ret, _ = o.GetAddressFamilyOk() - return ret -} - -// GetAddressFamilyOk returns a tuple with the AddressFamily field value -// and a boolean to check if the value has been set. -func (o *CreateNetworkAreaPayload) GetAddressFamilyOk() (ret CreateNetworkAreaPayloadGetAddressFamilyRetType, ok bool) { - return getCreateNetworkAreaPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily) -} - -// SetAddressFamily sets field value -func (o *CreateNetworkAreaPayload) SetAddressFamily(v CreateNetworkAreaPayloadGetAddressFamilyRetType) { - setCreateNetworkAreaPayloadGetAddressFamilyAttributeType(&o.AddressFamily, v) -} - // GetLabels returns the Labels field value if set, zero value otherwise. func (o *CreateNetworkAreaPayload) GetLabels() (res CreateNetworkAreaPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() @@ -169,9 +128,6 @@ func (o *CreateNetworkAreaPayload) SetName(v CreateNetworkAreaPayloadGetNameRetT func (o CreateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getCreateNetworkAreaPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily); ok { - toSerialize["AddressFamily"] = val - } if val, ok := getCreateNetworkAreaPayloadGetLabelsAttributeTypeOk(o.Labels); ok { toSerialize["Labels"] = val } diff --git a/services/iaas/model_create_network_area_payload_test.go b/services/iaas/model_create_network_area_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_network_area_payload_test.go +++ b/services/iaas/model_create_network_area_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_network_area_range_payload.go b/services/iaas/model_create_network_area_range_payload.go index 616daba40..fcf47281f 100644 --- a/services/iaas/model_create_network_area_range_payload.go +++ b/services/iaas/model_create_network_area_range_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_network_area_range_payload_test.go b/services/iaas/model_create_network_area_range_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_network_area_range_payload_test.go +++ b/services/iaas/model_create_network_area_range_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_network_area_region_payload.go b/services/iaas/model_create_network_area_region_payload.go new file mode 100644 index 000000000..72dd340ba --- /dev/null +++ b/services/iaas/model_create_network_area_region_payload.go @@ -0,0 +1,176 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the CreateNetworkAreaRegionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaRegionPayload{} + +/* + types and functions for ipv4 +*/ + +// isModel +type CreateNetworkAreaRegionPayloadGetIpv4AttributeType = *RegionalAreaIPv4 +type CreateNetworkAreaRegionPayloadGetIpv4ArgType = RegionalAreaIPv4 +type CreateNetworkAreaRegionPayloadGetIpv4RetType = RegionalAreaIPv4 + +func getCreateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(arg CreateNetworkAreaRegionPayloadGetIpv4AttributeType) (ret CreateNetworkAreaRegionPayloadGetIpv4RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkAreaRegionPayloadGetIpv4AttributeType(arg *CreateNetworkAreaRegionPayloadGetIpv4AttributeType, val CreateNetworkAreaRegionPayloadGetIpv4RetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type CreateNetworkAreaRegionPayloadGetStatusAttributeType = *string + +func getCreateNetworkAreaRegionPayloadGetStatusAttributeTypeOk(arg CreateNetworkAreaRegionPayloadGetStatusAttributeType) (ret CreateNetworkAreaRegionPayloadGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkAreaRegionPayloadGetStatusAttributeType(arg *CreateNetworkAreaRegionPayloadGetStatusAttributeType, val CreateNetworkAreaRegionPayloadGetStatusRetType) { + *arg = &val +} + +type CreateNetworkAreaRegionPayloadGetStatusArgType = string +type CreateNetworkAreaRegionPayloadGetStatusRetType = string + +// CreateNetworkAreaRegionPayload The basic properties of a regional network area. +type CreateNetworkAreaRegionPayload struct { + Ipv4 CreateNetworkAreaRegionPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status CreateNetworkAreaRegionPayloadGetStatusAttributeType `json:"status,omitempty"` +} + +// NewCreateNetworkAreaRegionPayload instantiates a new CreateNetworkAreaRegionPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkAreaRegionPayload() *CreateNetworkAreaRegionPayload { + this := CreateNetworkAreaRegionPayload{} + return &this +} + +// NewCreateNetworkAreaRegionPayloadWithDefaults instantiates a new CreateNetworkAreaRegionPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkAreaRegionPayloadWithDefaults() *CreateNetworkAreaRegionPayload { + this := CreateNetworkAreaRegionPayload{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkAreaRegionPayload) GetIpv4() (res CreateNetworkAreaRegionPayloadGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaRegionPayload) GetIpv4Ok() (ret CreateNetworkAreaRegionPayloadGetIpv4RetType, ok bool) { + return getCreateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(o.Ipv4) +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkAreaRegionPayload) HasIpv4() bool { + _, ok := o.GetIpv4Ok() + return ok +} + +// SetIpv4 gets a reference to the given RegionalAreaIPv4 and assigns it to the Ipv4 field. +func (o *CreateNetworkAreaRegionPayload) SetIpv4(v CreateNetworkAreaRegionPayloadGetIpv4RetType) { + setCreateNetworkAreaRegionPayloadGetIpv4AttributeType(&o.Ipv4, v) +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateNetworkAreaRegionPayload) GetStatus() (res CreateNetworkAreaRegionPayloadGetStatusRetType) { + res, _ = o.GetStatusOk() + return +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaRegionPayload) GetStatusOk() (ret CreateNetworkAreaRegionPayloadGetStatusRetType, ok bool) { + return getCreateNetworkAreaRegionPayloadGetStatusAttributeTypeOk(o.Status) +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateNetworkAreaRegionPayload) HasStatus() bool { + _, ok := o.GetStatusOk() + return ok +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateNetworkAreaRegionPayload) SetStatus(v CreateNetworkAreaRegionPayloadGetStatusRetType) { + setCreateNetworkAreaRegionPayloadGetStatusAttributeType(&o.Status, v) +} + +func (o CreateNetworkAreaRegionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val + } + if val, ok := getCreateNetworkAreaRegionPayloadGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val + } + return toSerialize, nil +} + +type NullableCreateNetworkAreaRegionPayload struct { + value *CreateNetworkAreaRegionPayload + isSet bool +} + +func (v NullableCreateNetworkAreaRegionPayload) Get() *CreateNetworkAreaRegionPayload { + return v.value +} + +func (v *NullableCreateNetworkAreaRegionPayload) Set(val *CreateNetworkAreaRegionPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaRegionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaRegionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaRegionPayload(val *CreateNetworkAreaRegionPayload) *NullableCreateNetworkAreaRegionPayload { + return &NullableCreateNetworkAreaRegionPayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaRegionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaRegionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_create_network_area_region_payload_test.go b/services/iaas/model_create_network_area_region_payload_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_create_network_area_region_payload_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_create_network_area_route_payload.go b/services/iaas/model_create_network_area_route_payload.go index 34070761d..8f3c3f332 100644 --- a/services/iaas/model_create_network_area_route_payload.go +++ b/services/iaas/model_create_network_area_route_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,37 +18,41 @@ import ( var _ MappedNullable = &CreateNetworkAreaRoutePayload{} /* - types and functions for ipv4 + types and functions for items */ // isArray -type CreateNetworkAreaRoutePayloadGetIpv4AttributeType = *[]Route -type CreateNetworkAreaRoutePayloadGetIpv4ArgType = []Route -type CreateNetworkAreaRoutePayloadGetIpv4RetType = []Route +type CreateNetworkAreaRoutePayloadGetItemsAttributeType = *[]Route +type CreateNetworkAreaRoutePayloadGetItemsArgType = []Route +type CreateNetworkAreaRoutePayloadGetItemsRetType = []Route -func getCreateNetworkAreaRoutePayloadGetIpv4AttributeTypeOk(arg CreateNetworkAreaRoutePayloadGetIpv4AttributeType) (ret CreateNetworkAreaRoutePayloadGetIpv4RetType, ok bool) { +func getCreateNetworkAreaRoutePayloadGetItemsAttributeTypeOk(arg CreateNetworkAreaRoutePayloadGetItemsAttributeType) (ret CreateNetworkAreaRoutePayloadGetItemsRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setCreateNetworkAreaRoutePayloadGetIpv4AttributeType(arg *CreateNetworkAreaRoutePayloadGetIpv4AttributeType, val CreateNetworkAreaRoutePayloadGetIpv4RetType) { +func setCreateNetworkAreaRoutePayloadGetItemsAttributeType(arg *CreateNetworkAreaRoutePayloadGetItemsAttributeType, val CreateNetworkAreaRoutePayloadGetItemsRetType) { *arg = &val } -// CreateNetworkAreaRoutePayload struct for CreateNetworkAreaRoutePayload +// CreateNetworkAreaRoutePayload Object represents a request to add network routes. type CreateNetworkAreaRoutePayload struct { // A list of routes. - Ipv4 CreateNetworkAreaRoutePayloadGetIpv4AttributeType `json:"ipv4,omitempty"` + // REQUIRED + Items CreateNetworkAreaRoutePayloadGetItemsAttributeType `json:"items" required:"true"` } +type _CreateNetworkAreaRoutePayload CreateNetworkAreaRoutePayload + // NewCreateNetworkAreaRoutePayload instantiates a new CreateNetworkAreaRoutePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCreateNetworkAreaRoutePayload() *CreateNetworkAreaRoutePayload { +func NewCreateNetworkAreaRoutePayload(items CreateNetworkAreaRoutePayloadGetItemsArgType) *CreateNetworkAreaRoutePayload { this := CreateNetworkAreaRoutePayload{} + setCreateNetworkAreaRoutePayloadGetItemsAttributeType(&this.Items, items) return &this } @@ -60,33 +64,27 @@ func NewCreateNetworkAreaRoutePayloadWithDefaults() *CreateNetworkAreaRoutePaylo return &this } -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *CreateNetworkAreaRoutePayload) GetIpv4() (res CreateNetworkAreaRoutePayloadGetIpv4RetType) { - res, _ = o.GetIpv4Ok() - return +// GetItems returns the Items field value +func (o *CreateNetworkAreaRoutePayload) GetItems() (ret CreateNetworkAreaRoutePayloadGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } -// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *CreateNetworkAreaRoutePayload) GetIpv4Ok() (ret CreateNetworkAreaRoutePayloadGetIpv4RetType, ok bool) { - return getCreateNetworkAreaRoutePayloadGetIpv4AttributeTypeOk(o.Ipv4) -} - -// HasIpv4 returns a boolean if a field has been set. -func (o *CreateNetworkAreaRoutePayload) HasIpv4() bool { - _, ok := o.GetIpv4Ok() - return ok +func (o *CreateNetworkAreaRoutePayload) GetItemsOk() (ret CreateNetworkAreaRoutePayloadGetItemsRetType, ok bool) { + return getCreateNetworkAreaRoutePayloadGetItemsAttributeTypeOk(o.Items) } -// SetIpv4 gets a reference to the given []Route and assigns it to the Ipv4 field. -func (o *CreateNetworkAreaRoutePayload) SetIpv4(v CreateNetworkAreaRoutePayloadGetIpv4RetType) { - setCreateNetworkAreaRoutePayloadGetIpv4AttributeType(&o.Ipv4, v) +// SetItems sets field value +func (o *CreateNetworkAreaRoutePayload) SetItems(v CreateNetworkAreaRoutePayloadGetItemsRetType) { + setCreateNetworkAreaRoutePayloadGetItemsAttributeType(&o.Items, v) } func (o CreateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getCreateNetworkAreaRoutePayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { - toSerialize["Ipv4"] = val + if val, ok := getCreateNetworkAreaRoutePayloadGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_network_area_route_payload_test.go b/services/iaas/model_create_network_area_route_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_network_area_route_payload_test.go +++ b/services/iaas/model_create_network_area_route_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_network_ipv4.go b/services/iaas/model_create_network_ipv4.go new file mode 100644 index 000000000..a169d5c5f --- /dev/null +++ b/services/iaas/model_create_network_ipv4.go @@ -0,0 +1,144 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" + "fmt" +) + +// CreateNetworkIPv4 - The create request for an IPv4 network. +type CreateNetworkIPv4 struct { + CreateNetworkIPv4WithPrefix *CreateNetworkIPv4WithPrefix + CreateNetworkIPv4WithPrefixLength *CreateNetworkIPv4WithPrefixLength +} + +// CreateNetworkIPv4WithPrefixAsCreateNetworkIPv4 is a convenience function that returns CreateNetworkIPv4WithPrefix wrapped in CreateNetworkIPv4 +func CreateNetworkIPv4WithPrefixAsCreateNetworkIPv4(v *CreateNetworkIPv4WithPrefix) CreateNetworkIPv4 { + return CreateNetworkIPv4{ + CreateNetworkIPv4WithPrefix: v, + } +} + +// CreateNetworkIPv4WithPrefixLengthAsCreateNetworkIPv4 is a convenience function that returns CreateNetworkIPv4WithPrefixLength wrapped in CreateNetworkIPv4 +func CreateNetworkIPv4WithPrefixLengthAsCreateNetworkIPv4(v *CreateNetworkIPv4WithPrefixLength) CreateNetworkIPv4 { + return CreateNetworkIPv4{ + CreateNetworkIPv4WithPrefixLength: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateNetworkIPv4) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // Workaround until upstream issue is fixed: + // https://github.com/OpenAPITools/openapi-generator/issues/21751 + // Tracking issue on our side: https://jira.schwarz/browse/STACKITSDK-226 + // try to unmarshal data into CreateNetworkIPv4WithPrefix + dstCreateNetworkIPv41 := &CreateNetworkIPv4{} + err = json.Unmarshal(data, &dstCreateNetworkIPv41.CreateNetworkIPv4WithPrefix) + if err == nil { + jsonCreateNetworkIPv4WithPrefix, _ := json.Marshal(&dstCreateNetworkIPv41.CreateNetworkIPv4WithPrefix) + if string(jsonCreateNetworkIPv4WithPrefix) != "{}" { // empty struct + dst.CreateNetworkIPv4WithPrefix = dstCreateNetworkIPv41.CreateNetworkIPv4WithPrefix + match++ + } + } + + // try to unmarshal data into CreateNetworkIPv4WithPrefixLength + dstCreateNetworkIPv42 := &CreateNetworkIPv4{} + err = json.Unmarshal(data, &dstCreateNetworkIPv42.CreateNetworkIPv4WithPrefixLength) + if err == nil { + jsonCreateNetworkIPv4WithPrefixLength, _ := json.Marshal(&dstCreateNetworkIPv42.CreateNetworkIPv4WithPrefixLength) + if string(jsonCreateNetworkIPv4WithPrefixLength) != "{}" { // empty struct + dst.CreateNetworkIPv4WithPrefixLength = dstCreateNetworkIPv42.CreateNetworkIPv4WithPrefixLength + match++ + } + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateNetworkIPv4WithPrefix = nil + dst.CreateNetworkIPv4WithPrefixLength = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateNetworkIPv4)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateNetworkIPv4)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateNetworkIPv4) MarshalJSON() ([]byte, error) { + if src.CreateNetworkIPv4WithPrefix != nil { + return json.Marshal(&src.CreateNetworkIPv4WithPrefix) + } + + if src.CreateNetworkIPv4WithPrefixLength != nil { + return json.Marshal(&src.CreateNetworkIPv4WithPrefixLength) + } + + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object +} + +// Get the actual instance +func (obj *CreateNetworkIPv4) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateNetworkIPv4WithPrefix != nil { + return obj.CreateNetworkIPv4WithPrefix + } + + if obj.CreateNetworkIPv4WithPrefixLength != nil { + return obj.CreateNetworkIPv4WithPrefixLength + } + + // all schemas are nil + return nil +} + +type NullableCreateNetworkIPv4 struct { + value *CreateNetworkIPv4 + isSet bool +} + +func (v NullableCreateNetworkIPv4) Get() *CreateNetworkIPv4 { + return v.value +} + +func (v *NullableCreateNetworkIPv4) Set(val *CreateNetworkIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4(val *CreateNetworkIPv4) *NullableCreateNetworkIPv4 { + return &NullableCreateNetworkIPv4{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_create_network_ipv4_test.go b/services/iaas/model_create_network_ipv4_test.go new file mode 100644 index 000000000..8fec9b19a --- /dev/null +++ b/services/iaas/model_create_network_ipv4_test.go @@ -0,0 +1,43 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "testing" +) + +// isOneOf + +func TestCreateNetworkIPv4_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{} + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := &CreateNetworkIPv4{} + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + marshalJson, err := v.MarshalJSON() + if err != nil { + t.Fatalf("failed marshalling CreateNetworkIPv4: %v", err) + } + if string(marshalJson) != string(tt.args.src) { + t.Fatalf("wanted %s, get %s", tt.args.src, marshalJson) + } + }) + } +} diff --git a/services/iaas/model_create_network_ipv4_with_prefix.go b/services/iaas/model_create_network_ipv4_with_prefix.go new file mode 100644 index 000000000..a57491770 --- /dev/null +++ b/services/iaas/model_create_network_ipv4_with_prefix.go @@ -0,0 +1,239 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the CreateNetworkIPv4WithPrefix type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv4WithPrefix{} + +/* + types and functions for gateway +*/ + +// isNullableString +type CreateNetworkIPv4WithPrefixGetGatewayAttributeType = *NullableString + +func getCreateNetworkIPv4WithPrefixGetGatewayAttributeTypeOk(arg CreateNetworkIPv4WithPrefixGetGatewayAttributeType) (ret CreateNetworkIPv4WithPrefixGetGatewayRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setCreateNetworkIPv4WithPrefixGetGatewayAttributeType(arg *CreateNetworkIPv4WithPrefixGetGatewayAttributeType, val CreateNetworkIPv4WithPrefixGetGatewayRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type CreateNetworkIPv4WithPrefixGetGatewayArgType = *string +type CreateNetworkIPv4WithPrefixGetGatewayRetType = *string + +/* + types and functions for nameservers +*/ + +// isArray +type CreateNetworkIPv4WithPrefixGetNameserversAttributeType = *[]string +type CreateNetworkIPv4WithPrefixGetNameserversArgType = []string +type CreateNetworkIPv4WithPrefixGetNameserversRetType = []string + +func getCreateNetworkIPv4WithPrefixGetNameserversAttributeTypeOk(arg CreateNetworkIPv4WithPrefixGetNameserversAttributeType) (ret CreateNetworkIPv4WithPrefixGetNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv4WithPrefixGetNameserversAttributeType(arg *CreateNetworkIPv4WithPrefixGetNameserversAttributeType, val CreateNetworkIPv4WithPrefixGetNameserversRetType) { + *arg = &val +} + +/* + types and functions for prefix +*/ + +// isNotNullableString +type CreateNetworkIPv4WithPrefixGetPrefixAttributeType = *string + +func getCreateNetworkIPv4WithPrefixGetPrefixAttributeTypeOk(arg CreateNetworkIPv4WithPrefixGetPrefixAttributeType) (ret CreateNetworkIPv4WithPrefixGetPrefixRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv4WithPrefixGetPrefixAttributeType(arg *CreateNetworkIPv4WithPrefixGetPrefixAttributeType, val CreateNetworkIPv4WithPrefixGetPrefixRetType) { + *arg = &val +} + +type CreateNetworkIPv4WithPrefixGetPrefixArgType = string +type CreateNetworkIPv4WithPrefixGetPrefixRetType = string + +// CreateNetworkIPv4WithPrefix The create request for an IPv4 network with a specified prefix. +type CreateNetworkIPv4WithPrefix struct { + // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway CreateNetworkIPv4WithPrefixGetGatewayAttributeType `json:"gateway,omitempty"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers CreateNetworkIPv4WithPrefixGetNameserversAttributeType `json:"nameservers,omitempty"` + // IPv4 Classless Inter-Domain Routing (CIDR). + // REQUIRED + Prefix CreateNetworkIPv4WithPrefixGetPrefixAttributeType `json:"prefix" required:"true"` +} + +type _CreateNetworkIPv4WithPrefix CreateNetworkIPv4WithPrefix + +// NewCreateNetworkIPv4WithPrefix instantiates a new CreateNetworkIPv4WithPrefix object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv4WithPrefix(prefix CreateNetworkIPv4WithPrefixGetPrefixArgType) *CreateNetworkIPv4WithPrefix { + this := CreateNetworkIPv4WithPrefix{} + setCreateNetworkIPv4WithPrefixGetPrefixAttributeType(&this.Prefix, prefix) + return &this +} + +// NewCreateNetworkIPv4WithPrefixWithDefaults instantiates a new CreateNetworkIPv4WithPrefix object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv4WithPrefixWithDefaults() *CreateNetworkIPv4WithPrefix { + this := CreateNetworkIPv4WithPrefix{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateNetworkIPv4WithPrefix) GetGateway() (res CreateNetworkIPv4WithPrefixGetGatewayRetType) { + res, _ = o.GetGatewayOk() + return +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateNetworkIPv4WithPrefix) GetGatewayOk() (ret CreateNetworkIPv4WithPrefixGetGatewayRetType, ok bool) { + return getCreateNetworkIPv4WithPrefixGetGatewayAttributeTypeOk(o.Gateway) +} + +// HasGateway returns a boolean if a field has been set. +func (o *CreateNetworkIPv4WithPrefix) HasGateway() bool { + _, ok := o.GetGatewayOk() + return ok +} + +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *CreateNetworkIPv4WithPrefix) SetGateway(v CreateNetworkIPv4WithPrefixGetGatewayRetType) { + setCreateNetworkIPv4WithPrefixGetGatewayAttributeType(&o.Gateway, v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *CreateNetworkIPv4WithPrefix) SetGatewayNil() { + o.Gateway = nil +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *CreateNetworkIPv4WithPrefix) UnsetGateway() { + o.Gateway = nil +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv4WithPrefix) GetNameservers() (res CreateNetworkIPv4WithPrefixGetNameserversRetType) { + res, _ = o.GetNameserversOk() + return +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefix) GetNameserversOk() (ret CreateNetworkIPv4WithPrefixGetNameserversRetType, ok bool) { + return getCreateNetworkIPv4WithPrefixGetNameserversAttributeTypeOk(o.Nameservers) +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv4WithPrefix) HasNameservers() bool { + _, ok := o.GetNameserversOk() + return ok +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv4WithPrefix) SetNameservers(v CreateNetworkIPv4WithPrefixGetNameserversRetType) { + setCreateNetworkIPv4WithPrefixGetNameserversAttributeType(&o.Nameservers, v) +} + +// GetPrefix returns the Prefix field value +func (o *CreateNetworkIPv4WithPrefix) GetPrefix() (ret CreateNetworkIPv4WithPrefixGetPrefixRetType) { + ret, _ = o.GetPrefixOk() + return ret +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefix) GetPrefixOk() (ret CreateNetworkIPv4WithPrefixGetPrefixRetType, ok bool) { + return getCreateNetworkIPv4WithPrefixGetPrefixAttributeTypeOk(o.Prefix) +} + +// SetPrefix sets field value +func (o *CreateNetworkIPv4WithPrefix) SetPrefix(v CreateNetworkIPv4WithPrefixGetPrefixRetType) { + setCreateNetworkIPv4WithPrefixGetPrefixAttributeType(&o.Prefix, v) +} + +func (o CreateNetworkIPv4WithPrefix) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateNetworkIPv4WithPrefixGetGatewayAttributeTypeOk(o.Gateway); ok { + toSerialize["Gateway"] = val + } + if val, ok := getCreateNetworkIPv4WithPrefixGetNameserversAttributeTypeOk(o.Nameservers); ok { + toSerialize["Nameservers"] = val + } + if val, ok := getCreateNetworkIPv4WithPrefixGetPrefixAttributeTypeOk(o.Prefix); ok { + toSerialize["Prefix"] = val + } + return toSerialize, nil +} + +type NullableCreateNetworkIPv4WithPrefix struct { + value *CreateNetworkIPv4WithPrefix + isSet bool +} + +func (v NullableCreateNetworkIPv4WithPrefix) Get() *CreateNetworkIPv4WithPrefix { + return v.value +} + +func (v *NullableCreateNetworkIPv4WithPrefix) Set(val *CreateNetworkIPv4WithPrefix) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4WithPrefix) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4WithPrefix) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4WithPrefix(val *CreateNetworkIPv4WithPrefix) *NullableCreateNetworkIPv4WithPrefix { + return &NullableCreateNetworkIPv4WithPrefix{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4WithPrefix) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4WithPrefix) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_create_network_ipv4_with_prefix_length.go b/services/iaas/model_create_network_ipv4_with_prefix_length.go new file mode 100644 index 000000000..f9bc05ef5 --- /dev/null +++ b/services/iaas/model_create_network_ipv4_with_prefix_length.go @@ -0,0 +1,173 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the CreateNetworkIPv4WithPrefixLength type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv4WithPrefixLength{} + +/* + types and functions for nameservers +*/ + +// isArray +type CreateNetworkIPv4WithPrefixLengthGetNameserversAttributeType = *[]string +type CreateNetworkIPv4WithPrefixLengthGetNameserversArgType = []string +type CreateNetworkIPv4WithPrefixLengthGetNameserversRetType = []string + +func getCreateNetworkIPv4WithPrefixLengthGetNameserversAttributeTypeOk(arg CreateNetworkIPv4WithPrefixLengthGetNameserversAttributeType) (ret CreateNetworkIPv4WithPrefixLengthGetNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv4WithPrefixLengthGetNameserversAttributeType(arg *CreateNetworkIPv4WithPrefixLengthGetNameserversAttributeType, val CreateNetworkIPv4WithPrefixLengthGetNameserversRetType) { + *arg = &val +} + +/* + types and functions for prefixLength +*/ + +// isLong +type CreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType = *int64 +type CreateNetworkIPv4WithPrefixLengthGetPrefixLengthArgType = int64 +type CreateNetworkIPv4WithPrefixLengthGetPrefixLengthRetType = int64 + +func getCreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeTypeOk(arg CreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType) (ret CreateNetworkIPv4WithPrefixLengthGetPrefixLengthRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType(arg *CreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType, val CreateNetworkIPv4WithPrefixLengthGetPrefixLengthRetType) { + *arg = &val +} + +// CreateNetworkIPv4WithPrefixLength The create request for an IPv4 network with a wanted prefix length. +type CreateNetworkIPv4WithPrefixLength struct { + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers CreateNetworkIPv4WithPrefixLengthGetNameserversAttributeType `json:"nameservers,omitempty"` + // REQUIRED + PrefixLength CreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType `json:"prefixLength" required:"true"` +} + +type _CreateNetworkIPv4WithPrefixLength CreateNetworkIPv4WithPrefixLength + +// NewCreateNetworkIPv4WithPrefixLength instantiates a new CreateNetworkIPv4WithPrefixLength object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv4WithPrefixLength(prefixLength CreateNetworkIPv4WithPrefixLengthGetPrefixLengthArgType) *CreateNetworkIPv4WithPrefixLength { + this := CreateNetworkIPv4WithPrefixLength{} + setCreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType(&this.PrefixLength, prefixLength) + return &this +} + +// NewCreateNetworkIPv4WithPrefixLengthWithDefaults instantiates a new CreateNetworkIPv4WithPrefixLength object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv4WithPrefixLengthWithDefaults() *CreateNetworkIPv4WithPrefixLength { + this := CreateNetworkIPv4WithPrefixLength{} + return &this +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv4WithPrefixLength) GetNameservers() (res CreateNetworkIPv4WithPrefixLengthGetNameserversRetType) { + res, _ = o.GetNameserversOk() + return +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefixLength) GetNameserversOk() (ret CreateNetworkIPv4WithPrefixLengthGetNameserversRetType, ok bool) { + return getCreateNetworkIPv4WithPrefixLengthGetNameserversAttributeTypeOk(o.Nameservers) +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv4WithPrefixLength) HasNameservers() bool { + _, ok := o.GetNameserversOk() + return ok +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv4WithPrefixLength) SetNameservers(v CreateNetworkIPv4WithPrefixLengthGetNameserversRetType) { + setCreateNetworkIPv4WithPrefixLengthGetNameserversAttributeType(&o.Nameservers, v) +} + +// GetPrefixLength returns the PrefixLength field value +func (o *CreateNetworkIPv4WithPrefixLength) GetPrefixLength() (ret CreateNetworkIPv4WithPrefixLengthGetPrefixLengthRetType) { + ret, _ = o.GetPrefixLengthOk() + return ret +} + +// GetPrefixLengthOk returns a tuple with the PrefixLength field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefixLength) GetPrefixLengthOk() (ret CreateNetworkIPv4WithPrefixLengthGetPrefixLengthRetType, ok bool) { + return getCreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeTypeOk(o.PrefixLength) +} + +// SetPrefixLength sets field value +func (o *CreateNetworkIPv4WithPrefixLength) SetPrefixLength(v CreateNetworkIPv4WithPrefixLengthGetPrefixLengthRetType) { + setCreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType(&o.PrefixLength, v) +} + +func (o CreateNetworkIPv4WithPrefixLength) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateNetworkIPv4WithPrefixLengthGetNameserversAttributeTypeOk(o.Nameservers); ok { + toSerialize["Nameservers"] = val + } + if val, ok := getCreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeTypeOk(o.PrefixLength); ok { + toSerialize["PrefixLength"] = val + } + return toSerialize, nil +} + +type NullableCreateNetworkIPv4WithPrefixLength struct { + value *CreateNetworkIPv4WithPrefixLength + isSet bool +} + +func (v NullableCreateNetworkIPv4WithPrefixLength) Get() *CreateNetworkIPv4WithPrefixLength { + return v.value +} + +func (v *NullableCreateNetworkIPv4WithPrefixLength) Set(val *CreateNetworkIPv4WithPrefixLength) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4WithPrefixLength) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4WithPrefixLength) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4WithPrefixLength(val *CreateNetworkIPv4WithPrefixLength) *NullableCreateNetworkIPv4WithPrefixLength { + return &NullableCreateNetworkIPv4WithPrefixLength{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4WithPrefixLength) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4WithPrefixLength) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_create_network_ipv4_with_prefix_length_test.go b/services/iaas/model_create_network_ipv4_with_prefix_length_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_create_network_ipv4_with_prefix_length_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_create_network_ipv4_with_prefix_test.go b/services/iaas/model_create_network_ipv4_with_prefix_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_create_network_ipv4_with_prefix_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_create_network_ipv6.go b/services/iaas/model_create_network_ipv6.go new file mode 100644 index 000000000..18d228514 --- /dev/null +++ b/services/iaas/model_create_network_ipv6.go @@ -0,0 +1,144 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" + "fmt" +) + +// CreateNetworkIPv6 - The create request for an IPv6 network. +type CreateNetworkIPv6 struct { + CreateNetworkIPv6WithPrefix *CreateNetworkIPv6WithPrefix + CreateNetworkIPv6WithPrefixLength *CreateNetworkIPv6WithPrefixLength +} + +// CreateNetworkIPv6WithPrefixAsCreateNetworkIPv6 is a convenience function that returns CreateNetworkIPv6WithPrefix wrapped in CreateNetworkIPv6 +func CreateNetworkIPv6WithPrefixAsCreateNetworkIPv6(v *CreateNetworkIPv6WithPrefix) CreateNetworkIPv6 { + return CreateNetworkIPv6{ + CreateNetworkIPv6WithPrefix: v, + } +} + +// CreateNetworkIPv6WithPrefixLengthAsCreateNetworkIPv6 is a convenience function that returns CreateNetworkIPv6WithPrefixLength wrapped in CreateNetworkIPv6 +func CreateNetworkIPv6WithPrefixLengthAsCreateNetworkIPv6(v *CreateNetworkIPv6WithPrefixLength) CreateNetworkIPv6 { + return CreateNetworkIPv6{ + CreateNetworkIPv6WithPrefixLength: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateNetworkIPv6) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // Workaround until upstream issue is fixed: + // https://github.com/OpenAPITools/openapi-generator/issues/21751 + // Tracking issue on our side: https://jira.schwarz/browse/STACKITSDK-226 + // try to unmarshal data into CreateNetworkIPv6WithPrefix + dstCreateNetworkIPv61 := &CreateNetworkIPv6{} + err = json.Unmarshal(data, &dstCreateNetworkIPv61.CreateNetworkIPv6WithPrefix) + if err == nil { + jsonCreateNetworkIPv6WithPrefix, _ := json.Marshal(&dstCreateNetworkIPv61.CreateNetworkIPv6WithPrefix) + if string(jsonCreateNetworkIPv6WithPrefix) != "{}" { // empty struct + dst.CreateNetworkIPv6WithPrefix = dstCreateNetworkIPv61.CreateNetworkIPv6WithPrefix + match++ + } + } + + // try to unmarshal data into CreateNetworkIPv6WithPrefixLength + dstCreateNetworkIPv62 := &CreateNetworkIPv6{} + err = json.Unmarshal(data, &dstCreateNetworkIPv62.CreateNetworkIPv6WithPrefixLength) + if err == nil { + jsonCreateNetworkIPv6WithPrefixLength, _ := json.Marshal(&dstCreateNetworkIPv62.CreateNetworkIPv6WithPrefixLength) + if string(jsonCreateNetworkIPv6WithPrefixLength) != "{}" { // empty struct + dst.CreateNetworkIPv6WithPrefixLength = dstCreateNetworkIPv62.CreateNetworkIPv6WithPrefixLength + match++ + } + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateNetworkIPv6WithPrefix = nil + dst.CreateNetworkIPv6WithPrefixLength = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateNetworkIPv6)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateNetworkIPv6)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateNetworkIPv6) MarshalJSON() ([]byte, error) { + if src.CreateNetworkIPv6WithPrefix != nil { + return json.Marshal(&src.CreateNetworkIPv6WithPrefix) + } + + if src.CreateNetworkIPv6WithPrefixLength != nil { + return json.Marshal(&src.CreateNetworkIPv6WithPrefixLength) + } + + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object +} + +// Get the actual instance +func (obj *CreateNetworkIPv6) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateNetworkIPv6WithPrefix != nil { + return obj.CreateNetworkIPv6WithPrefix + } + + if obj.CreateNetworkIPv6WithPrefixLength != nil { + return obj.CreateNetworkIPv6WithPrefixLength + } + + // all schemas are nil + return nil +} + +type NullableCreateNetworkIPv6 struct { + value *CreateNetworkIPv6 + isSet bool +} + +func (v NullableCreateNetworkIPv6) Get() *CreateNetworkIPv6 { + return v.value +} + +func (v *NullableCreateNetworkIPv6) Set(val *CreateNetworkIPv6) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6(val *CreateNetworkIPv6) *NullableCreateNetworkIPv6 { + return &NullableCreateNetworkIPv6{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_create_network_ipv6_test.go b/services/iaas/model_create_network_ipv6_test.go new file mode 100644 index 000000000..658d198b2 --- /dev/null +++ b/services/iaas/model_create_network_ipv6_test.go @@ -0,0 +1,43 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "testing" +) + +// isOneOf + +func TestCreateNetworkIPv6_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{} + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := &CreateNetworkIPv6{} + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + marshalJson, err := v.MarshalJSON() + if err != nil { + t.Fatalf("failed marshalling CreateNetworkIPv6: %v", err) + } + if string(marshalJson) != string(tt.args.src) { + t.Fatalf("wanted %s, get %s", tt.args.src, marshalJson) + } + }) + } +} diff --git a/services/iaas/model_create_network_ipv6_with_prefix.go b/services/iaas/model_create_network_ipv6_with_prefix.go new file mode 100644 index 000000000..a3328308e --- /dev/null +++ b/services/iaas/model_create_network_ipv6_with_prefix.go @@ -0,0 +1,239 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the CreateNetworkIPv6WithPrefix type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv6WithPrefix{} + +/* + types and functions for gateway +*/ + +// isNullableString +type CreateNetworkIPv6WithPrefixGetGatewayAttributeType = *NullableString + +func getCreateNetworkIPv6WithPrefixGetGatewayAttributeTypeOk(arg CreateNetworkIPv6WithPrefixGetGatewayAttributeType) (ret CreateNetworkIPv6WithPrefixGetGatewayRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setCreateNetworkIPv6WithPrefixGetGatewayAttributeType(arg *CreateNetworkIPv6WithPrefixGetGatewayAttributeType, val CreateNetworkIPv6WithPrefixGetGatewayRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type CreateNetworkIPv6WithPrefixGetGatewayArgType = *string +type CreateNetworkIPv6WithPrefixGetGatewayRetType = *string + +/* + types and functions for nameservers +*/ + +// isArray +type CreateNetworkIPv6WithPrefixGetNameserversAttributeType = *[]string +type CreateNetworkIPv6WithPrefixGetNameserversArgType = []string +type CreateNetworkIPv6WithPrefixGetNameserversRetType = []string + +func getCreateNetworkIPv6WithPrefixGetNameserversAttributeTypeOk(arg CreateNetworkIPv6WithPrefixGetNameserversAttributeType) (ret CreateNetworkIPv6WithPrefixGetNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv6WithPrefixGetNameserversAttributeType(arg *CreateNetworkIPv6WithPrefixGetNameserversAttributeType, val CreateNetworkIPv6WithPrefixGetNameserversRetType) { + *arg = &val +} + +/* + types and functions for prefix +*/ + +// isNotNullableString +type CreateNetworkIPv6WithPrefixGetPrefixAttributeType = *string + +func getCreateNetworkIPv6WithPrefixGetPrefixAttributeTypeOk(arg CreateNetworkIPv6WithPrefixGetPrefixAttributeType) (ret CreateNetworkIPv6WithPrefixGetPrefixRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv6WithPrefixGetPrefixAttributeType(arg *CreateNetworkIPv6WithPrefixGetPrefixAttributeType, val CreateNetworkIPv6WithPrefixGetPrefixRetType) { + *arg = &val +} + +type CreateNetworkIPv6WithPrefixGetPrefixArgType = string +type CreateNetworkIPv6WithPrefixGetPrefixRetType = string + +// CreateNetworkIPv6WithPrefix The create request for an IPv6 network with a specified prefix. +type CreateNetworkIPv6WithPrefix struct { + // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway CreateNetworkIPv6WithPrefixGetGatewayAttributeType `json:"gateway,omitempty"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers CreateNetworkIPv6WithPrefixGetNameserversAttributeType `json:"nameservers,omitempty"` + // Classless Inter-Domain Routing (CIDR) for IPv6. + // REQUIRED + Prefix CreateNetworkIPv6WithPrefixGetPrefixAttributeType `json:"prefix" required:"true"` +} + +type _CreateNetworkIPv6WithPrefix CreateNetworkIPv6WithPrefix + +// NewCreateNetworkIPv6WithPrefix instantiates a new CreateNetworkIPv6WithPrefix object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv6WithPrefix(prefix CreateNetworkIPv6WithPrefixGetPrefixArgType) *CreateNetworkIPv6WithPrefix { + this := CreateNetworkIPv6WithPrefix{} + setCreateNetworkIPv6WithPrefixGetPrefixAttributeType(&this.Prefix, prefix) + return &this +} + +// NewCreateNetworkIPv6WithPrefixWithDefaults instantiates a new CreateNetworkIPv6WithPrefix object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv6WithPrefixWithDefaults() *CreateNetworkIPv6WithPrefix { + this := CreateNetworkIPv6WithPrefix{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateNetworkIPv6WithPrefix) GetGateway() (res CreateNetworkIPv6WithPrefixGetGatewayRetType) { + res, _ = o.GetGatewayOk() + return +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateNetworkIPv6WithPrefix) GetGatewayOk() (ret CreateNetworkIPv6WithPrefixGetGatewayRetType, ok bool) { + return getCreateNetworkIPv6WithPrefixGetGatewayAttributeTypeOk(o.Gateway) +} + +// HasGateway returns a boolean if a field has been set. +func (o *CreateNetworkIPv6WithPrefix) HasGateway() bool { + _, ok := o.GetGatewayOk() + return ok +} + +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *CreateNetworkIPv6WithPrefix) SetGateway(v CreateNetworkIPv6WithPrefixGetGatewayRetType) { + setCreateNetworkIPv6WithPrefixGetGatewayAttributeType(&o.Gateway, v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *CreateNetworkIPv6WithPrefix) SetGatewayNil() { + o.Gateway = nil +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *CreateNetworkIPv6WithPrefix) UnsetGateway() { + o.Gateway = nil +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv6WithPrefix) GetNameservers() (res CreateNetworkIPv6WithPrefixGetNameserversRetType) { + res, _ = o.GetNameserversOk() + return +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefix) GetNameserversOk() (ret CreateNetworkIPv6WithPrefixGetNameserversRetType, ok bool) { + return getCreateNetworkIPv6WithPrefixGetNameserversAttributeTypeOk(o.Nameservers) +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv6WithPrefix) HasNameservers() bool { + _, ok := o.GetNameserversOk() + return ok +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv6WithPrefix) SetNameservers(v CreateNetworkIPv6WithPrefixGetNameserversRetType) { + setCreateNetworkIPv6WithPrefixGetNameserversAttributeType(&o.Nameservers, v) +} + +// GetPrefix returns the Prefix field value +func (o *CreateNetworkIPv6WithPrefix) GetPrefix() (ret CreateNetworkIPv6WithPrefixGetPrefixRetType) { + ret, _ = o.GetPrefixOk() + return ret +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefix) GetPrefixOk() (ret CreateNetworkIPv6WithPrefixGetPrefixRetType, ok bool) { + return getCreateNetworkIPv6WithPrefixGetPrefixAttributeTypeOk(o.Prefix) +} + +// SetPrefix sets field value +func (o *CreateNetworkIPv6WithPrefix) SetPrefix(v CreateNetworkIPv6WithPrefixGetPrefixRetType) { + setCreateNetworkIPv6WithPrefixGetPrefixAttributeType(&o.Prefix, v) +} + +func (o CreateNetworkIPv6WithPrefix) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateNetworkIPv6WithPrefixGetGatewayAttributeTypeOk(o.Gateway); ok { + toSerialize["Gateway"] = val + } + if val, ok := getCreateNetworkIPv6WithPrefixGetNameserversAttributeTypeOk(o.Nameservers); ok { + toSerialize["Nameservers"] = val + } + if val, ok := getCreateNetworkIPv6WithPrefixGetPrefixAttributeTypeOk(o.Prefix); ok { + toSerialize["Prefix"] = val + } + return toSerialize, nil +} + +type NullableCreateNetworkIPv6WithPrefix struct { + value *CreateNetworkIPv6WithPrefix + isSet bool +} + +func (v NullableCreateNetworkIPv6WithPrefix) Get() *CreateNetworkIPv6WithPrefix { + return v.value +} + +func (v *NullableCreateNetworkIPv6WithPrefix) Set(val *CreateNetworkIPv6WithPrefix) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6WithPrefix) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6WithPrefix) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6WithPrefix(val *CreateNetworkIPv6WithPrefix) *NullableCreateNetworkIPv6WithPrefix { + return &NullableCreateNetworkIPv6WithPrefix{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6WithPrefix) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6WithPrefix) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_create_network_ipv6_with_prefix_length.go b/services/iaas/model_create_network_ipv6_with_prefix_length.go new file mode 100644 index 000000000..8e6d55899 --- /dev/null +++ b/services/iaas/model_create_network_ipv6_with_prefix_length.go @@ -0,0 +1,173 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the CreateNetworkIPv6WithPrefixLength type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv6WithPrefixLength{} + +/* + types and functions for nameservers +*/ + +// isArray +type CreateNetworkIPv6WithPrefixLengthGetNameserversAttributeType = *[]string +type CreateNetworkIPv6WithPrefixLengthGetNameserversArgType = []string +type CreateNetworkIPv6WithPrefixLengthGetNameserversRetType = []string + +func getCreateNetworkIPv6WithPrefixLengthGetNameserversAttributeTypeOk(arg CreateNetworkIPv6WithPrefixLengthGetNameserversAttributeType) (ret CreateNetworkIPv6WithPrefixLengthGetNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv6WithPrefixLengthGetNameserversAttributeType(arg *CreateNetworkIPv6WithPrefixLengthGetNameserversAttributeType, val CreateNetworkIPv6WithPrefixLengthGetNameserversRetType) { + *arg = &val +} + +/* + types and functions for prefixLength +*/ + +// isLong +type CreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType = *int64 +type CreateNetworkIPv6WithPrefixLengthGetPrefixLengthArgType = int64 +type CreateNetworkIPv6WithPrefixLengthGetPrefixLengthRetType = int64 + +func getCreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeTypeOk(arg CreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType) (ret CreateNetworkIPv6WithPrefixLengthGetPrefixLengthRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType(arg *CreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType, val CreateNetworkIPv6WithPrefixLengthGetPrefixLengthRetType) { + *arg = &val +} + +// CreateNetworkIPv6WithPrefixLength The create request for an IPv6 network with a wanted prefix length. +type CreateNetworkIPv6WithPrefixLength struct { + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers CreateNetworkIPv6WithPrefixLengthGetNameserversAttributeType `json:"nameservers,omitempty"` + // REQUIRED + PrefixLength CreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType `json:"prefixLength" required:"true"` +} + +type _CreateNetworkIPv6WithPrefixLength CreateNetworkIPv6WithPrefixLength + +// NewCreateNetworkIPv6WithPrefixLength instantiates a new CreateNetworkIPv6WithPrefixLength object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv6WithPrefixLength(prefixLength CreateNetworkIPv6WithPrefixLengthGetPrefixLengthArgType) *CreateNetworkIPv6WithPrefixLength { + this := CreateNetworkIPv6WithPrefixLength{} + setCreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType(&this.PrefixLength, prefixLength) + return &this +} + +// NewCreateNetworkIPv6WithPrefixLengthWithDefaults instantiates a new CreateNetworkIPv6WithPrefixLength object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv6WithPrefixLengthWithDefaults() *CreateNetworkIPv6WithPrefixLength { + this := CreateNetworkIPv6WithPrefixLength{} + return &this +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv6WithPrefixLength) GetNameservers() (res CreateNetworkIPv6WithPrefixLengthGetNameserversRetType) { + res, _ = o.GetNameserversOk() + return +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefixLength) GetNameserversOk() (ret CreateNetworkIPv6WithPrefixLengthGetNameserversRetType, ok bool) { + return getCreateNetworkIPv6WithPrefixLengthGetNameserversAttributeTypeOk(o.Nameservers) +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv6WithPrefixLength) HasNameservers() bool { + _, ok := o.GetNameserversOk() + return ok +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv6WithPrefixLength) SetNameservers(v CreateNetworkIPv6WithPrefixLengthGetNameserversRetType) { + setCreateNetworkIPv6WithPrefixLengthGetNameserversAttributeType(&o.Nameservers, v) +} + +// GetPrefixLength returns the PrefixLength field value +func (o *CreateNetworkIPv6WithPrefixLength) GetPrefixLength() (ret CreateNetworkIPv6WithPrefixLengthGetPrefixLengthRetType) { + ret, _ = o.GetPrefixLengthOk() + return ret +} + +// GetPrefixLengthOk returns a tuple with the PrefixLength field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefixLength) GetPrefixLengthOk() (ret CreateNetworkIPv6WithPrefixLengthGetPrefixLengthRetType, ok bool) { + return getCreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeTypeOk(o.PrefixLength) +} + +// SetPrefixLength sets field value +func (o *CreateNetworkIPv6WithPrefixLength) SetPrefixLength(v CreateNetworkIPv6WithPrefixLengthGetPrefixLengthRetType) { + setCreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType(&o.PrefixLength, v) +} + +func (o CreateNetworkIPv6WithPrefixLength) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateNetworkIPv6WithPrefixLengthGetNameserversAttributeTypeOk(o.Nameservers); ok { + toSerialize["Nameservers"] = val + } + if val, ok := getCreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeTypeOk(o.PrefixLength); ok { + toSerialize["PrefixLength"] = val + } + return toSerialize, nil +} + +type NullableCreateNetworkIPv6WithPrefixLength struct { + value *CreateNetworkIPv6WithPrefixLength + isSet bool +} + +func (v NullableCreateNetworkIPv6WithPrefixLength) Get() *CreateNetworkIPv6WithPrefixLength { + return v.value +} + +func (v *NullableCreateNetworkIPv6WithPrefixLength) Set(val *CreateNetworkIPv6WithPrefixLength) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6WithPrefixLength) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6WithPrefixLength) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6WithPrefixLength(val *CreateNetworkIPv6WithPrefixLength) *NullableCreateNetworkIPv6WithPrefixLength { + return &NullableCreateNetworkIPv6WithPrefixLength{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6WithPrefixLength) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6WithPrefixLength) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_create_network_ipv6_with_prefix_length_test.go b/services/iaas/model_create_network_ipv6_with_prefix_length_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_create_network_ipv6_with_prefix_length_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_create_network_ipv6_with_prefix_test.go b/services/iaas/model_create_network_ipv6_with_prefix_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_create_network_ipv6_with_prefix_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_create_network_payload.go b/services/iaas/model_create_network_payload.go index 2dd399a31..1eb525e0c 100644 --- a/services/iaas/model_create_network_payload.go +++ b/services/iaas/model_create_network_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,42 +18,62 @@ import ( var _ MappedNullable = &CreateNetworkPayload{} /* - types and functions for addressFamily + types and functions for dhcp +*/ + +// isBoolean +type CreateNetworkPayloadgetDhcpAttributeType = *bool +type CreateNetworkPayloadgetDhcpArgType = bool +type CreateNetworkPayloadgetDhcpRetType = bool + +func getCreateNetworkPayloadgetDhcpAttributeTypeOk(arg CreateNetworkPayloadgetDhcpAttributeType) (ret CreateNetworkPayloadgetDhcpRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkPayloadgetDhcpAttributeType(arg *CreateNetworkPayloadgetDhcpAttributeType, val CreateNetworkPayloadgetDhcpRetType) { + *arg = &val +} + +/* + types and functions for ipv4 */ // isModel -type CreateNetworkPayloadGetAddressFamilyAttributeType = *CreateNetworkAddressFamily -type CreateNetworkPayloadGetAddressFamilyArgType = CreateNetworkAddressFamily -type CreateNetworkPayloadGetAddressFamilyRetType = CreateNetworkAddressFamily +type CreateNetworkPayloadGetIpv4AttributeType = *CreateNetworkIPv4 +type CreateNetworkPayloadGetIpv4ArgType = CreateNetworkIPv4 +type CreateNetworkPayloadGetIpv4RetType = CreateNetworkIPv4 -func getCreateNetworkPayloadGetAddressFamilyAttributeTypeOk(arg CreateNetworkPayloadGetAddressFamilyAttributeType) (ret CreateNetworkPayloadGetAddressFamilyRetType, ok bool) { +func getCreateNetworkPayloadGetIpv4AttributeTypeOk(arg CreateNetworkPayloadGetIpv4AttributeType) (ret CreateNetworkPayloadGetIpv4RetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setCreateNetworkPayloadGetAddressFamilyAttributeType(arg *CreateNetworkPayloadGetAddressFamilyAttributeType, val CreateNetworkPayloadGetAddressFamilyRetType) { +func setCreateNetworkPayloadGetIpv4AttributeType(arg *CreateNetworkPayloadGetIpv4AttributeType, val CreateNetworkPayloadGetIpv4RetType) { *arg = &val } /* - types and functions for dhcp + types and functions for ipv6 */ -// isBoolean -type CreateNetworkPayloadgetDhcpAttributeType = *bool -type CreateNetworkPayloadgetDhcpArgType = bool -type CreateNetworkPayloadgetDhcpRetType = bool +// isModel +type CreateNetworkPayloadGetIpv6AttributeType = *CreateNetworkIPv6 +type CreateNetworkPayloadGetIpv6ArgType = CreateNetworkIPv6 +type CreateNetworkPayloadGetIpv6RetType = CreateNetworkIPv6 -func getCreateNetworkPayloadgetDhcpAttributeTypeOk(arg CreateNetworkPayloadgetDhcpAttributeType) (ret CreateNetworkPayloadgetDhcpRetType, ok bool) { +func getCreateNetworkPayloadGetIpv6AttributeTypeOk(arg CreateNetworkPayloadGetIpv6AttributeType) (ret CreateNetworkPayloadGetIpv6RetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setCreateNetworkPayloadgetDhcpAttributeType(arg *CreateNetworkPayloadgetDhcpAttributeType, val CreateNetworkPayloadgetDhcpRetType) { +func setCreateNetworkPayloadGetIpv6AttributeType(arg *CreateNetworkPayloadGetIpv6AttributeType, val CreateNetworkPayloadGetIpv6RetType) { *arg = &val } @@ -118,11 +138,33 @@ func setCreateNetworkPayloadgetRoutedAttributeType(arg *CreateNetworkPayloadgetR *arg = &val } +/* + types and functions for routingTableId +*/ + +// isNotNullableString +type CreateNetworkPayloadGetRoutingTableIdAttributeType = *string + +func getCreateNetworkPayloadGetRoutingTableIdAttributeTypeOk(arg CreateNetworkPayloadGetRoutingTableIdAttributeType) (ret CreateNetworkPayloadGetRoutingTableIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkPayloadGetRoutingTableIdAttributeType(arg *CreateNetworkPayloadGetRoutingTableIdAttributeType, val CreateNetworkPayloadGetRoutingTableIdRetType) { + *arg = &val +} + +type CreateNetworkPayloadGetRoutingTableIdArgType = string +type CreateNetworkPayloadGetRoutingTableIdRetType = string + // CreateNetworkPayload Object that represents the request body for a network create. type CreateNetworkPayload struct { - AddressFamily CreateNetworkPayloadGetAddressFamilyAttributeType `json:"addressFamily,omitempty"` // Enable or disable DHCP for a network. Dhcp CreateNetworkPayloadgetDhcpAttributeType `json:"dhcp,omitempty"` + Ipv4 CreateNetworkPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` + Ipv6 CreateNetworkPayloadGetIpv6AttributeType `json:"ipv6,omitempty"` // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Labels CreateNetworkPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. @@ -130,6 +172,8 @@ type CreateNetworkPayload struct { Name CreateNetworkPayloadGetNameAttributeType `json:"name" required:"true"` // Shows if the network is routed and therefore accessible from other networks. Routed CreateNetworkPayloadgetRoutedAttributeType `json:"routed,omitempty"` + // Universally Unique Identifier (UUID). + RoutingTableId CreateNetworkPayloadGetRoutingTableIdAttributeType `json:"routingTableId,omitempty"` } type _CreateNetworkPayload CreateNetworkPayload @@ -154,29 +198,6 @@ func NewCreateNetworkPayloadWithDefaults() *CreateNetworkPayload { return &this } -// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. -func (o *CreateNetworkPayload) GetAddressFamily() (res CreateNetworkPayloadGetAddressFamilyRetType) { - res, _ = o.GetAddressFamilyOk() - return -} - -// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateNetworkPayload) GetAddressFamilyOk() (ret CreateNetworkPayloadGetAddressFamilyRetType, ok bool) { - return getCreateNetworkPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily) -} - -// HasAddressFamily returns a boolean if a field has been set. -func (o *CreateNetworkPayload) HasAddressFamily() bool { - _, ok := o.GetAddressFamilyOk() - return ok -} - -// SetAddressFamily gets a reference to the given CreateNetworkAddressFamily and assigns it to the AddressFamily field. -func (o *CreateNetworkPayload) SetAddressFamily(v CreateNetworkPayloadGetAddressFamilyRetType) { - setCreateNetworkPayloadGetAddressFamilyAttributeType(&o.AddressFamily, v) -} - // GetDhcp returns the Dhcp field value if set, zero value otherwise. func (o *CreateNetworkPayload) GetDhcp() (res CreateNetworkPayloadgetDhcpRetType) { res, _ = o.GetDhcpOk() @@ -200,6 +221,52 @@ func (o *CreateNetworkPayload) SetDhcp(v CreateNetworkPayloadgetDhcpRetType) { setCreateNetworkPayloadgetDhcpAttributeType(&o.Dhcp, v) } +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetIpv4() (res CreateNetworkPayloadGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetIpv4Ok() (ret CreateNetworkPayloadGetIpv4RetType, ok bool) { + return getCreateNetworkPayloadGetIpv4AttributeTypeOk(o.Ipv4) +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasIpv4() bool { + _, ok := o.GetIpv4Ok() + return ok +} + +// SetIpv4 gets a reference to the given CreateNetworkIPv4 and assigns it to the Ipv4 field. +func (o *CreateNetworkPayload) SetIpv4(v CreateNetworkPayloadGetIpv4RetType) { + setCreateNetworkPayloadGetIpv4AttributeType(&o.Ipv4, v) +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetIpv6() (res CreateNetworkPayloadGetIpv6RetType) { + res, _ = o.GetIpv6Ok() + return +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetIpv6Ok() (ret CreateNetworkPayloadGetIpv6RetType, ok bool) { + return getCreateNetworkPayloadGetIpv6AttributeTypeOk(o.Ipv6) +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasIpv6() bool { + _, ok := o.GetIpv6Ok() + return ok +} + +// SetIpv6 gets a reference to the given CreateNetworkIPv6 and assigns it to the Ipv6 field. +func (o *CreateNetworkPayload) SetIpv6(v CreateNetworkPayloadGetIpv6RetType) { + setCreateNetworkPayloadGetIpv6AttributeType(&o.Ipv6, v) +} + // GetLabels returns the Labels field value if set, zero value otherwise. func (o *CreateNetworkPayload) GetLabels() (res CreateNetworkPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() @@ -263,14 +330,40 @@ func (o *CreateNetworkPayload) SetRouted(v CreateNetworkPayloadgetRoutedRetType) setCreateNetworkPayloadgetRoutedAttributeType(&o.Routed, v) } +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetRoutingTableId() (res CreateNetworkPayloadGetRoutingTableIdRetType) { + res, _ = o.GetRoutingTableIdOk() + return +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetRoutingTableIdOk() (ret CreateNetworkPayloadGetRoutingTableIdRetType, ok bool) { + return getCreateNetworkPayloadGetRoutingTableIdAttributeTypeOk(o.RoutingTableId) +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasRoutingTableId() bool { + _, ok := o.GetRoutingTableIdOk() + return ok +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *CreateNetworkPayload) SetRoutingTableId(v CreateNetworkPayloadGetRoutingTableIdRetType) { + setCreateNetworkPayloadGetRoutingTableIdAttributeType(&o.RoutingTableId, v) +} + func (o CreateNetworkPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getCreateNetworkPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily); ok { - toSerialize["AddressFamily"] = val - } if val, ok := getCreateNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp); ok { toSerialize["Dhcp"] = val } + if val, ok := getCreateNetworkPayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val + } + if val, ok := getCreateNetworkPayloadGetIpv6AttributeTypeOk(o.Ipv6); ok { + toSerialize["Ipv6"] = val + } if val, ok := getCreateNetworkPayloadGetLabelsAttributeTypeOk(o.Labels); ok { toSerialize["Labels"] = val } @@ -280,6 +373,9 @@ func (o CreateNetworkPayload) ToMap() (map[string]interface{}, error) { if val, ok := getCreateNetworkPayloadgetRoutedAttributeTypeOk(o.Routed); ok { toSerialize["Routed"] = val } + if val, ok := getCreateNetworkPayloadGetRoutingTableIdAttributeTypeOk(o.RoutingTableId); ok { + toSerialize["RoutingTableId"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_create_network_payload_test.go b/services/iaas/model_create_network_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_network_payload_test.go +++ b/services/iaas/model_create_network_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_nic_payload.go b/services/iaas/model_create_nic_payload.go index adda25ba5..00f4cbd12 100644 --- a/services/iaas/model_create_nic_payload.go +++ b/services/iaas/model_create_nic_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_nic_payload_test.go b/services/iaas/model_create_nic_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_nic_payload_test.go +++ b/services/iaas/model_create_nic_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_protocol.go b/services/iaas/model_create_protocol.go index 6cd3bc1d4..e5d06c3a5 100644 --- a/services/iaas/model_create_protocol.go +++ b/services/iaas/model_create_protocol.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_protocol_test.go b/services/iaas/model_create_protocol_test.go index 0b82ac99d..2bb721294 100644 --- a/services/iaas/model_create_protocol_test.go +++ b/services/iaas/model_create_protocol_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_public_ip_payload.go b/services/iaas/model_create_public_ip_payload.go index 18724483b..d5774528e 100644 --- a/services/iaas/model_create_public_ip_payload.go +++ b/services/iaas/model_create_public_ip_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -108,7 +108,7 @@ type CreatePublicIPPayloadGetNetworkInterfaceRetType = *string type CreatePublicIPPayload struct { // Universally Unique Identifier (UUID). Id CreatePublicIPPayloadGetIdAttributeType `json:"id,omitempty"` - // Object that represents an IP address. + // String that represents an IPv4 address. Ip CreatePublicIPPayloadGetIpAttributeType `json:"ip,omitempty"` // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Labels CreatePublicIPPayloadGetLabelsAttributeType `json:"labels,omitempty"` diff --git a/services/iaas/model_create_public_ip_payload_test.go b/services/iaas/model_create_public_ip_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_public_ip_payload_test.go +++ b/services/iaas/model_create_public_ip_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_security_group_payload.go b/services/iaas/model_create_security_group_payload.go index 37dc93b44..9016a7ad8 100644 --- a/services/iaas/model_create_security_group_payload.go +++ b/services/iaas/model_create_security_group_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_security_group_payload_test.go b/services/iaas/model_create_security_group_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_security_group_payload_test.go +++ b/services/iaas/model_create_security_group_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_security_group_rule_payload.go b/services/iaas/model_create_security_group_rule_payload.go index 6fc2154cb..32175cb06 100644 --- a/services/iaas/model_create_security_group_rule_payload.go +++ b/services/iaas/model_create_security_group_rule_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_security_group_rule_payload_test.go b/services/iaas/model_create_security_group_rule_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_security_group_rule_payload_test.go +++ b/services/iaas/model_create_security_group_rule_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_security_group_rule_protocol.go b/services/iaas/model_create_security_group_rule_protocol.go index 2713d641e..61cf85373 100644 --- a/services/iaas/model_create_security_group_rule_protocol.go +++ b/services/iaas/model_create_security_group_rule_protocol.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_security_group_rule_protocol_test.go b/services/iaas/model_create_security_group_rule_protocol_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_security_group_rule_protocol_test.go +++ b/services/iaas/model_create_security_group_rule_protocol_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_server_networking.go b/services/iaas/model_create_server_networking.go index 991f6818d..542e65471 100644 --- a/services/iaas/model_create_server_networking.go +++ b/services/iaas/model_create_server_networking.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_server_networking_test.go b/services/iaas/model_create_server_networking_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_server_networking_test.go +++ b/services/iaas/model_create_server_networking_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_server_networking_with_nics.go b/services/iaas/model_create_server_networking_with_nics.go index f391f57cd..adff5ea41 100644 --- a/services/iaas/model_create_server_networking_with_nics.go +++ b/services/iaas/model_create_server_networking_with_nics.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_server_networking_with_nics_test.go b/services/iaas/model_create_server_networking_with_nics_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_server_networking_with_nics_test.go +++ b/services/iaas/model_create_server_networking_with_nics_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_server_payload.go b/services/iaas/model_create_server_payload.go index d2dc20685..2e38fd194 100644 --- a/services/iaas/model_create_server_payload.go +++ b/services/iaas/model_create_server_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -85,9 +85,9 @@ type CreateServerPayloadGetAvailabilityZoneRetType = string */ // isModel -type CreateServerPayloadGetBootVolumeAttributeType = *CreateServerPayloadBootVolume -type CreateServerPayloadGetBootVolumeArgType = CreateServerPayloadBootVolume -type CreateServerPayloadGetBootVolumeRetType = CreateServerPayloadBootVolume +type CreateServerPayloadGetBootVolumeAttributeType = *ServerBootVolume +type CreateServerPayloadGetBootVolumeArgType = ServerBootVolume +type CreateServerPayloadGetBootVolumeRetType = ServerBootVolume func getCreateServerPayloadGetBootVolumeAttributeTypeOk(arg CreateServerPayloadGetBootVolumeAttributeType) (ret CreateServerPayloadGetBootVolumeRetType, ok bool) { if arg == nil { @@ -331,9 +331,9 @@ type CreateServerPayloadGetNameRetType = string */ // isModel -type CreateServerPayloadGetNetworkingAttributeType = *CreateServerPayloadNetworking -type CreateServerPayloadGetNetworkingArgType = CreateServerPayloadNetworking -type CreateServerPayloadGetNetworkingRetType = CreateServerPayloadNetworking +type CreateServerPayloadGetNetworkingAttributeType = *CreateServerPayloadAllOfNetworking +type CreateServerPayloadGetNetworkingArgType = CreateServerPayloadAllOfNetworking +type CreateServerPayloadGetNetworkingRetType = CreateServerPayloadAllOfNetworking func getCreateServerPayloadGetNetworkingAttributeTypeOk(arg CreateServerPayloadGetNetworkingAttributeType) (ret CreateServerPayloadGetNetworkingRetType, ok bool) { if arg == nil { @@ -508,7 +508,7 @@ func setCreateServerPayloadGetVolumesAttributeType(arg *CreateServerPayloadGetVo *arg = &val } -// CreateServerPayload Representation of a single server object. +// CreateServerPayload Object that represents the request body for a server create. type CreateServerPayload struct { // Universally Unique Identifier (UUID). AffinityGroup CreateServerPayloadGetAffinityGroupAttributeType `json:"affinityGroup,omitempty"` @@ -538,8 +538,9 @@ type CreateServerPayload struct { Metadata CreateServerPayloadGetMetadataAttributeType `json:"metadata,omitempty"` // The name for a Server. // REQUIRED - Name CreateServerPayloadGetNameAttributeType `json:"name" required:"true"` - Networking CreateServerPayloadGetNetworkingAttributeType `json:"networking,omitempty"` + Name CreateServerPayloadGetNameAttributeType `json:"name" required:"true"` + // REQUIRED + Networking CreateServerPayloadGetNetworkingAttributeType `json:"networking" required:"true"` // A list of networks attached to a server. Nics CreateServerPayloadGetNicsAttributeType `json:"nics,omitempty"` // The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`. @@ -564,10 +565,11 @@ type _CreateServerPayload CreateServerPayload // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCreateServerPayload(machineType CreateServerPayloadGetMachineTypeArgType, name CreateServerPayloadGetNameArgType) *CreateServerPayload { +func NewCreateServerPayload(machineType CreateServerPayloadGetMachineTypeArgType, name CreateServerPayloadGetNameArgType, networking CreateServerPayloadGetNetworkingArgType) *CreateServerPayload { this := CreateServerPayload{} setCreateServerPayloadGetMachineTypeAttributeType(&this.MachineType, machineType) setCreateServerPayloadGetNameAttributeType(&this.Name, name) + setCreateServerPayloadGetNetworkingAttributeType(&this.Networking, networking) return &this } @@ -666,7 +668,7 @@ func (o *CreateServerPayload) HasBootVolume() bool { return ok } -// SetBootVolume gets a reference to the given CreateServerPayloadBootVolume and assigns it to the BootVolume field. +// SetBootVolume gets a reference to the given ServerBootVolume and assigns it to the BootVolume field. func (o *CreateServerPayload) SetBootVolume(v CreateServerPayloadGetBootVolumeRetType) { setCreateServerPayloadGetBootVolumeAttributeType(&o.BootVolume, v) } @@ -912,25 +914,19 @@ func (o *CreateServerPayload) SetName(v CreateServerPayloadGetNameRetType) { setCreateServerPayloadGetNameAttributeType(&o.Name, v) } -// GetNetworking returns the Networking field value if set, zero value otherwise. -func (o *CreateServerPayload) GetNetworking() (res CreateServerPayloadGetNetworkingRetType) { - res, _ = o.GetNetworkingOk() - return +// GetNetworking returns the Networking field value +func (o *CreateServerPayload) GetNetworking() (ret CreateServerPayloadGetNetworkingRetType) { + ret, _ = o.GetNetworkingOk() + return ret } -// GetNetworkingOk returns a tuple with the Networking field value if set, nil otherwise +// GetNetworkingOk returns a tuple with the Networking field value // and a boolean to check if the value has been set. func (o *CreateServerPayload) GetNetworkingOk() (ret CreateServerPayloadGetNetworkingRetType, ok bool) { return getCreateServerPayloadGetNetworkingAttributeTypeOk(o.Networking) } -// HasNetworking returns a boolean if a field has been set. -func (o *CreateServerPayload) HasNetworking() bool { - _, ok := o.GetNetworkingOk() - return ok -} - -// SetNetworking gets a reference to the given CreateServerPayloadNetworking and assigns it to the Networking field. +// SetNetworking sets field value func (o *CreateServerPayload) SetNetworking(v CreateServerPayloadGetNetworkingRetType) { setCreateServerPayloadGetNetworkingAttributeType(&o.Networking, v) } diff --git a/services/iaas/model_create_server_payload_all_of.go b/services/iaas/model_create_server_payload_all_of.go new file mode 100644 index 000000000..e992961b4 --- /dev/null +++ b/services/iaas/model_create_server_payload_all_of.go @@ -0,0 +1,125 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the CreateServerPayloadAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateServerPayloadAllOf{} + +/* + types and functions for networking +*/ + +// isModel +type CreateServerPayloadAllOfGetNetworkingAttributeType = *CreateServerPayloadAllOfNetworking +type CreateServerPayloadAllOfGetNetworkingArgType = CreateServerPayloadAllOfNetworking +type CreateServerPayloadAllOfGetNetworkingRetType = CreateServerPayloadAllOfNetworking + +func getCreateServerPayloadAllOfGetNetworkingAttributeTypeOk(arg CreateServerPayloadAllOfGetNetworkingAttributeType) (ret CreateServerPayloadAllOfGetNetworkingRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadAllOfGetNetworkingAttributeType(arg *CreateServerPayloadAllOfGetNetworkingAttributeType, val CreateServerPayloadAllOfGetNetworkingRetType) { + *arg = &val +} + +// CreateServerPayloadAllOf struct for CreateServerPayloadAllOf +type CreateServerPayloadAllOf struct { + // REQUIRED + Networking CreateServerPayloadAllOfGetNetworkingAttributeType `json:"networking" required:"true"` +} + +type _CreateServerPayloadAllOf CreateServerPayloadAllOf + +// NewCreateServerPayloadAllOf instantiates a new CreateServerPayloadAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateServerPayloadAllOf(networking CreateServerPayloadAllOfGetNetworkingArgType) *CreateServerPayloadAllOf { + this := CreateServerPayloadAllOf{} + setCreateServerPayloadAllOfGetNetworkingAttributeType(&this.Networking, networking) + return &this +} + +// NewCreateServerPayloadAllOfWithDefaults instantiates a new CreateServerPayloadAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateServerPayloadAllOfWithDefaults() *CreateServerPayloadAllOf { + this := CreateServerPayloadAllOf{} + return &this +} + +// GetNetworking returns the Networking field value +func (o *CreateServerPayloadAllOf) GetNetworking() (ret CreateServerPayloadAllOfGetNetworkingRetType) { + ret, _ = o.GetNetworkingOk() + return ret +} + +// GetNetworkingOk returns a tuple with the Networking field value +// and a boolean to check if the value has been set. +func (o *CreateServerPayloadAllOf) GetNetworkingOk() (ret CreateServerPayloadAllOfGetNetworkingRetType, ok bool) { + return getCreateServerPayloadAllOfGetNetworkingAttributeTypeOk(o.Networking) +} + +// SetNetworking sets field value +func (o *CreateServerPayloadAllOf) SetNetworking(v CreateServerPayloadAllOfGetNetworkingRetType) { + setCreateServerPayloadAllOfGetNetworkingAttributeType(&o.Networking, v) +} + +func (o CreateServerPayloadAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateServerPayloadAllOfGetNetworkingAttributeTypeOk(o.Networking); ok { + toSerialize["Networking"] = val + } + return toSerialize, nil +} + +type NullableCreateServerPayloadAllOf struct { + value *CreateServerPayloadAllOf + isSet bool +} + +func (v NullableCreateServerPayloadAllOf) Get() *CreateServerPayloadAllOf { + return v.value +} + +func (v *NullableCreateServerPayloadAllOf) Set(val *CreateServerPayloadAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerPayloadAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerPayloadAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerPayloadAllOf(val *CreateServerPayloadAllOf) *NullableCreateServerPayloadAllOf { + return &NullableCreateServerPayloadAllOf{value: val, isSet: true} +} + +func (v NullableCreateServerPayloadAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerPayloadAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_create_server_payload_all_of_networking.go b/services/iaas/model_create_server_payload_all_of_networking.go new file mode 100644 index 000000000..25336cf8c --- /dev/null +++ b/services/iaas/model_create_server_payload_all_of_networking.go @@ -0,0 +1,144 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" + "fmt" +) + +// CreateServerPayloadAllOfNetworking - struct for CreateServerPayloadAllOfNetworking +type CreateServerPayloadAllOfNetworking struct { + CreateServerNetworking *CreateServerNetworking + CreateServerNetworkingWithNics *CreateServerNetworkingWithNics +} + +// CreateServerNetworkingAsCreateServerPayloadAllOfNetworking is a convenience function that returns CreateServerNetworking wrapped in CreateServerPayloadAllOfNetworking +func CreateServerNetworkingAsCreateServerPayloadAllOfNetworking(v *CreateServerNetworking) CreateServerPayloadAllOfNetworking { + return CreateServerPayloadAllOfNetworking{ + CreateServerNetworking: v, + } +} + +// CreateServerNetworkingWithNicsAsCreateServerPayloadAllOfNetworking is a convenience function that returns CreateServerNetworkingWithNics wrapped in CreateServerPayloadAllOfNetworking +func CreateServerNetworkingWithNicsAsCreateServerPayloadAllOfNetworking(v *CreateServerNetworkingWithNics) CreateServerPayloadAllOfNetworking { + return CreateServerPayloadAllOfNetworking{ + CreateServerNetworkingWithNics: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateServerPayloadAllOfNetworking) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // Workaround until upstream issue is fixed: + // https://github.com/OpenAPITools/openapi-generator/issues/21751 + // Tracking issue on our side: https://jira.schwarz/browse/STACKITSDK-226 + // try to unmarshal data into CreateServerNetworking + dstCreateServerPayloadAllOfNetworking1 := &CreateServerPayloadAllOfNetworking{} + err = json.Unmarshal(data, &dstCreateServerPayloadAllOfNetworking1.CreateServerNetworking) + if err == nil { + jsonCreateServerNetworking, _ := json.Marshal(&dstCreateServerPayloadAllOfNetworking1.CreateServerNetworking) + if string(jsonCreateServerNetworking) != "{}" { // empty struct + dst.CreateServerNetworking = dstCreateServerPayloadAllOfNetworking1.CreateServerNetworking + match++ + } + } + + // try to unmarshal data into CreateServerNetworkingWithNics + dstCreateServerPayloadAllOfNetworking2 := &CreateServerPayloadAllOfNetworking{} + err = json.Unmarshal(data, &dstCreateServerPayloadAllOfNetworking2.CreateServerNetworkingWithNics) + if err == nil { + jsonCreateServerNetworkingWithNics, _ := json.Marshal(&dstCreateServerPayloadAllOfNetworking2.CreateServerNetworkingWithNics) + if string(jsonCreateServerNetworkingWithNics) != "{}" { // empty struct + dst.CreateServerNetworkingWithNics = dstCreateServerPayloadAllOfNetworking2.CreateServerNetworkingWithNics + match++ + } + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateServerNetworking = nil + dst.CreateServerNetworkingWithNics = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateServerPayloadAllOfNetworking)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateServerPayloadAllOfNetworking)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateServerPayloadAllOfNetworking) MarshalJSON() ([]byte, error) { + if src.CreateServerNetworking != nil { + return json.Marshal(&src.CreateServerNetworking) + } + + if src.CreateServerNetworkingWithNics != nil { + return json.Marshal(&src.CreateServerNetworkingWithNics) + } + + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object +} + +// Get the actual instance +func (obj *CreateServerPayloadAllOfNetworking) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateServerNetworking != nil { + return obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +type NullableCreateServerPayloadAllOfNetworking struct { + value *CreateServerPayloadAllOfNetworking + isSet bool +} + +func (v NullableCreateServerPayloadAllOfNetworking) Get() *CreateServerPayloadAllOfNetworking { + return v.value +} + +func (v *NullableCreateServerPayloadAllOfNetworking) Set(val *CreateServerPayloadAllOfNetworking) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerPayloadAllOfNetworking) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerPayloadAllOfNetworking) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerPayloadAllOfNetworking(val *CreateServerPayloadAllOfNetworking) *NullableCreateServerPayloadAllOfNetworking { + return &NullableCreateServerPayloadAllOfNetworking{value: val, isSet: true} +} + +func (v NullableCreateServerPayloadAllOfNetworking) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerPayloadAllOfNetworking) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_create_server_payload_all_of_networking_test.go b/services/iaas/model_create_server_payload_all_of_networking_test.go new file mode 100644 index 000000000..43a55f44e --- /dev/null +++ b/services/iaas/model_create_server_payload_all_of_networking_test.go @@ -0,0 +1,43 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "testing" +) + +// isOneOf + +func TestCreateServerPayloadAllOfNetworking_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{} + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := &CreateServerPayloadAllOfNetworking{} + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + marshalJson, err := v.MarshalJSON() + if err != nil { + t.Fatalf("failed marshalling CreateServerPayloadAllOfNetworking: %v", err) + } + if string(marshalJson) != string(tt.args.src) { + t.Fatalf("wanted %s, get %s", tt.args.src, marshalJson) + } + }) + } +} diff --git a/services/iaas/model_create_server_payload_all_of_test.go b/services/iaas/model_create_server_payload_all_of_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_create_server_payload_all_of_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_create_server_payload_test.go b/services/iaas/model_create_server_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_server_payload_test.go +++ b/services/iaas/model_create_server_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_snapshot_payload.go b/services/iaas/model_create_snapshot_payload.go index f8d75cbfe..3293855dc 100644 --- a/services/iaas/model_create_snapshot_payload.go +++ b/services/iaas/model_create_snapshot_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_snapshot_payload_test.go b/services/iaas/model_create_snapshot_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_snapshot_payload_test.go +++ b/services/iaas/model_create_snapshot_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_volume_payload.go b/services/iaas/model_create_volume_payload.go index b2e177d77..48a046db4 100644 --- a/services/iaas/model_create_volume_payload.go +++ b/services/iaas/model_create_volume_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_create_volume_payload_test.go b/services/iaas/model_create_volume_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_create_volume_payload_test.go +++ b/services/iaas/model_create_volume_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_destination_cidrv4.go b/services/iaas/model_destination_cidrv4.go new file mode 100644 index 000000000..a2cce9d1e --- /dev/null +++ b/services/iaas/model_destination_cidrv4.go @@ -0,0 +1,171 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the DestinationCIDRv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DestinationCIDRv4{} + +/* + types and functions for type +*/ + +// isNotNullableString +type DestinationCIDRv4GetTypeAttributeType = *string + +func getDestinationCIDRv4GetTypeAttributeTypeOk(arg DestinationCIDRv4GetTypeAttributeType) (ret DestinationCIDRv4GetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDestinationCIDRv4GetTypeAttributeType(arg *DestinationCIDRv4GetTypeAttributeType, val DestinationCIDRv4GetTypeRetType) { + *arg = &val +} + +type DestinationCIDRv4GetTypeArgType = string +type DestinationCIDRv4GetTypeRetType = string + +/* + types and functions for value +*/ + +// isNotNullableString +type DestinationCIDRv4GetValueAttributeType = *string + +func getDestinationCIDRv4GetValueAttributeTypeOk(arg DestinationCIDRv4GetValueAttributeType) (ret DestinationCIDRv4GetValueRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDestinationCIDRv4GetValueAttributeType(arg *DestinationCIDRv4GetValueAttributeType, val DestinationCIDRv4GetValueRetType) { + *arg = &val +} + +type DestinationCIDRv4GetValueArgType = string +type DestinationCIDRv4GetValueRetType = string + +// DestinationCIDRv4 IPv4 Classless Inter-Domain Routing (CIDR) Object. +type DestinationCIDRv4 struct { + // REQUIRED + Type DestinationCIDRv4GetTypeAttributeType `json:"type" required:"true"` + // An CIDRv4 string. + // REQUIRED + Value DestinationCIDRv4GetValueAttributeType `json:"value" required:"true"` +} + +type _DestinationCIDRv4 DestinationCIDRv4 + +// NewDestinationCIDRv4 instantiates a new DestinationCIDRv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDestinationCIDRv4(types DestinationCIDRv4GetTypeArgType, value DestinationCIDRv4GetValueArgType) *DestinationCIDRv4 { + this := DestinationCIDRv4{} + setDestinationCIDRv4GetTypeAttributeType(&this.Type, types) + setDestinationCIDRv4GetValueAttributeType(&this.Value, value) + return &this +} + +// NewDestinationCIDRv4WithDefaults instantiates a new DestinationCIDRv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDestinationCIDRv4WithDefaults() *DestinationCIDRv4 { + this := DestinationCIDRv4{} + return &this +} + +// GetType returns the Type field value +func (o *DestinationCIDRv4) GetType() (ret DestinationCIDRv4GetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv4) GetTypeOk() (ret DestinationCIDRv4GetTypeRetType, ok bool) { + return getDestinationCIDRv4GetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +func (o *DestinationCIDRv4) SetType(v DestinationCIDRv4GetTypeRetType) { + setDestinationCIDRv4GetTypeAttributeType(&o.Type, v) +} + +// GetValue returns the Value field value +func (o *DestinationCIDRv4) GetValue() (ret DestinationCIDRv4GetValueRetType) { + ret, _ = o.GetValueOk() + return ret +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv4) GetValueOk() (ret DestinationCIDRv4GetValueRetType, ok bool) { + return getDestinationCIDRv4GetValueAttributeTypeOk(o.Value) +} + +// SetValue sets field value +func (o *DestinationCIDRv4) SetValue(v DestinationCIDRv4GetValueRetType) { + setDestinationCIDRv4GetValueAttributeType(&o.Value, v) +} + +func (o DestinationCIDRv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getDestinationCIDRv4GetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + if val, ok := getDestinationCIDRv4GetValueAttributeTypeOk(o.Value); ok { + toSerialize["Value"] = val + } + return toSerialize, nil +} + +type NullableDestinationCIDRv4 struct { + value *DestinationCIDRv4 + isSet bool +} + +func (v NullableDestinationCIDRv4) Get() *DestinationCIDRv4 { + return v.value +} + +func (v *NullableDestinationCIDRv4) Set(val *DestinationCIDRv4) { + v.value = val + v.isSet = true +} + +func (v NullableDestinationCIDRv4) IsSet() bool { + return v.isSet +} + +func (v *NullableDestinationCIDRv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDestinationCIDRv4(val *DestinationCIDRv4) *NullableDestinationCIDRv4 { + return &NullableDestinationCIDRv4{value: val, isSet: true} +} + +func (v NullableDestinationCIDRv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDestinationCIDRv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_destination_cidrv4_test.go b/services/iaas/model_destination_cidrv4_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_destination_cidrv4_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_destination_cidrv6.go b/services/iaas/model_destination_cidrv6.go new file mode 100644 index 000000000..90fbc94a8 --- /dev/null +++ b/services/iaas/model_destination_cidrv6.go @@ -0,0 +1,171 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the DestinationCIDRv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DestinationCIDRv6{} + +/* + types and functions for type +*/ + +// isNotNullableString +type DestinationCIDRv6GetTypeAttributeType = *string + +func getDestinationCIDRv6GetTypeAttributeTypeOk(arg DestinationCIDRv6GetTypeAttributeType) (ret DestinationCIDRv6GetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDestinationCIDRv6GetTypeAttributeType(arg *DestinationCIDRv6GetTypeAttributeType, val DestinationCIDRv6GetTypeRetType) { + *arg = &val +} + +type DestinationCIDRv6GetTypeArgType = string +type DestinationCIDRv6GetTypeRetType = string + +/* + types and functions for value +*/ + +// isNotNullableString +type DestinationCIDRv6GetValueAttributeType = *string + +func getDestinationCIDRv6GetValueAttributeTypeOk(arg DestinationCIDRv6GetValueAttributeType) (ret DestinationCIDRv6GetValueRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDestinationCIDRv6GetValueAttributeType(arg *DestinationCIDRv6GetValueAttributeType, val DestinationCIDRv6GetValueRetType) { + *arg = &val +} + +type DestinationCIDRv6GetValueArgType = string +type DestinationCIDRv6GetValueRetType = string + +// DestinationCIDRv6 IPv6 Classless Inter-Domain Routing (CIDR) Object. +type DestinationCIDRv6 struct { + // REQUIRED + Type DestinationCIDRv6GetTypeAttributeType `json:"type" required:"true"` + // An CIDRv6 string. + // REQUIRED + Value DestinationCIDRv6GetValueAttributeType `json:"value" required:"true"` +} + +type _DestinationCIDRv6 DestinationCIDRv6 + +// NewDestinationCIDRv6 instantiates a new DestinationCIDRv6 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDestinationCIDRv6(types DestinationCIDRv6GetTypeArgType, value DestinationCIDRv6GetValueArgType) *DestinationCIDRv6 { + this := DestinationCIDRv6{} + setDestinationCIDRv6GetTypeAttributeType(&this.Type, types) + setDestinationCIDRv6GetValueAttributeType(&this.Value, value) + return &this +} + +// NewDestinationCIDRv6WithDefaults instantiates a new DestinationCIDRv6 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDestinationCIDRv6WithDefaults() *DestinationCIDRv6 { + this := DestinationCIDRv6{} + return &this +} + +// GetType returns the Type field value +func (o *DestinationCIDRv6) GetType() (ret DestinationCIDRv6GetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv6) GetTypeOk() (ret DestinationCIDRv6GetTypeRetType, ok bool) { + return getDestinationCIDRv6GetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +func (o *DestinationCIDRv6) SetType(v DestinationCIDRv6GetTypeRetType) { + setDestinationCIDRv6GetTypeAttributeType(&o.Type, v) +} + +// GetValue returns the Value field value +func (o *DestinationCIDRv6) GetValue() (ret DestinationCIDRv6GetValueRetType) { + ret, _ = o.GetValueOk() + return ret +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv6) GetValueOk() (ret DestinationCIDRv6GetValueRetType, ok bool) { + return getDestinationCIDRv6GetValueAttributeTypeOk(o.Value) +} + +// SetValue sets field value +func (o *DestinationCIDRv6) SetValue(v DestinationCIDRv6GetValueRetType) { + setDestinationCIDRv6GetValueAttributeType(&o.Value, v) +} + +func (o DestinationCIDRv6) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getDestinationCIDRv6GetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + if val, ok := getDestinationCIDRv6GetValueAttributeTypeOk(o.Value); ok { + toSerialize["Value"] = val + } + return toSerialize, nil +} + +type NullableDestinationCIDRv6 struct { + value *DestinationCIDRv6 + isSet bool +} + +func (v NullableDestinationCIDRv6) Get() *DestinationCIDRv6 { + return v.value +} + +func (v *NullableDestinationCIDRv6) Set(val *DestinationCIDRv6) { + v.value = val + v.isSet = true +} + +func (v NullableDestinationCIDRv6) IsSet() bool { + return v.isSet +} + +func (v *NullableDestinationCIDRv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDestinationCIDRv6(val *DestinationCIDRv6) *NullableDestinationCIDRv6 { + return &NullableDestinationCIDRv6{value: val, isSet: true} +} + +func (v NullableDestinationCIDRv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDestinationCIDRv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_destination_cidrv6_test.go b/services/iaas/model_destination_cidrv6_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_destination_cidrv6_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_error.go b/services/iaas/model_error.go index 307d7926e..7c01cddf5 100644 --- a/services/iaas/model_error.go +++ b/services/iaas/model_error.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_error_test.go b/services/iaas/model_error_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_error_test.go +++ b/services/iaas/model_error_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_get_server_log_200_response.go b/services/iaas/model_get_server_log_200_response.go index fcc1dcbe8..5d82b69af 100644 --- a/services/iaas/model_get_server_log_200_response.go +++ b/services/iaas/model_get_server_log_200_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_get_server_log_200_response_test.go b/services/iaas/model_get_server_log_200_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_get_server_log_200_response_test.go +++ b/services/iaas/model_get_server_log_200_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_icmp_parameters.go b/services/iaas/model_icmp_parameters.go index 82d7b8021..90ebc8068 100644 --- a/services/iaas/model_icmp_parameters.go +++ b/services/iaas/model_icmp_parameters.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_icmp_parameters_test.go b/services/iaas/model_icmp_parameters_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_icmp_parameters_test.go +++ b/services/iaas/model_icmp_parameters_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image.go b/services/iaas/model_image.go index 4ea8f890e..fa53b5138 100644 --- a/services/iaas/model_image.go +++ b/services/iaas/model_image.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_agent.go b/services/iaas/model_image_agent.go index fd6445836..3f1ccf81a 100644 --- a/services/iaas/model_image_agent.go +++ b/services/iaas/model_image_agent.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_agent_test.go b/services/iaas/model_image_agent_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_image_agent_test.go +++ b/services/iaas/model_image_agent_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_checksum.go b/services/iaas/model_image_checksum.go index 67fc0b4f4..e08021819 100644 --- a/services/iaas/model_image_checksum.go +++ b/services/iaas/model_image_checksum.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_checksum_test.go b/services/iaas/model_image_checksum_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_image_checksum_test.go +++ b/services/iaas/model_image_checksum_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_config.go b/services/iaas/model_image_config.go index 2c0c56b5b..9e4aca234 100644 --- a/services/iaas/model_image_config.go +++ b/services/iaas/model_image_config.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_config_test.go b/services/iaas/model_image_config_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_image_config_test.go +++ b/services/iaas/model_image_config_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_create_response.go b/services/iaas/model_image_create_response.go index 1cae406a7..066c95222 100644 --- a/services/iaas/model_image_create_response.go +++ b/services/iaas/model_image_create_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_create_response_test.go b/services/iaas/model_image_create_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_image_create_response_test.go +++ b/services/iaas/model_image_create_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_list_response.go b/services/iaas/model_image_list_response.go index 348a8a08d..b00b3cbe2 100644 --- a/services/iaas/model_image_list_response.go +++ b/services/iaas/model_image_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_list_response_test.go b/services/iaas/model_image_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_image_list_response_test.go +++ b/services/iaas/model_image_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_share.go b/services/iaas/model_image_share.go index eff499acf..5a0cee26f 100644 --- a/services/iaas/model_image_share.go +++ b/services/iaas/model_image_share.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_share_consumer.go b/services/iaas/model_image_share_consumer.go index 386b94131..a88b88ad7 100644 --- a/services/iaas/model_image_share_consumer.go +++ b/services/iaas/model_image_share_consumer.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_share_consumer_test.go b/services/iaas/model_image_share_consumer_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_image_share_consumer_test.go +++ b/services/iaas/model_image_share_consumer_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_share_test.go b/services/iaas/model_image_share_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_image_share_test.go +++ b/services/iaas/model_image_share_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_image_test.go b/services/iaas/model_image_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_image_test.go +++ b/services/iaas/model_image_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_key_pair_list_response.go b/services/iaas/model_key_pair_list_response.go index cae9cc23d..0c268259a 100644 --- a/services/iaas/model_key_pair_list_response.go +++ b/services/iaas/model_key_pair_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_key_pair_list_response_test.go b/services/iaas/model_key_pair_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_key_pair_list_response_test.go +++ b/services/iaas/model_key_pair_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_keypair.go b/services/iaas/model_keypair.go index cc881e99b..0a9dcb65f 100644 --- a/services/iaas/model_keypair.go +++ b/services/iaas/model_keypair.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_keypair_test.go b/services/iaas/model_keypair_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_keypair_test.go +++ b/services/iaas/model_keypair_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_machine_type.go b/services/iaas/model_machine_type.go index 512d89aef..111d1ac21 100644 --- a/services/iaas/model_machine_type.go +++ b/services/iaas/model_machine_type.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_machine_type_list_response.go b/services/iaas/model_machine_type_list_response.go index f5597df05..c0d9f41a1 100644 --- a/services/iaas/model_machine_type_list_response.go +++ b/services/iaas/model_machine_type_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_machine_type_list_response_test.go b/services/iaas/model_machine_type_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_machine_type_list_response_test.go +++ b/services/iaas/model_machine_type_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_machine_type_test.go b/services/iaas/model_machine_type_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_machine_type_test.go +++ b/services/iaas/model_machine_type_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_network.go b/services/iaas/model_network.go index f2ac1f25e..cf269411c 100644 --- a/services/iaas/model_network.go +++ b/services/iaas/model_network.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -59,258 +59,168 @@ func setNetworkgetDhcpAttributeType(arg *NetworkgetDhcpAttributeType, val Networ } /* - types and functions for gateway -*/ - -// isNullableString -type NetworkGetGatewayAttributeType = *NullableString - -func getNetworkGetGatewayAttributeTypeOk(arg NetworkGetGatewayAttributeType) (ret NetworkGetGatewayRetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setNetworkGetGatewayAttributeType(arg *NetworkGetGatewayAttributeType, val NetworkGetGatewayRetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type NetworkGetGatewayArgType = *string -type NetworkGetGatewayRetType = *string - -/* - types and functions for gatewayv6 -*/ - -// isNullableString -type NetworkGetGatewayv6AttributeType = *NullableString - -func getNetworkGetGatewayv6AttributeTypeOk(arg NetworkGetGatewayv6AttributeType) (ret NetworkGetGatewayv6RetType, ok bool) { - if arg == nil { - return nil, false - } - return arg.Get(), true -} - -func setNetworkGetGatewayv6AttributeType(arg *NetworkGetGatewayv6AttributeType, val NetworkGetGatewayv6RetType) { - if IsNil(*arg) { - *arg = NewNullableString(val) - } else { - (*arg).Set(val) - } -} - -type NetworkGetGatewayv6ArgType = *string -type NetworkGetGatewayv6RetType = *string - -/* - types and functions for labels -*/ - -// isFreeform -type NetworkGetLabelsAttributeType = *map[string]interface{} -type NetworkGetLabelsArgType = map[string]interface{} -type NetworkGetLabelsRetType = map[string]interface{} - -func getNetworkGetLabelsAttributeTypeOk(arg NetworkGetLabelsAttributeType) (ret NetworkGetLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkGetLabelsAttributeType(arg *NetworkGetLabelsAttributeType, val NetworkGetLabelsRetType) { - *arg = &val -} - -/* - types and functions for name + types and functions for id */ // isNotNullableString -type NetworkGetNameAttributeType = *string +type NetworkGetIdAttributeType = *string -func getNetworkGetNameAttributeTypeOk(arg NetworkGetNameAttributeType) (ret NetworkGetNameRetType, ok bool) { +func getNetworkGetIdAttributeTypeOk(arg NetworkGetIdAttributeType) (ret NetworkGetIdRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setNetworkGetNameAttributeType(arg *NetworkGetNameAttributeType, val NetworkGetNameRetType) { +func setNetworkGetIdAttributeType(arg *NetworkGetIdAttributeType, val NetworkGetIdRetType) { *arg = &val } -type NetworkGetNameArgType = string -type NetworkGetNameRetType = string +type NetworkGetIdArgType = string +type NetworkGetIdRetType = string /* - types and functions for nameservers + types and functions for ipv4 */ -// isArray -type NetworkGetNameserversAttributeType = *[]string -type NetworkGetNameserversArgType = []string -type NetworkGetNameserversRetType = []string +// isModel +type NetworkGetIpv4AttributeType = *NetworkIPv4 +type NetworkGetIpv4ArgType = NetworkIPv4 +type NetworkGetIpv4RetType = NetworkIPv4 -func getNetworkGetNameserversAttributeTypeOk(arg NetworkGetNameserversAttributeType) (ret NetworkGetNameserversRetType, ok bool) { +func getNetworkGetIpv4AttributeTypeOk(arg NetworkGetIpv4AttributeType) (ret NetworkGetIpv4RetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setNetworkGetNameserversAttributeType(arg *NetworkGetNameserversAttributeType, val NetworkGetNameserversRetType) { +func setNetworkGetIpv4AttributeType(arg *NetworkGetIpv4AttributeType, val NetworkGetIpv4RetType) { *arg = &val } /* - types and functions for nameserversV6 + types and functions for ipv6 */ -// isArray -type NetworkGetNameserversV6AttributeType = *[]string -type NetworkGetNameserversV6ArgType = []string -type NetworkGetNameserversV6RetType = []string +// isModel +type NetworkGetIpv6AttributeType = *NetworkIPv6 +type NetworkGetIpv6ArgType = NetworkIPv6 +type NetworkGetIpv6RetType = NetworkIPv6 -func getNetworkGetNameserversV6AttributeTypeOk(arg NetworkGetNameserversV6AttributeType) (ret NetworkGetNameserversV6RetType, ok bool) { +func getNetworkGetIpv6AttributeTypeOk(arg NetworkGetIpv6AttributeType) (ret NetworkGetIpv6RetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setNetworkGetNameserversV6AttributeType(arg *NetworkGetNameserversV6AttributeType, val NetworkGetNameserversV6RetType) { +func setNetworkGetIpv6AttributeType(arg *NetworkGetIpv6AttributeType, val NetworkGetIpv6RetType) { *arg = &val } /* - types and functions for networkId + types and functions for labels */ -// isNotNullableString -type NetworkGetNetworkIdAttributeType = *string +// isFreeform +type NetworkGetLabelsAttributeType = *map[string]interface{} +type NetworkGetLabelsArgType = map[string]interface{} +type NetworkGetLabelsRetType = map[string]interface{} -func getNetworkGetNetworkIdAttributeTypeOk(arg NetworkGetNetworkIdAttributeType) (ret NetworkGetNetworkIdRetType, ok bool) { +func getNetworkGetLabelsAttributeTypeOk(arg NetworkGetLabelsAttributeType) (ret NetworkGetLabelsRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setNetworkGetNetworkIdAttributeType(arg *NetworkGetNetworkIdAttributeType, val NetworkGetNetworkIdRetType) { +func setNetworkGetLabelsAttributeType(arg *NetworkGetLabelsAttributeType, val NetworkGetLabelsRetType) { *arg = &val } -type NetworkGetNetworkIdArgType = string -type NetworkGetNetworkIdRetType = string - /* - types and functions for prefixes + types and functions for name */ -// isArray -type NetworkGetPrefixesAttributeType = *[]string -type NetworkGetPrefixesArgType = []string -type NetworkGetPrefixesRetType = []string +// isNotNullableString +type NetworkGetNameAttributeType = *string -func getNetworkGetPrefixesAttributeTypeOk(arg NetworkGetPrefixesAttributeType) (ret NetworkGetPrefixesRetType, ok bool) { +func getNetworkGetNameAttributeTypeOk(arg NetworkGetNameAttributeType) (ret NetworkGetNameRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setNetworkGetPrefixesAttributeType(arg *NetworkGetPrefixesAttributeType, val NetworkGetPrefixesRetType) { +func setNetworkGetNameAttributeType(arg *NetworkGetNameAttributeType, val NetworkGetNameRetType) { *arg = &val } +type NetworkGetNameArgType = string +type NetworkGetNameRetType = string + /* - types and functions for prefixesV6 + types and functions for routed */ -// isArray -type NetworkGetPrefixesV6AttributeType = *[]string -type NetworkGetPrefixesV6ArgType = []string -type NetworkGetPrefixesV6RetType = []string +// isBoolean +type NetworkgetRoutedAttributeType = *bool +type NetworkgetRoutedArgType = bool +type NetworkgetRoutedRetType = bool -func getNetworkGetPrefixesV6AttributeTypeOk(arg NetworkGetPrefixesV6AttributeType) (ret NetworkGetPrefixesV6RetType, ok bool) { +func getNetworkgetRoutedAttributeTypeOk(arg NetworkgetRoutedAttributeType) (ret NetworkgetRoutedRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setNetworkGetPrefixesV6AttributeType(arg *NetworkGetPrefixesV6AttributeType, val NetworkGetPrefixesV6RetType) { +func setNetworkgetRoutedAttributeType(arg *NetworkgetRoutedAttributeType, val NetworkgetRoutedRetType) { *arg = &val } /* - types and functions for publicIp + types and functions for routingTableId */ // isNotNullableString -type NetworkGetPublicIpAttributeType = *string +type NetworkGetRoutingTableIdAttributeType = *string -func getNetworkGetPublicIpAttributeTypeOk(arg NetworkGetPublicIpAttributeType) (ret NetworkGetPublicIpRetType, ok bool) { +func getNetworkGetRoutingTableIdAttributeTypeOk(arg NetworkGetRoutingTableIdAttributeType) (ret NetworkGetRoutingTableIdRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setNetworkGetPublicIpAttributeType(arg *NetworkGetPublicIpAttributeType, val NetworkGetPublicIpRetType) { +func setNetworkGetRoutingTableIdAttributeType(arg *NetworkGetRoutingTableIdAttributeType, val NetworkGetRoutingTableIdRetType) { *arg = &val } -type NetworkGetPublicIpArgType = string -type NetworkGetPublicIpRetType = string - -/* - types and functions for routed -*/ - -// isBoolean -type NetworkgetRoutedAttributeType = *bool -type NetworkgetRoutedArgType = bool -type NetworkgetRoutedRetType = bool - -func getNetworkgetRoutedAttributeTypeOk(arg NetworkgetRoutedAttributeType) (ret NetworkgetRoutedRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkgetRoutedAttributeType(arg *NetworkgetRoutedAttributeType, val NetworkgetRoutedRetType) { - *arg = &val -} +type NetworkGetRoutingTableIdArgType = string +type NetworkGetRoutingTableIdRetType = string /* - types and functions for state + types and functions for status */ // isNotNullableString -type NetworkGetStateAttributeType = *string +type NetworkGetStatusAttributeType = *string -func getNetworkGetStateAttributeTypeOk(arg NetworkGetStateAttributeType) (ret NetworkGetStateRetType, ok bool) { +func getNetworkGetStatusAttributeTypeOk(arg NetworkGetStatusAttributeType) (ret NetworkGetStatusRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setNetworkGetStateAttributeType(arg *NetworkGetStateAttributeType, val NetworkGetStateRetType) { +func setNetworkGetStatusAttributeType(arg *NetworkGetStatusAttributeType, val NetworkGetStatusRetType) { *arg = &val } -type NetworkGetStateArgType = string -type NetworkGetStateRetType = string +type NetworkGetStatusArgType = string +type NetworkGetStatusRetType = string /* types and functions for updatedAt @@ -332,36 +242,28 @@ func setNetworkGetUpdatedAtAttributeType(arg *NetworkGetUpdatedAtAttributeType, *arg = &val } -// Network Object that represents a network. +// Network Object that represents a network. If no routing table is specified, the default routing table is used. type Network struct { // Date-time when resource was created. CreatedAt NetworkGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Enable or disable DHCP for a network. Dhcp NetworkgetDhcpAttributeType `json:"dhcp,omitempty"` - // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gateway NetworkGetGatewayAttributeType `json:"gateway,omitempty"` - // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gatewayv6 NetworkGetGatewayv6AttributeType `json:"gatewayv6,omitempty"` + // Universally Unique Identifier (UUID). + // REQUIRED + Id NetworkGetIdAttributeType `json:"id" required:"true"` + Ipv4 NetworkGetIpv4AttributeType `json:"ipv4,omitempty"` + Ipv6 NetworkGetIpv6AttributeType `json:"ipv6,omitempty"` // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Labels NetworkGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED Name NetworkGetNameAttributeType `json:"name" required:"true"` - // A list containing DNS Servers/Nameservers for IPv4. - Nameservers NetworkGetNameserversAttributeType `json:"nameservers,omitempty"` - // A list containing DNS Servers/Nameservers for IPv6. - NameserversV6 NetworkGetNameserversV6AttributeType `json:"nameserversV6,omitempty"` - // Universally Unique Identifier (UUID). - // REQUIRED - NetworkId NetworkGetNetworkIdAttributeType `json:"networkId" required:"true"` - Prefixes NetworkGetPrefixesAttributeType `json:"prefixes,omitempty"` - PrefixesV6 NetworkGetPrefixesV6AttributeType `json:"prefixesV6,omitempty"` - // Object that represents an IP address. - PublicIp NetworkGetPublicIpAttributeType `json:"publicIp,omitempty"` // Shows if the network is routed and therefore accessible from other networks. Routed NetworkgetRoutedAttributeType `json:"routed,omitempty"` + // Universally Unique Identifier (UUID). + RoutingTableId NetworkGetRoutingTableIdAttributeType `json:"routingTableId,omitempty"` // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. // REQUIRED - State NetworkGetStateAttributeType `json:"state" required:"true"` + Status NetworkGetStatusAttributeType `json:"status" required:"true"` // Date-time when resource was last updated. UpdatedAt NetworkGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } @@ -372,11 +274,11 @@ type _Network Network // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewNetwork(name NetworkGetNameArgType, networkId NetworkGetNetworkIdArgType, state NetworkGetStateArgType) *Network { +func NewNetwork(id NetworkGetIdArgType, name NetworkGetNameArgType, status NetworkGetStatusArgType) *Network { this := Network{} + setNetworkGetIdAttributeType(&this.Id, id) setNetworkGetNameAttributeType(&this.Name, name) - setNetworkGetNetworkIdAttributeType(&this.NetworkId, networkId) - setNetworkGetStateAttributeType(&this.State, state) + setNetworkGetStatusAttributeType(&this.Status, status) return &this } @@ -434,72 +336,67 @@ func (o *Network) SetDhcp(v NetworkgetDhcpRetType) { setNetworkgetDhcpAttributeType(&o.Dhcp, v) } -// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Network) GetGateway() (res NetworkGetGatewayRetType) { - res, _ = o.GetGatewayOk() - return +// GetId returns the Id field value +func (o *Network) GetId() (ret NetworkGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } -// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Network) GetGatewayOk() (ret NetworkGetGatewayRetType, ok bool) { - return getNetworkGetGatewayAttributeTypeOk(o.Gateway) +func (o *Network) GetIdOk() (ret NetworkGetIdRetType, ok bool) { + return getNetworkGetIdAttributeTypeOk(o.Id) } -// HasGateway returns a boolean if a field has been set. -func (o *Network) HasGateway() bool { - _, ok := o.GetGatewayOk() - return ok +// SetId sets field value +func (o *Network) SetId(v NetworkGetIdRetType) { + setNetworkGetIdAttributeType(&o.Id, v) +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *Network) GetIpv4() (res NetworkGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return } -// SetGateway gets a reference to the given string and assigns it to the Gateway field. -func (o *Network) SetGateway(v NetworkGetGatewayRetType) { - setNetworkGetGatewayAttributeType(&o.Gateway, v) +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetIpv4Ok() (ret NetworkGetIpv4RetType, ok bool) { + return getNetworkGetIpv4AttributeTypeOk(o.Ipv4) } -// SetGatewayNil sets the value for Gateway to be an explicit nil -func (o *Network) SetGatewayNil() { - o.Gateway = nil +// HasIpv4 returns a boolean if a field has been set. +func (o *Network) HasIpv4() bool { + _, ok := o.GetIpv4Ok() + return ok } -// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil -func (o *Network) UnsetGateway() { - o.Gateway = nil +// SetIpv4 gets a reference to the given NetworkIPv4 and assigns it to the Ipv4 field. +func (o *Network) SetIpv4(v NetworkGetIpv4RetType) { + setNetworkGetIpv4AttributeType(&o.Ipv4, v) } -// GetGatewayv6 returns the Gatewayv6 field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Network) GetGatewayv6() (res NetworkGetGatewayv6RetType) { - res, _ = o.GetGatewayv6Ok() +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *Network) GetIpv6() (res NetworkGetIpv6RetType) { + res, _ = o.GetIpv6Ok() return } -// GetGatewayv6Ok returns a tuple with the Gatewayv6 field value if set, nil otherwise +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Network) GetGatewayv6Ok() (ret NetworkGetGatewayv6RetType, ok bool) { - return getNetworkGetGatewayv6AttributeTypeOk(o.Gatewayv6) +func (o *Network) GetIpv6Ok() (ret NetworkGetIpv6RetType, ok bool) { + return getNetworkGetIpv6AttributeTypeOk(o.Ipv6) } -// HasGatewayv6 returns a boolean if a field has been set. -func (o *Network) HasGatewayv6() bool { - _, ok := o.GetGatewayv6Ok() +// HasIpv6 returns a boolean if a field has been set. +func (o *Network) HasIpv6() bool { + _, ok := o.GetIpv6Ok() return ok } -// SetGatewayv6 gets a reference to the given string and assigns it to the Gatewayv6 field. -func (o *Network) SetGatewayv6(v NetworkGetGatewayv6RetType) { - setNetworkGetGatewayv6AttributeType(&o.Gatewayv6, v) -} - -// SetGatewayv6Nil sets the value for Gatewayv6 to be an explicit nil -func (o *Network) SetGatewayv6Nil() { - o.Gatewayv6 = nil -} - -// UnsetGatewayv6 ensures that no value is present for Gatewayv6, not even an explicit nil -func (o *Network) UnsetGatewayv6() { - o.Gatewayv6 = nil +// SetIpv6 gets a reference to the given NetworkIPv6 and assigns it to the Ipv6 field. +func (o *Network) SetIpv6(v NetworkGetIpv6RetType) { + setNetworkGetIpv6AttributeType(&o.Ipv6, v) } // GetLabels returns the Labels field value if set, zero value otherwise. @@ -542,138 +439,6 @@ func (o *Network) SetName(v NetworkGetNameRetType) { setNetworkGetNameAttributeType(&o.Name, v) } -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *Network) GetNameservers() (res NetworkGetNameserversRetType) { - res, _ = o.GetNameserversOk() - return -} - -// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Network) GetNameserversOk() (ret NetworkGetNameserversRetType, ok bool) { - return getNetworkGetNameserversAttributeTypeOk(o.Nameservers) -} - -// HasNameservers returns a boolean if a field has been set. -func (o *Network) HasNameservers() bool { - _, ok := o.GetNameserversOk() - return ok -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *Network) SetNameservers(v NetworkGetNameserversRetType) { - setNetworkGetNameserversAttributeType(&o.Nameservers, v) -} - -// GetNameserversV6 returns the NameserversV6 field value if set, zero value otherwise. -func (o *Network) GetNameserversV6() (res NetworkGetNameserversV6RetType) { - res, _ = o.GetNameserversV6Ok() - return -} - -// GetNameserversV6Ok returns a tuple with the NameserversV6 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Network) GetNameserversV6Ok() (ret NetworkGetNameserversV6RetType, ok bool) { - return getNetworkGetNameserversV6AttributeTypeOk(o.NameserversV6) -} - -// HasNameserversV6 returns a boolean if a field has been set. -func (o *Network) HasNameserversV6() bool { - _, ok := o.GetNameserversV6Ok() - return ok -} - -// SetNameserversV6 gets a reference to the given []string and assigns it to the NameserversV6 field. -func (o *Network) SetNameserversV6(v NetworkGetNameserversV6RetType) { - setNetworkGetNameserversV6AttributeType(&o.NameserversV6, v) -} - -// GetNetworkId returns the NetworkId field value -func (o *Network) GetNetworkId() (ret NetworkGetNetworkIdRetType) { - ret, _ = o.GetNetworkIdOk() - return ret -} - -// GetNetworkIdOk returns a tuple with the NetworkId field value -// and a boolean to check if the value has been set. -func (o *Network) GetNetworkIdOk() (ret NetworkGetNetworkIdRetType, ok bool) { - return getNetworkGetNetworkIdAttributeTypeOk(o.NetworkId) -} - -// SetNetworkId sets field value -func (o *Network) SetNetworkId(v NetworkGetNetworkIdRetType) { - setNetworkGetNetworkIdAttributeType(&o.NetworkId, v) -} - -// GetPrefixes returns the Prefixes field value if set, zero value otherwise. -func (o *Network) GetPrefixes() (res NetworkGetPrefixesRetType) { - res, _ = o.GetPrefixesOk() - return -} - -// GetPrefixesOk returns a tuple with the Prefixes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Network) GetPrefixesOk() (ret NetworkGetPrefixesRetType, ok bool) { - return getNetworkGetPrefixesAttributeTypeOk(o.Prefixes) -} - -// HasPrefixes returns a boolean if a field has been set. -func (o *Network) HasPrefixes() bool { - _, ok := o.GetPrefixesOk() - return ok -} - -// SetPrefixes gets a reference to the given []string and assigns it to the Prefixes field. -func (o *Network) SetPrefixes(v NetworkGetPrefixesRetType) { - setNetworkGetPrefixesAttributeType(&o.Prefixes, v) -} - -// GetPrefixesV6 returns the PrefixesV6 field value if set, zero value otherwise. -func (o *Network) GetPrefixesV6() (res NetworkGetPrefixesV6RetType) { - res, _ = o.GetPrefixesV6Ok() - return -} - -// GetPrefixesV6Ok returns a tuple with the PrefixesV6 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Network) GetPrefixesV6Ok() (ret NetworkGetPrefixesV6RetType, ok bool) { - return getNetworkGetPrefixesV6AttributeTypeOk(o.PrefixesV6) -} - -// HasPrefixesV6 returns a boolean if a field has been set. -func (o *Network) HasPrefixesV6() bool { - _, ok := o.GetPrefixesV6Ok() - return ok -} - -// SetPrefixesV6 gets a reference to the given []string and assigns it to the PrefixesV6 field. -func (o *Network) SetPrefixesV6(v NetworkGetPrefixesV6RetType) { - setNetworkGetPrefixesV6AttributeType(&o.PrefixesV6, v) -} - -// GetPublicIp returns the PublicIp field value if set, zero value otherwise. -func (o *Network) GetPublicIp() (res NetworkGetPublicIpRetType) { - res, _ = o.GetPublicIpOk() - return -} - -// GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Network) GetPublicIpOk() (ret NetworkGetPublicIpRetType, ok bool) { - return getNetworkGetPublicIpAttributeTypeOk(o.PublicIp) -} - -// HasPublicIp returns a boolean if a field has been set. -func (o *Network) HasPublicIp() bool { - _, ok := o.GetPublicIpOk() - return ok -} - -// SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. -func (o *Network) SetPublicIp(v NetworkGetPublicIpRetType) { - setNetworkGetPublicIpAttributeType(&o.PublicIp, v) -} - // GetRouted returns the Routed field value if set, zero value otherwise. func (o *Network) GetRouted() (res NetworkgetRoutedRetType) { res, _ = o.GetRoutedOk() @@ -697,21 +462,44 @@ func (o *Network) SetRouted(v NetworkgetRoutedRetType) { setNetworkgetRoutedAttributeType(&o.Routed, v) } -// GetState returns the State field value -func (o *Network) GetState() (ret NetworkGetStateRetType) { - ret, _ = o.GetStateOk() +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *Network) GetRoutingTableId() (res NetworkGetRoutingTableIdRetType) { + res, _ = o.GetRoutingTableIdOk() + return +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetRoutingTableIdOk() (ret NetworkGetRoutingTableIdRetType, ok bool) { + return getNetworkGetRoutingTableIdAttributeTypeOk(o.RoutingTableId) +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *Network) HasRoutingTableId() bool { + _, ok := o.GetRoutingTableIdOk() + return ok +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *Network) SetRoutingTableId(v NetworkGetRoutingTableIdRetType) { + setNetworkGetRoutingTableIdAttributeType(&o.RoutingTableId, v) +} + +// GetStatus returns the Status field value +func (o *Network) GetStatus() (ret NetworkGetStatusRetType) { + ret, _ = o.GetStatusOk() return ret } -// GetStateOk returns a tuple with the State field value +// GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *Network) GetStateOk() (ret NetworkGetStateRetType, ok bool) { - return getNetworkGetStateAttributeTypeOk(o.State) +func (o *Network) GetStatusOk() (ret NetworkGetStatusRetType, ok bool) { + return getNetworkGetStatusAttributeTypeOk(o.Status) } -// SetState sets field value -func (o *Network) SetState(v NetworkGetStateRetType) { - setNetworkGetStateAttributeType(&o.State, v) +// SetStatus sets field value +func (o *Network) SetStatus(v NetworkGetStatusRetType) { + setNetworkGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. @@ -745,11 +533,14 @@ func (o Network) ToMap() (map[string]interface{}, error) { if val, ok := getNetworkgetDhcpAttributeTypeOk(o.Dhcp); ok { toSerialize["Dhcp"] = val } - if val, ok := getNetworkGetGatewayAttributeTypeOk(o.Gateway); ok { - toSerialize["Gateway"] = val + if val, ok := getNetworkGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getNetworkGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val } - if val, ok := getNetworkGetGatewayv6AttributeTypeOk(o.Gatewayv6); ok { - toSerialize["Gatewayv6"] = val + if val, ok := getNetworkGetIpv6AttributeTypeOk(o.Ipv6); ok { + toSerialize["Ipv6"] = val } if val, ok := getNetworkGetLabelsAttributeTypeOk(o.Labels); ok { toSerialize["Labels"] = val @@ -757,29 +548,14 @@ func (o Network) ToMap() (map[string]interface{}, error) { if val, ok := getNetworkGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } - if val, ok := getNetworkGetNameserversAttributeTypeOk(o.Nameservers); ok { - toSerialize["Nameservers"] = val - } - if val, ok := getNetworkGetNameserversV6AttributeTypeOk(o.NameserversV6); ok { - toSerialize["NameserversV6"] = val - } - if val, ok := getNetworkGetNetworkIdAttributeTypeOk(o.NetworkId); ok { - toSerialize["NetworkId"] = val - } - if val, ok := getNetworkGetPrefixesAttributeTypeOk(o.Prefixes); ok { - toSerialize["Prefixes"] = val - } - if val, ok := getNetworkGetPrefixesV6AttributeTypeOk(o.PrefixesV6); ok { - toSerialize["PrefixesV6"] = val - } - if val, ok := getNetworkGetPublicIpAttributeTypeOk(o.PublicIp); ok { - toSerialize["PublicIp"] = val - } if val, ok := getNetworkgetRoutedAttributeTypeOk(o.Routed); ok { toSerialize["Routed"] = val } - if val, ok := getNetworkGetStateAttributeTypeOk(o.State); ok { - toSerialize["State"] = val + if val, ok := getNetworkGetRoutingTableIdAttributeTypeOk(o.RoutingTableId); ok { + toSerialize["RoutingTableId"] = val + } + if val, ok := getNetworkGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } if val, ok := getNetworkGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { toSerialize["UpdatedAt"] = val diff --git a/services/iaas/model_network_area.go b/services/iaas/model_network_area.go index 56897810e..054fcce75 100644 --- a/services/iaas/model_network_area.go +++ b/services/iaas/model_network_area.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,27 +18,6 @@ import ( // checks if the NetworkArea type satisfies the MappedNullable interface at compile time var _ MappedNullable = &NetworkArea{} -/* - types and functions for areaId -*/ - -// isNotNullableString -type NetworkAreaGetAreaIdAttributeType = *string - -func getNetworkAreaGetAreaIdAttributeTypeOk(arg NetworkAreaGetAreaIdAttributeType) (ret NetworkAreaGetAreaIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaGetAreaIdAttributeType(arg *NetworkAreaGetAreaIdAttributeType, val NetworkAreaGetAreaIdRetType) { - *arg = &val -} - -type NetworkAreaGetAreaIdArgType = string -type NetworkAreaGetAreaIdRetType = string - /* types and functions for createdAt */ @@ -60,25 +39,26 @@ func setNetworkAreaGetCreatedAtAttributeType(arg *NetworkAreaGetCreatedAtAttribu } /* - types and functions for ipv4 + types and functions for id */ -// isModel -type NetworkAreaGetIpv4AttributeType = *NetworkAreaIPv4 -type NetworkAreaGetIpv4ArgType = NetworkAreaIPv4 -type NetworkAreaGetIpv4RetType = NetworkAreaIPv4 +// isNotNullableString +type NetworkAreaGetIdAttributeType = *string -func getNetworkAreaGetIpv4AttributeTypeOk(arg NetworkAreaGetIpv4AttributeType) (ret NetworkAreaGetIpv4RetType, ok bool) { +func getNetworkAreaGetIdAttributeTypeOk(arg NetworkAreaGetIdAttributeType) (ret NetworkAreaGetIdRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setNetworkAreaGetIpv4AttributeType(arg *NetworkAreaGetIpv4AttributeType, val NetworkAreaGetIpv4RetType) { +func setNetworkAreaGetIdAttributeType(arg *NetworkAreaGetIdAttributeType, val NetworkAreaGetIdRetType) { *arg = &val } +type NetworkAreaGetIdArgType = string +type NetworkAreaGetIdRetType = string + /* types and functions for labels */ @@ -140,27 +120,6 @@ func setNetworkAreaGetProjectCountAttributeType(arg *NetworkAreaGetProjectCountA *arg = &val } -/* - types and functions for state -*/ - -// isNotNullableString -type NetworkAreaGetStateAttributeType = *string - -func getNetworkAreaGetStateAttributeTypeOk(arg NetworkAreaGetStateAttributeType) (ret NetworkAreaGetStateRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setNetworkAreaGetStateAttributeType(arg *NetworkAreaGetStateAttributeType, val NetworkAreaGetStateRetType) { - *arg = &val -} - -type NetworkAreaGetStateArgType = string -type NetworkAreaGetStateRetType = string - /* types and functions for updatedAt */ @@ -183,22 +142,16 @@ func setNetworkAreaGetUpdatedAtAttributeType(arg *NetworkAreaGetUpdatedAtAttribu // NetworkArea Object that represents a network area. type NetworkArea struct { - // Universally Unique Identifier (UUID). - // REQUIRED - AreaId NetworkAreaGetAreaIdAttributeType `json:"areaId" required:"true"` // Date-time when resource was created. CreatedAt NetworkAreaGetCreatedAtAttributeType `json:"createdAt,omitempty"` - Ipv4 NetworkAreaGetIpv4AttributeType `json:"ipv4,omitempty"` + // Universally Unique Identifier (UUID). + Id NetworkAreaGetIdAttributeType `json:"id,omitempty"` // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Labels NetworkAreaGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED Name NetworkAreaGetNameAttributeType `json:"name" required:"true"` // The amount of projects currently referencing a specific area. - // REQUIRED - ProjectCount NetworkAreaGetProjectCountAttributeType `json:"projectCount" required:"true"` - // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. - // REQUIRED - State NetworkAreaGetStateAttributeType `json:"state" required:"true"` + ProjectCount NetworkAreaGetProjectCountAttributeType `json:"projectCount,omitempty"` // Date-time when resource was last updated. UpdatedAt NetworkAreaGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } @@ -209,12 +162,9 @@ type _NetworkArea NetworkArea // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewNetworkArea(areaId NetworkAreaGetAreaIdArgType, name NetworkAreaGetNameArgType, projectCount NetworkAreaGetProjectCountArgType, state NetworkAreaGetStateArgType) *NetworkArea { +func NewNetworkArea(name NetworkAreaGetNameArgType) *NetworkArea { this := NetworkArea{} - setNetworkAreaGetAreaIdAttributeType(&this.AreaId, areaId) setNetworkAreaGetNameAttributeType(&this.Name, name) - setNetworkAreaGetProjectCountAttributeType(&this.ProjectCount, projectCount) - setNetworkAreaGetStateAttributeType(&this.State, state) return &this } @@ -226,23 +176,6 @@ func NewNetworkAreaWithDefaults() *NetworkArea { return &this } -// GetAreaId returns the AreaId field value -func (o *NetworkArea) GetAreaId() (ret NetworkAreaGetAreaIdRetType) { - ret, _ = o.GetAreaIdOk() - return ret -} - -// GetAreaIdOk returns a tuple with the AreaId field value -// and a boolean to check if the value has been set. -func (o *NetworkArea) GetAreaIdOk() (ret NetworkAreaGetAreaIdRetType, ok bool) { - return getNetworkAreaGetAreaIdAttributeTypeOk(o.AreaId) -} - -// SetAreaId sets field value -func (o *NetworkArea) SetAreaId(v NetworkAreaGetAreaIdRetType) { - setNetworkAreaGetAreaIdAttributeType(&o.AreaId, v) -} - // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *NetworkArea) GetCreatedAt() (res NetworkAreaGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() @@ -266,27 +199,27 @@ func (o *NetworkArea) SetCreatedAt(v NetworkAreaGetCreatedAtRetType) { setNetworkAreaGetCreatedAtAttributeType(&o.CreatedAt, v) } -// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *NetworkArea) GetIpv4() (res NetworkAreaGetIpv4RetType) { - res, _ = o.GetIpv4Ok() +// GetId returns the Id field value if set, zero value otherwise. +func (o *NetworkArea) GetId() (res NetworkAreaGetIdRetType) { + res, _ = o.GetIdOk() return } -// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkArea) GetIpv4Ok() (ret NetworkAreaGetIpv4RetType, ok bool) { - return getNetworkAreaGetIpv4AttributeTypeOk(o.Ipv4) +func (o *NetworkArea) GetIdOk() (ret NetworkAreaGetIdRetType, ok bool) { + return getNetworkAreaGetIdAttributeTypeOk(o.Id) } -// HasIpv4 returns a boolean if a field has been set. -func (o *NetworkArea) HasIpv4() bool { - _, ok := o.GetIpv4Ok() +// HasId returns a boolean if a field has been set. +func (o *NetworkArea) HasId() bool { + _, ok := o.GetIdOk() return ok } -// SetIpv4 gets a reference to the given NetworkAreaIPv4 and assigns it to the Ipv4 field. -func (o *NetworkArea) SetIpv4(v NetworkAreaGetIpv4RetType) { - setNetworkAreaGetIpv4AttributeType(&o.Ipv4, v) +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *NetworkArea) SetId(v NetworkAreaGetIdRetType) { + setNetworkAreaGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. @@ -329,38 +262,27 @@ func (o *NetworkArea) SetName(v NetworkAreaGetNameRetType) { setNetworkAreaGetNameAttributeType(&o.Name, v) } -// GetProjectCount returns the ProjectCount field value -func (o *NetworkArea) GetProjectCount() (ret NetworkAreaGetProjectCountRetType) { - ret, _ = o.GetProjectCountOk() - return ret +// GetProjectCount returns the ProjectCount field value if set, zero value otherwise. +func (o *NetworkArea) GetProjectCount() (res NetworkAreaGetProjectCountRetType) { + res, _ = o.GetProjectCountOk() + return } -// GetProjectCountOk returns a tuple with the ProjectCount field value +// GetProjectCountOk returns a tuple with the ProjectCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *NetworkArea) GetProjectCountOk() (ret NetworkAreaGetProjectCountRetType, ok bool) { return getNetworkAreaGetProjectCountAttributeTypeOk(o.ProjectCount) } -// SetProjectCount sets field value -func (o *NetworkArea) SetProjectCount(v NetworkAreaGetProjectCountRetType) { - setNetworkAreaGetProjectCountAttributeType(&o.ProjectCount, v) -} - -// GetState returns the State field value -func (o *NetworkArea) GetState() (ret NetworkAreaGetStateRetType) { - ret, _ = o.GetStateOk() - return ret -} - -// GetStateOk returns a tuple with the State field value -// and a boolean to check if the value has been set. -func (o *NetworkArea) GetStateOk() (ret NetworkAreaGetStateRetType, ok bool) { - return getNetworkAreaGetStateAttributeTypeOk(o.State) +// HasProjectCount returns a boolean if a field has been set. +func (o *NetworkArea) HasProjectCount() bool { + _, ok := o.GetProjectCountOk() + return ok } -// SetState sets field value -func (o *NetworkArea) SetState(v NetworkAreaGetStateRetType) { - setNetworkAreaGetStateAttributeType(&o.State, v) +// SetProjectCount gets a reference to the given int64 and assigns it to the ProjectCount field. +func (o *NetworkArea) SetProjectCount(v NetworkAreaGetProjectCountRetType) { + setNetworkAreaGetProjectCountAttributeType(&o.ProjectCount, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. @@ -388,14 +310,11 @@ func (o *NetworkArea) SetUpdatedAt(v NetworkAreaGetUpdatedAtRetType) { func (o NetworkArea) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getNetworkAreaGetAreaIdAttributeTypeOk(o.AreaId); ok { - toSerialize["AreaId"] = val - } if val, ok := getNetworkAreaGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { toSerialize["CreatedAt"] = val } - if val, ok := getNetworkAreaGetIpv4AttributeTypeOk(o.Ipv4); ok { - toSerialize["Ipv4"] = val + if val, ok := getNetworkAreaGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } if val, ok := getNetworkAreaGetLabelsAttributeTypeOk(o.Labels); ok { toSerialize["Labels"] = val @@ -406,9 +325,6 @@ func (o NetworkArea) ToMap() (map[string]interface{}, error) { if val, ok := getNetworkAreaGetProjectCountAttributeTypeOk(o.ProjectCount); ok { toSerialize["ProjectCount"] = val } - if val, ok := getNetworkAreaGetStateAttributeTypeOk(o.State); ok { - toSerialize["State"] = val - } if val, ok := getNetworkAreaGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { toSerialize["UpdatedAt"] = val } diff --git a/services/iaas/model_network_area_list_response.go b/services/iaas/model_network_area_list_response.go index bd978a646..ba1dac04f 100644 --- a/services/iaas/model_network_area_list_response.go +++ b/services/iaas/model_network_area_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_network_area_list_response_test.go b/services/iaas/model_network_area_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_network_area_list_response_test.go +++ b/services/iaas/model_network_area_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_network_area_test.go b/services/iaas/model_network_area_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_network_area_test.go +++ b/services/iaas/model_network_area_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_network_ipv4.go b/services/iaas/model_network_ipv4.go new file mode 100644 index 000000000..e7eaf8204 --- /dev/null +++ b/services/iaas/model_network_ipv4.go @@ -0,0 +1,286 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the NetworkIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkIPv4{} + +/* + types and functions for gateway +*/ + +// isNullableString +type NetworkIPv4GetGatewayAttributeType = *NullableString + +func getNetworkIPv4GetGatewayAttributeTypeOk(arg NetworkIPv4GetGatewayAttributeType) (ret NetworkIPv4GetGatewayRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setNetworkIPv4GetGatewayAttributeType(arg *NetworkIPv4GetGatewayAttributeType, val NetworkIPv4GetGatewayRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type NetworkIPv4GetGatewayArgType = *string +type NetworkIPv4GetGatewayRetType = *string + +/* + types and functions for nameservers +*/ + +// isArray +type NetworkIPv4GetNameserversAttributeType = *[]string +type NetworkIPv4GetNameserversArgType = []string +type NetworkIPv4GetNameserversRetType = []string + +func getNetworkIPv4GetNameserversAttributeTypeOk(arg NetworkIPv4GetNameserversAttributeType) (ret NetworkIPv4GetNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkIPv4GetNameserversAttributeType(arg *NetworkIPv4GetNameserversAttributeType, val NetworkIPv4GetNameserversRetType) { + *arg = &val +} + +/* + types and functions for prefixes +*/ + +// isArray +type NetworkIPv4GetPrefixesAttributeType = *[]string +type NetworkIPv4GetPrefixesArgType = []string +type NetworkIPv4GetPrefixesRetType = []string + +func getNetworkIPv4GetPrefixesAttributeTypeOk(arg NetworkIPv4GetPrefixesAttributeType) (ret NetworkIPv4GetPrefixesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkIPv4GetPrefixesAttributeType(arg *NetworkIPv4GetPrefixesAttributeType, val NetworkIPv4GetPrefixesRetType) { + *arg = &val +} + +/* + types and functions for publicIp +*/ + +// isNotNullableString +type NetworkIPv4GetPublicIpAttributeType = *string + +func getNetworkIPv4GetPublicIpAttributeTypeOk(arg NetworkIPv4GetPublicIpAttributeType) (ret NetworkIPv4GetPublicIpRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkIPv4GetPublicIpAttributeType(arg *NetworkIPv4GetPublicIpAttributeType, val NetworkIPv4GetPublicIpRetType) { + *arg = &val +} + +type NetworkIPv4GetPublicIpArgType = string +type NetworkIPv4GetPublicIpRetType = string + +// NetworkIPv4 Object that represents the IPv4 part of a network. +type NetworkIPv4 struct { + // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NetworkIPv4GetGatewayAttributeType `json:"gateway,omitempty"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers NetworkIPv4GetNameserversAttributeType `json:"nameservers,omitempty"` + // REQUIRED + Prefixes NetworkIPv4GetPrefixesAttributeType `json:"prefixes" required:"true"` + // String that represents an IPv4 address. + PublicIp NetworkIPv4GetPublicIpAttributeType `json:"publicIp,omitempty"` +} + +type _NetworkIPv4 NetworkIPv4 + +// NewNetworkIPv4 instantiates a new NetworkIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkIPv4(prefixes NetworkIPv4GetPrefixesArgType) *NetworkIPv4 { + this := NetworkIPv4{} + setNetworkIPv4GetPrefixesAttributeType(&this.Prefixes, prefixes) + return &this +} + +// NewNetworkIPv4WithDefaults instantiates a new NetworkIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkIPv4WithDefaults() *NetworkIPv4 { + this := NetworkIPv4{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NetworkIPv4) GetGateway() (res NetworkIPv4GetGatewayRetType) { + res, _ = o.GetGatewayOk() + return +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkIPv4) GetGatewayOk() (ret NetworkIPv4GetGatewayRetType, ok bool) { + return getNetworkIPv4GetGatewayAttributeTypeOk(o.Gateway) +} + +// HasGateway returns a boolean if a field has been set. +func (o *NetworkIPv4) HasGateway() bool { + _, ok := o.GetGatewayOk() + return ok +} + +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *NetworkIPv4) SetGateway(v NetworkIPv4GetGatewayRetType) { + setNetworkIPv4GetGatewayAttributeType(&o.Gateway, v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *NetworkIPv4) SetGatewayNil() { + o.Gateway = nil +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *NetworkIPv4) UnsetGateway() { + o.Gateway = nil +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *NetworkIPv4) GetNameservers() (res NetworkIPv4GetNameserversRetType) { + res, _ = o.GetNameserversOk() + return +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkIPv4) GetNameserversOk() (ret NetworkIPv4GetNameserversRetType, ok bool) { + return getNetworkIPv4GetNameserversAttributeTypeOk(o.Nameservers) +} + +// HasNameservers returns a boolean if a field has been set. +func (o *NetworkIPv4) HasNameservers() bool { + _, ok := o.GetNameserversOk() + return ok +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *NetworkIPv4) SetNameservers(v NetworkIPv4GetNameserversRetType) { + setNetworkIPv4GetNameserversAttributeType(&o.Nameservers, v) +} + +// GetPrefixes returns the Prefixes field value +func (o *NetworkIPv4) GetPrefixes() (ret NetworkIPv4GetPrefixesRetType) { + ret, _ = o.GetPrefixesOk() + return ret +} + +// GetPrefixesOk returns a tuple with the Prefixes field value +// and a boolean to check if the value has been set. +func (o *NetworkIPv4) GetPrefixesOk() (ret NetworkIPv4GetPrefixesRetType, ok bool) { + return getNetworkIPv4GetPrefixesAttributeTypeOk(o.Prefixes) +} + +// SetPrefixes sets field value +func (o *NetworkIPv4) SetPrefixes(v NetworkIPv4GetPrefixesRetType) { + setNetworkIPv4GetPrefixesAttributeType(&o.Prefixes, v) +} + +// GetPublicIp returns the PublicIp field value if set, zero value otherwise. +func (o *NetworkIPv4) GetPublicIp() (res NetworkIPv4GetPublicIpRetType) { + res, _ = o.GetPublicIpOk() + return +} + +// GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkIPv4) GetPublicIpOk() (ret NetworkIPv4GetPublicIpRetType, ok bool) { + return getNetworkIPv4GetPublicIpAttributeTypeOk(o.PublicIp) +} + +// HasPublicIp returns a boolean if a field has been set. +func (o *NetworkIPv4) HasPublicIp() bool { + _, ok := o.GetPublicIpOk() + return ok +} + +// SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. +func (o *NetworkIPv4) SetPublicIp(v NetworkIPv4GetPublicIpRetType) { + setNetworkIPv4GetPublicIpAttributeType(&o.PublicIp, v) +} + +func (o NetworkIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getNetworkIPv4GetGatewayAttributeTypeOk(o.Gateway); ok { + toSerialize["Gateway"] = val + } + if val, ok := getNetworkIPv4GetNameserversAttributeTypeOk(o.Nameservers); ok { + toSerialize["Nameservers"] = val + } + if val, ok := getNetworkIPv4GetPrefixesAttributeTypeOk(o.Prefixes); ok { + toSerialize["Prefixes"] = val + } + if val, ok := getNetworkIPv4GetPublicIpAttributeTypeOk(o.PublicIp); ok { + toSerialize["PublicIp"] = val + } + return toSerialize, nil +} + +type NullableNetworkIPv4 struct { + value *NetworkIPv4 + isSet bool +} + +func (v NullableNetworkIPv4) Get() *NetworkIPv4 { + return v.value +} + +func (v *NullableNetworkIPv4) Set(val *NetworkIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkIPv4(val *NetworkIPv4) *NullableNetworkIPv4 { + return &NullableNetworkIPv4{value: val, isSet: true} +} + +func (v NullableNetworkIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_network_ipv4_test.go b/services/iaas/model_network_ipv4_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_network_ipv4_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_network_ipv6.go b/services/iaas/model_network_ipv6.go new file mode 100644 index 000000000..722744622 --- /dev/null +++ b/services/iaas/model_network_ipv6.go @@ -0,0 +1,237 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the NetworkIPv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkIPv6{} + +/* + types and functions for gateway +*/ + +// isNullableString +type NetworkIPv6GetGatewayAttributeType = *NullableString + +func getNetworkIPv6GetGatewayAttributeTypeOk(arg NetworkIPv6GetGatewayAttributeType) (ret NetworkIPv6GetGatewayRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setNetworkIPv6GetGatewayAttributeType(arg *NetworkIPv6GetGatewayAttributeType, val NetworkIPv6GetGatewayRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type NetworkIPv6GetGatewayArgType = *string +type NetworkIPv6GetGatewayRetType = *string + +/* + types and functions for nameservers +*/ + +// isArray +type NetworkIPv6GetNameserversAttributeType = *[]string +type NetworkIPv6GetNameserversArgType = []string +type NetworkIPv6GetNameserversRetType = []string + +func getNetworkIPv6GetNameserversAttributeTypeOk(arg NetworkIPv6GetNameserversAttributeType) (ret NetworkIPv6GetNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkIPv6GetNameserversAttributeType(arg *NetworkIPv6GetNameserversAttributeType, val NetworkIPv6GetNameserversRetType) { + *arg = &val +} + +/* + types and functions for prefixes +*/ + +// isArray +type NetworkIPv6GetPrefixesAttributeType = *[]string +type NetworkIPv6GetPrefixesArgType = []string +type NetworkIPv6GetPrefixesRetType = []string + +func getNetworkIPv6GetPrefixesAttributeTypeOk(arg NetworkIPv6GetPrefixesAttributeType) (ret NetworkIPv6GetPrefixesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkIPv6GetPrefixesAttributeType(arg *NetworkIPv6GetPrefixesAttributeType, val NetworkIPv6GetPrefixesRetType) { + *arg = &val +} + +// NetworkIPv6 Object that represents the IPv6 part of a network. +type NetworkIPv6 struct { + // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NetworkIPv6GetGatewayAttributeType `json:"gateway,omitempty"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers NetworkIPv6GetNameserversAttributeType `json:"nameservers,omitempty"` + // REQUIRED + Prefixes NetworkIPv6GetPrefixesAttributeType `json:"prefixes" required:"true"` +} + +type _NetworkIPv6 NetworkIPv6 + +// NewNetworkIPv6 instantiates a new NetworkIPv6 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkIPv6(prefixes NetworkIPv6GetPrefixesArgType) *NetworkIPv6 { + this := NetworkIPv6{} + setNetworkIPv6GetPrefixesAttributeType(&this.Prefixes, prefixes) + return &this +} + +// NewNetworkIPv6WithDefaults instantiates a new NetworkIPv6 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkIPv6WithDefaults() *NetworkIPv6 { + this := NetworkIPv6{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NetworkIPv6) GetGateway() (res NetworkIPv6GetGatewayRetType) { + res, _ = o.GetGatewayOk() + return +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkIPv6) GetGatewayOk() (ret NetworkIPv6GetGatewayRetType, ok bool) { + return getNetworkIPv6GetGatewayAttributeTypeOk(o.Gateway) +} + +// HasGateway returns a boolean if a field has been set. +func (o *NetworkIPv6) HasGateway() bool { + _, ok := o.GetGatewayOk() + return ok +} + +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *NetworkIPv6) SetGateway(v NetworkIPv6GetGatewayRetType) { + setNetworkIPv6GetGatewayAttributeType(&o.Gateway, v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *NetworkIPv6) SetGatewayNil() { + o.Gateway = nil +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *NetworkIPv6) UnsetGateway() { + o.Gateway = nil +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *NetworkIPv6) GetNameservers() (res NetworkIPv6GetNameserversRetType) { + res, _ = o.GetNameserversOk() + return +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkIPv6) GetNameserversOk() (ret NetworkIPv6GetNameserversRetType, ok bool) { + return getNetworkIPv6GetNameserversAttributeTypeOk(o.Nameservers) +} + +// HasNameservers returns a boolean if a field has been set. +func (o *NetworkIPv6) HasNameservers() bool { + _, ok := o.GetNameserversOk() + return ok +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *NetworkIPv6) SetNameservers(v NetworkIPv6GetNameserversRetType) { + setNetworkIPv6GetNameserversAttributeType(&o.Nameservers, v) +} + +// GetPrefixes returns the Prefixes field value +func (o *NetworkIPv6) GetPrefixes() (ret NetworkIPv6GetPrefixesRetType) { + ret, _ = o.GetPrefixesOk() + return ret +} + +// GetPrefixesOk returns a tuple with the Prefixes field value +// and a boolean to check if the value has been set. +func (o *NetworkIPv6) GetPrefixesOk() (ret NetworkIPv6GetPrefixesRetType, ok bool) { + return getNetworkIPv6GetPrefixesAttributeTypeOk(o.Prefixes) +} + +// SetPrefixes sets field value +func (o *NetworkIPv6) SetPrefixes(v NetworkIPv6GetPrefixesRetType) { + setNetworkIPv6GetPrefixesAttributeType(&o.Prefixes, v) +} + +func (o NetworkIPv6) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getNetworkIPv6GetGatewayAttributeTypeOk(o.Gateway); ok { + toSerialize["Gateway"] = val + } + if val, ok := getNetworkIPv6GetNameserversAttributeTypeOk(o.Nameservers); ok { + toSerialize["Nameservers"] = val + } + if val, ok := getNetworkIPv6GetPrefixesAttributeTypeOk(o.Prefixes); ok { + toSerialize["Prefixes"] = val + } + return toSerialize, nil +} + +type NullableNetworkIPv6 struct { + value *NetworkIPv6 + isSet bool +} + +func (v NullableNetworkIPv6) Get() *NetworkIPv6 { + return v.value +} + +func (v *NullableNetworkIPv6) Set(val *NetworkIPv6) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkIPv6) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkIPv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkIPv6(val *NetworkIPv6) *NullableNetworkIPv6 { + return &NullableNetworkIPv6{value: val, isSet: true} +} + +func (v NullableNetworkIPv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkIPv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_network_ipv6_test.go b/services/iaas/model_network_ipv6_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_network_ipv6_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_network_list_response.go b/services/iaas/model_network_list_response.go index 590dacce4..6fcec490d 100644 --- a/services/iaas/model_network_list_response.go +++ b/services/iaas/model_network_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_network_list_response_test.go b/services/iaas/model_network_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_network_list_response_test.go +++ b/services/iaas/model_network_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_network_range.go b/services/iaas/model_network_range.go index 0bb3f24d8..9f68dddb1 100644 --- a/services/iaas/model_network_range.go +++ b/services/iaas/model_network_range.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -39,25 +39,25 @@ func setNetworkRangeGetCreatedAtAttributeType(arg *NetworkRangeGetCreatedAtAttri } /* - types and functions for networkRangeId + types and functions for id */ // isNotNullableString -type NetworkRangeGetNetworkRangeIdAttributeType = *string +type NetworkRangeGetIdAttributeType = *string -func getNetworkRangeGetNetworkRangeIdAttributeTypeOk(arg NetworkRangeGetNetworkRangeIdAttributeType) (ret NetworkRangeGetNetworkRangeIdRetType, ok bool) { +func getNetworkRangeGetIdAttributeTypeOk(arg NetworkRangeGetIdAttributeType) (ret NetworkRangeGetIdRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setNetworkRangeGetNetworkRangeIdAttributeType(arg *NetworkRangeGetNetworkRangeIdAttributeType, val NetworkRangeGetNetworkRangeIdRetType) { +func setNetworkRangeGetIdAttributeType(arg *NetworkRangeGetIdAttributeType, val NetworkRangeGetIdRetType) { *arg = &val } -type NetworkRangeGetNetworkRangeIdArgType = string -type NetworkRangeGetNetworkRangeIdRetType = string +type NetworkRangeGetIdArgType = string +type NetworkRangeGetIdRetType = string /* types and functions for prefix @@ -105,7 +105,7 @@ type NetworkRange struct { // Date-time when resource was created. CreatedAt NetworkRangeGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Universally Unique Identifier (UUID). - NetworkRangeId NetworkRangeGetNetworkRangeIdAttributeType `json:"networkRangeId,omitempty"` + Id NetworkRangeGetIdAttributeType `json:"id,omitempty"` // Classless Inter-Domain Routing (CIDR). // REQUIRED Prefix NetworkRangeGetPrefixAttributeType `json:"prefix" required:"true"` @@ -156,27 +156,27 @@ func (o *NetworkRange) SetCreatedAt(v NetworkRangeGetCreatedAtRetType) { setNetworkRangeGetCreatedAtAttributeType(&o.CreatedAt, v) } -// GetNetworkRangeId returns the NetworkRangeId field value if set, zero value otherwise. -func (o *NetworkRange) GetNetworkRangeId() (res NetworkRangeGetNetworkRangeIdRetType) { - res, _ = o.GetNetworkRangeIdOk() +// GetId returns the Id field value if set, zero value otherwise. +func (o *NetworkRange) GetId() (res NetworkRangeGetIdRetType) { + res, _ = o.GetIdOk() return } -// GetNetworkRangeIdOk returns a tuple with the NetworkRangeId field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkRange) GetNetworkRangeIdOk() (ret NetworkRangeGetNetworkRangeIdRetType, ok bool) { - return getNetworkRangeGetNetworkRangeIdAttributeTypeOk(o.NetworkRangeId) +func (o *NetworkRange) GetIdOk() (ret NetworkRangeGetIdRetType, ok bool) { + return getNetworkRangeGetIdAttributeTypeOk(o.Id) } -// HasNetworkRangeId returns a boolean if a field has been set. -func (o *NetworkRange) HasNetworkRangeId() bool { - _, ok := o.GetNetworkRangeIdOk() +// HasId returns a boolean if a field has been set. +func (o *NetworkRange) HasId() bool { + _, ok := o.GetIdOk() return ok } -// SetNetworkRangeId gets a reference to the given string and assigns it to the NetworkRangeId field. -func (o *NetworkRange) SetNetworkRangeId(v NetworkRangeGetNetworkRangeIdRetType) { - setNetworkRangeGetNetworkRangeIdAttributeType(&o.NetworkRangeId, v) +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *NetworkRange) SetId(v NetworkRangeGetIdRetType) { + setNetworkRangeGetIdAttributeType(&o.Id, v) } // GetPrefix returns the Prefix field value @@ -224,8 +224,8 @@ func (o NetworkRange) ToMap() (map[string]interface{}, error) { if val, ok := getNetworkRangeGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { toSerialize["CreatedAt"] = val } - if val, ok := getNetworkRangeGetNetworkRangeIdAttributeTypeOk(o.NetworkRangeId); ok { - toSerialize["NetworkRangeId"] = val + if val, ok := getNetworkRangeGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } if val, ok := getNetworkRangeGetPrefixAttributeTypeOk(o.Prefix); ok { toSerialize["Prefix"] = val diff --git a/services/iaas/model_network_range_list_response.go b/services/iaas/model_network_range_list_response.go index eca004da2..1b0132fcb 100644 --- a/services/iaas/model_network_range_list_response.go +++ b/services/iaas/model_network_range_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_network_range_list_response_test.go b/services/iaas/model_network_range_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_network_range_list_response_test.go +++ b/services/iaas/model_network_range_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_network_range_test.go b/services/iaas/model_network_range_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_network_range_test.go +++ b/services/iaas/model_network_range_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_network_test.go b/services/iaas/model_network_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_network_test.go +++ b/services/iaas/model_network_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_nexthop_blackhole.go b/services/iaas/model_nexthop_blackhole.go new file mode 100644 index 000000000..8b2954913 --- /dev/null +++ b/services/iaas/model_nexthop_blackhole.go @@ -0,0 +1,126 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the NexthopBlackhole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopBlackhole{} + +/* + types and functions for type +*/ + +// isNotNullableString +type NexthopBlackholeGetTypeAttributeType = *string + +func getNexthopBlackholeGetTypeAttributeTypeOk(arg NexthopBlackholeGetTypeAttributeType) (ret NexthopBlackholeGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNexthopBlackholeGetTypeAttributeType(arg *NexthopBlackholeGetTypeAttributeType, val NexthopBlackholeGetTypeRetType) { + *arg = &val +} + +type NexthopBlackholeGetTypeArgType = string +type NexthopBlackholeGetTypeRetType = string + +// NexthopBlackhole Object that represents a blackhole route. +type NexthopBlackhole struct { + // REQUIRED + Type NexthopBlackholeGetTypeAttributeType `json:"type" required:"true"` +} + +type _NexthopBlackhole NexthopBlackhole + +// NewNexthopBlackhole instantiates a new NexthopBlackhole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopBlackhole(types NexthopBlackholeGetTypeArgType) *NexthopBlackhole { + this := NexthopBlackhole{} + setNexthopBlackholeGetTypeAttributeType(&this.Type, types) + return &this +} + +// NewNexthopBlackholeWithDefaults instantiates a new NexthopBlackhole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopBlackholeWithDefaults() *NexthopBlackhole { + this := NexthopBlackhole{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopBlackhole) GetType() (ret NexthopBlackholeGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopBlackhole) GetTypeOk() (ret NexthopBlackholeGetTypeRetType, ok bool) { + return getNexthopBlackholeGetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +func (o *NexthopBlackhole) SetType(v NexthopBlackholeGetTypeRetType) { + setNexthopBlackholeGetTypeAttributeType(&o.Type, v) +} + +func (o NexthopBlackhole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getNexthopBlackholeGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + return toSerialize, nil +} + +type NullableNexthopBlackhole struct { + value *NexthopBlackhole + isSet bool +} + +func (v NullableNexthopBlackhole) Get() *NexthopBlackhole { + return v.value +} + +func (v *NullableNexthopBlackhole) Set(val *NexthopBlackhole) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopBlackhole) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopBlackhole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopBlackhole(val *NexthopBlackhole) *NullableNexthopBlackhole { + return &NullableNexthopBlackhole{value: val, isSet: true} +} + +func (v NullableNexthopBlackhole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopBlackhole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_nexthop_blackhole_test.go b/services/iaas/model_nexthop_blackhole_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_nexthop_blackhole_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_nexthop_internet.go b/services/iaas/model_nexthop_internet.go new file mode 100644 index 000000000..e4809b677 --- /dev/null +++ b/services/iaas/model_nexthop_internet.go @@ -0,0 +1,126 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the NexthopInternet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopInternet{} + +/* + types and functions for type +*/ + +// isNotNullableString +type NexthopInternetGetTypeAttributeType = *string + +func getNexthopInternetGetTypeAttributeTypeOk(arg NexthopInternetGetTypeAttributeType) (ret NexthopInternetGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNexthopInternetGetTypeAttributeType(arg *NexthopInternetGetTypeAttributeType, val NexthopInternetGetTypeRetType) { + *arg = &val +} + +type NexthopInternetGetTypeArgType = string +type NexthopInternetGetTypeRetType = string + +// NexthopInternet Object that represents a route to the internet. +type NexthopInternet struct { + // REQUIRED + Type NexthopInternetGetTypeAttributeType `json:"type" required:"true"` +} + +type _NexthopInternet NexthopInternet + +// NewNexthopInternet instantiates a new NexthopInternet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopInternet(types NexthopInternetGetTypeArgType) *NexthopInternet { + this := NexthopInternet{} + setNexthopInternetGetTypeAttributeType(&this.Type, types) + return &this +} + +// NewNexthopInternetWithDefaults instantiates a new NexthopInternet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopInternetWithDefaults() *NexthopInternet { + this := NexthopInternet{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopInternet) GetType() (ret NexthopInternetGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopInternet) GetTypeOk() (ret NexthopInternetGetTypeRetType, ok bool) { + return getNexthopInternetGetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +func (o *NexthopInternet) SetType(v NexthopInternetGetTypeRetType) { + setNexthopInternetGetTypeAttributeType(&o.Type, v) +} + +func (o NexthopInternet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getNexthopInternetGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + return toSerialize, nil +} + +type NullableNexthopInternet struct { + value *NexthopInternet + isSet bool +} + +func (v NullableNexthopInternet) Get() *NexthopInternet { + return v.value +} + +func (v *NullableNexthopInternet) Set(val *NexthopInternet) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopInternet) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopInternet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopInternet(val *NexthopInternet) *NullableNexthopInternet { + return &NullableNexthopInternet{value: val, isSet: true} +} + +func (v NullableNexthopInternet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopInternet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_nexthop_internet_test.go b/services/iaas/model_nexthop_internet_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_nexthop_internet_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_nexthop_ipv4.go b/services/iaas/model_nexthop_ipv4.go new file mode 100644 index 000000000..dc4d69f56 --- /dev/null +++ b/services/iaas/model_nexthop_ipv4.go @@ -0,0 +1,171 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the NexthopIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopIPv4{} + +/* + types and functions for type +*/ + +// isNotNullableString +type NexthopIPv4GetTypeAttributeType = *string + +func getNexthopIPv4GetTypeAttributeTypeOk(arg NexthopIPv4GetTypeAttributeType) (ret NexthopIPv4GetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNexthopIPv4GetTypeAttributeType(arg *NexthopIPv4GetTypeAttributeType, val NexthopIPv4GetTypeRetType) { + *arg = &val +} + +type NexthopIPv4GetTypeArgType = string +type NexthopIPv4GetTypeRetType = string + +/* + types and functions for value +*/ + +// isNotNullableString +type NexthopIPv4GetValueAttributeType = *string + +func getNexthopIPv4GetValueAttributeTypeOk(arg NexthopIPv4GetValueAttributeType) (ret NexthopIPv4GetValueRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNexthopIPv4GetValueAttributeType(arg *NexthopIPv4GetValueAttributeType, val NexthopIPv4GetValueRetType) { + *arg = &val +} + +type NexthopIPv4GetValueArgType = string +type NexthopIPv4GetValueRetType = string + +// NexthopIPv4 Object that represents an IPv4 address. +type NexthopIPv4 struct { + // REQUIRED + Type NexthopIPv4GetTypeAttributeType `json:"type" required:"true"` + // An IPv4 address. + // REQUIRED + Value NexthopIPv4GetValueAttributeType `json:"value" required:"true"` +} + +type _NexthopIPv4 NexthopIPv4 + +// NewNexthopIPv4 instantiates a new NexthopIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopIPv4(types NexthopIPv4GetTypeArgType, value NexthopIPv4GetValueArgType) *NexthopIPv4 { + this := NexthopIPv4{} + setNexthopIPv4GetTypeAttributeType(&this.Type, types) + setNexthopIPv4GetValueAttributeType(&this.Value, value) + return &this +} + +// NewNexthopIPv4WithDefaults instantiates a new NexthopIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopIPv4WithDefaults() *NexthopIPv4 { + this := NexthopIPv4{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopIPv4) GetType() (ret NexthopIPv4GetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv4) GetTypeOk() (ret NexthopIPv4GetTypeRetType, ok bool) { + return getNexthopIPv4GetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +func (o *NexthopIPv4) SetType(v NexthopIPv4GetTypeRetType) { + setNexthopIPv4GetTypeAttributeType(&o.Type, v) +} + +// GetValue returns the Value field value +func (o *NexthopIPv4) GetValue() (ret NexthopIPv4GetValueRetType) { + ret, _ = o.GetValueOk() + return ret +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv4) GetValueOk() (ret NexthopIPv4GetValueRetType, ok bool) { + return getNexthopIPv4GetValueAttributeTypeOk(o.Value) +} + +// SetValue sets field value +func (o *NexthopIPv4) SetValue(v NexthopIPv4GetValueRetType) { + setNexthopIPv4GetValueAttributeType(&o.Value, v) +} + +func (o NexthopIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getNexthopIPv4GetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + if val, ok := getNexthopIPv4GetValueAttributeTypeOk(o.Value); ok { + toSerialize["Value"] = val + } + return toSerialize, nil +} + +type NullableNexthopIPv4 struct { + value *NexthopIPv4 + isSet bool +} + +func (v NullableNexthopIPv4) Get() *NexthopIPv4 { + return v.value +} + +func (v *NullableNexthopIPv4) Set(val *NexthopIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopIPv4(val *NexthopIPv4) *NullableNexthopIPv4 { + return &NullableNexthopIPv4{value: val, isSet: true} +} + +func (v NullableNexthopIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_nexthop_ipv4_test.go b/services/iaas/model_nexthop_ipv4_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_nexthop_ipv4_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_nexthop_ipv6.go b/services/iaas/model_nexthop_ipv6.go new file mode 100644 index 000000000..abe97129c --- /dev/null +++ b/services/iaas/model_nexthop_ipv6.go @@ -0,0 +1,171 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the NexthopIPv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopIPv6{} + +/* + types and functions for type +*/ + +// isNotNullableString +type NexthopIPv6GetTypeAttributeType = *string + +func getNexthopIPv6GetTypeAttributeTypeOk(arg NexthopIPv6GetTypeAttributeType) (ret NexthopIPv6GetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNexthopIPv6GetTypeAttributeType(arg *NexthopIPv6GetTypeAttributeType, val NexthopIPv6GetTypeRetType) { + *arg = &val +} + +type NexthopIPv6GetTypeArgType = string +type NexthopIPv6GetTypeRetType = string + +/* + types and functions for value +*/ + +// isNotNullableString +type NexthopIPv6GetValueAttributeType = *string + +func getNexthopIPv6GetValueAttributeTypeOk(arg NexthopIPv6GetValueAttributeType) (ret NexthopIPv6GetValueRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNexthopIPv6GetValueAttributeType(arg *NexthopIPv6GetValueAttributeType, val NexthopIPv6GetValueRetType) { + *arg = &val +} + +type NexthopIPv6GetValueArgType = string +type NexthopIPv6GetValueRetType = string + +// NexthopIPv6 Object that represents an IPv6 address. +type NexthopIPv6 struct { + // REQUIRED + Type NexthopIPv6GetTypeAttributeType `json:"type" required:"true"` + // An IPv6 address. + // REQUIRED + Value NexthopIPv6GetValueAttributeType `json:"value" required:"true"` +} + +type _NexthopIPv6 NexthopIPv6 + +// NewNexthopIPv6 instantiates a new NexthopIPv6 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopIPv6(types NexthopIPv6GetTypeArgType, value NexthopIPv6GetValueArgType) *NexthopIPv6 { + this := NexthopIPv6{} + setNexthopIPv6GetTypeAttributeType(&this.Type, types) + setNexthopIPv6GetValueAttributeType(&this.Value, value) + return &this +} + +// NewNexthopIPv6WithDefaults instantiates a new NexthopIPv6 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopIPv6WithDefaults() *NexthopIPv6 { + this := NexthopIPv6{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopIPv6) GetType() (ret NexthopIPv6GetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv6) GetTypeOk() (ret NexthopIPv6GetTypeRetType, ok bool) { + return getNexthopIPv6GetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +func (o *NexthopIPv6) SetType(v NexthopIPv6GetTypeRetType) { + setNexthopIPv6GetTypeAttributeType(&o.Type, v) +} + +// GetValue returns the Value field value +func (o *NexthopIPv6) GetValue() (ret NexthopIPv6GetValueRetType) { + ret, _ = o.GetValueOk() + return ret +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv6) GetValueOk() (ret NexthopIPv6GetValueRetType, ok bool) { + return getNexthopIPv6GetValueAttributeTypeOk(o.Value) +} + +// SetValue sets field value +func (o *NexthopIPv6) SetValue(v NexthopIPv6GetValueRetType) { + setNexthopIPv6GetValueAttributeType(&o.Value, v) +} + +func (o NexthopIPv6) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getNexthopIPv6GetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + if val, ok := getNexthopIPv6GetValueAttributeTypeOk(o.Value); ok { + toSerialize["Value"] = val + } + return toSerialize, nil +} + +type NullableNexthopIPv6 struct { + value *NexthopIPv6 + isSet bool +} + +func (v NullableNexthopIPv6) Get() *NexthopIPv6 { + return v.value +} + +func (v *NullableNexthopIPv6) Set(val *NexthopIPv6) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopIPv6) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopIPv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopIPv6(val *NexthopIPv6) *NullableNexthopIPv6 { + return &NullableNexthopIPv6{value: val, isSet: true} +} + +func (v NullableNexthopIPv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopIPv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_nexthop_ipv6_test.go b/services/iaas/model_nexthop_ipv6_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_nexthop_ipv6_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_nic.go b/services/iaas/model_nic.go index 12c22fe2c..1cb718d0a 100644 --- a/services/iaas/model_nic.go +++ b/services/iaas/model_nic.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_nic_list_response.go b/services/iaas/model_nic_list_response.go index 83c5b4696..70d7cab7f 100644 --- a/services/iaas/model_nic_list_response.go +++ b/services/iaas/model_nic_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_nic_list_response_test.go b/services/iaas/model_nic_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_nic_list_response_test.go +++ b/services/iaas/model_nic_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_nic_test.go b/services/iaas/model_nic_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_nic_test.go +++ b/services/iaas/model_nic_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_partial_update_network_area_payload.go b/services/iaas/model_partial_update_network_area_payload.go index cc33493ae..33e2196b4 100644 --- a/services/iaas/model_partial_update_network_area_payload.go +++ b/services/iaas/model_partial_update_network_area_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,26 +17,6 @@ import ( // checks if the PartialUpdateNetworkAreaPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PartialUpdateNetworkAreaPayload{} -/* - types and functions for addressFamily -*/ - -// isModel -type PartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeType = *UpdateAreaAddressFamily -type PartialUpdateNetworkAreaPayloadGetAddressFamilyArgType = UpdateAreaAddressFamily -type PartialUpdateNetworkAreaPayloadGetAddressFamilyRetType = UpdateAreaAddressFamily - -func getPartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeTypeOk(arg PartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeType) (ret PartialUpdateNetworkAreaPayloadGetAddressFamilyRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setPartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeType(arg *PartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeType, val PartialUpdateNetworkAreaPayloadGetAddressFamilyRetType) { - *arg = &val -} - /* types and functions for labels */ @@ -78,13 +58,11 @@ func setPartialUpdateNetworkAreaPayloadGetNameAttributeType(arg *PartialUpdateNe type PartialUpdateNetworkAreaPayloadGetNameArgType = string type PartialUpdateNetworkAreaPayloadGetNameRetType = string -// PartialUpdateNetworkAreaPayload struct for PartialUpdateNetworkAreaPayload +// PartialUpdateNetworkAreaPayload Object that represents the network area update request. type PartialUpdateNetworkAreaPayload struct { - AddressFamily PartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeType `json:"addressFamily,omitempty"` // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Labels PartialUpdateNetworkAreaPayloadGetLabelsAttributeType `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - Name PartialUpdateNetworkAreaPayloadGetNameAttributeType `json:"name,omitempty"` + Name PartialUpdateNetworkAreaPayloadGetNameAttributeType `json:"name,omitempty"` } // NewPartialUpdateNetworkAreaPayload instantiates a new PartialUpdateNetworkAreaPayload object @@ -104,29 +82,6 @@ func NewPartialUpdateNetworkAreaPayloadWithDefaults() *PartialUpdateNetworkAreaP return &this } -// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. -func (o *PartialUpdateNetworkAreaPayload) GetAddressFamily() (res PartialUpdateNetworkAreaPayloadGetAddressFamilyRetType) { - res, _ = o.GetAddressFamilyOk() - return -} - -// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PartialUpdateNetworkAreaPayload) GetAddressFamilyOk() (ret PartialUpdateNetworkAreaPayloadGetAddressFamilyRetType, ok bool) { - return getPartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily) -} - -// HasAddressFamily returns a boolean if a field has been set. -func (o *PartialUpdateNetworkAreaPayload) HasAddressFamily() bool { - _, ok := o.GetAddressFamilyOk() - return ok -} - -// SetAddressFamily gets a reference to the given UpdateAreaAddressFamily and assigns it to the AddressFamily field. -func (o *PartialUpdateNetworkAreaPayload) SetAddressFamily(v PartialUpdateNetworkAreaPayloadGetAddressFamilyRetType) { - setPartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeType(&o.AddressFamily, v) -} - // GetLabels returns the Labels field value if set, zero value otherwise. func (o *PartialUpdateNetworkAreaPayload) GetLabels() (res PartialUpdateNetworkAreaPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() @@ -175,9 +130,6 @@ func (o *PartialUpdateNetworkAreaPayload) SetName(v PartialUpdateNetworkAreaPayl func (o PartialUpdateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getPartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily); ok { - toSerialize["AddressFamily"] = val - } if val, ok := getPartialUpdateNetworkAreaPayloadGetLabelsAttributeTypeOk(o.Labels); ok { toSerialize["Labels"] = val } diff --git a/services/iaas/model_partial_update_network_area_payload_test.go b/services/iaas/model_partial_update_network_area_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_partial_update_network_area_payload_test.go +++ b/services/iaas/model_partial_update_network_area_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_partial_update_network_payload.go b/services/iaas/model_partial_update_network_payload.go index 12d2e1280..83d5321f8 100644 --- a/services/iaas/model_partial_update_network_payload.go +++ b/services/iaas/model_partial_update_network_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,42 +18,62 @@ import ( var _ MappedNullable = &PartialUpdateNetworkPayload{} /* - types and functions for addressFamily + types and functions for dhcp +*/ + +// isBoolean +type PartialUpdateNetworkPayloadgetDhcpAttributeType = *bool +type PartialUpdateNetworkPayloadgetDhcpArgType = bool +type PartialUpdateNetworkPayloadgetDhcpRetType = bool + +func getPartialUpdateNetworkPayloadgetDhcpAttributeTypeOk(arg PartialUpdateNetworkPayloadgetDhcpAttributeType) (ret PartialUpdateNetworkPayloadgetDhcpRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateNetworkPayloadgetDhcpAttributeType(arg *PartialUpdateNetworkPayloadgetDhcpAttributeType, val PartialUpdateNetworkPayloadgetDhcpRetType) { + *arg = &val +} + +/* + types and functions for ipv4 */ // isModel -type PartialUpdateNetworkPayloadGetAddressFamilyAttributeType = *UpdateNetworkAddressFamily -type PartialUpdateNetworkPayloadGetAddressFamilyArgType = UpdateNetworkAddressFamily -type PartialUpdateNetworkPayloadGetAddressFamilyRetType = UpdateNetworkAddressFamily +type PartialUpdateNetworkPayloadGetIpv4AttributeType = *UpdateNetworkIPv4Body +type PartialUpdateNetworkPayloadGetIpv4ArgType = UpdateNetworkIPv4Body +type PartialUpdateNetworkPayloadGetIpv4RetType = UpdateNetworkIPv4Body -func getPartialUpdateNetworkPayloadGetAddressFamilyAttributeTypeOk(arg PartialUpdateNetworkPayloadGetAddressFamilyAttributeType) (ret PartialUpdateNetworkPayloadGetAddressFamilyRetType, ok bool) { +func getPartialUpdateNetworkPayloadGetIpv4AttributeTypeOk(arg PartialUpdateNetworkPayloadGetIpv4AttributeType) (ret PartialUpdateNetworkPayloadGetIpv4RetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setPartialUpdateNetworkPayloadGetAddressFamilyAttributeType(arg *PartialUpdateNetworkPayloadGetAddressFamilyAttributeType, val PartialUpdateNetworkPayloadGetAddressFamilyRetType) { +func setPartialUpdateNetworkPayloadGetIpv4AttributeType(arg *PartialUpdateNetworkPayloadGetIpv4AttributeType, val PartialUpdateNetworkPayloadGetIpv4RetType) { *arg = &val } /* - types and functions for dhcp + types and functions for ipv6 */ -// isBoolean -type PartialUpdateNetworkPayloadgetDhcpAttributeType = *bool -type PartialUpdateNetworkPayloadgetDhcpArgType = bool -type PartialUpdateNetworkPayloadgetDhcpRetType = bool +// isModel +type PartialUpdateNetworkPayloadGetIpv6AttributeType = *UpdateNetworkIPv6Body +type PartialUpdateNetworkPayloadGetIpv6ArgType = UpdateNetworkIPv6Body +type PartialUpdateNetworkPayloadGetIpv6RetType = UpdateNetworkIPv6Body -func getPartialUpdateNetworkPayloadgetDhcpAttributeTypeOk(arg PartialUpdateNetworkPayloadgetDhcpAttributeType) (ret PartialUpdateNetworkPayloadgetDhcpRetType, ok bool) { +func getPartialUpdateNetworkPayloadGetIpv6AttributeTypeOk(arg PartialUpdateNetworkPayloadGetIpv6AttributeType) (ret PartialUpdateNetworkPayloadGetIpv6RetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setPartialUpdateNetworkPayloadgetDhcpAttributeType(arg *PartialUpdateNetworkPayloadgetDhcpAttributeType, val PartialUpdateNetworkPayloadgetDhcpRetType) { +func setPartialUpdateNetworkPayloadGetIpv6AttributeType(arg *PartialUpdateNetworkPayloadGetIpv6AttributeType, val PartialUpdateNetworkPayloadGetIpv6RetType) { *arg = &val } @@ -118,17 +138,41 @@ func setPartialUpdateNetworkPayloadgetRoutedAttributeType(arg *PartialUpdateNetw *arg = &val } +/* + types and functions for routingTableId +*/ + +// isNotNullableString +type PartialUpdateNetworkPayloadGetRoutingTableIdAttributeType = *string + +func getPartialUpdateNetworkPayloadGetRoutingTableIdAttributeTypeOk(arg PartialUpdateNetworkPayloadGetRoutingTableIdAttributeType) (ret PartialUpdateNetworkPayloadGetRoutingTableIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateNetworkPayloadGetRoutingTableIdAttributeType(arg *PartialUpdateNetworkPayloadGetRoutingTableIdAttributeType, val PartialUpdateNetworkPayloadGetRoutingTableIdRetType) { + *arg = &val +} + +type PartialUpdateNetworkPayloadGetRoutingTableIdArgType = string +type PartialUpdateNetworkPayloadGetRoutingTableIdRetType = string + // PartialUpdateNetworkPayload Object that represents the request body for a network update. type PartialUpdateNetworkPayload struct { - AddressFamily PartialUpdateNetworkPayloadGetAddressFamilyAttributeType `json:"addressFamily,omitempty"` // Enable or disable DHCP for a network. Dhcp PartialUpdateNetworkPayloadgetDhcpAttributeType `json:"dhcp,omitempty"` + Ipv4 PartialUpdateNetworkPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` + Ipv6 PartialUpdateNetworkPayloadGetIpv6AttributeType `json:"ipv6,omitempty"` // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Labels PartialUpdateNetworkPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name PartialUpdateNetworkPayloadGetNameAttributeType `json:"name,omitempty"` // Shows if the network is routed and therefore accessible from other networks. Routed PartialUpdateNetworkPayloadgetRoutedAttributeType `json:"routed,omitempty"` + // Universally Unique Identifier (UUID). + RoutingTableId PartialUpdateNetworkPayloadGetRoutingTableIdAttributeType `json:"routingTableId,omitempty"` } // NewPartialUpdateNetworkPayload instantiates a new PartialUpdateNetworkPayload object @@ -148,29 +192,6 @@ func NewPartialUpdateNetworkPayloadWithDefaults() *PartialUpdateNetworkPayload { return &this } -// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. -func (o *PartialUpdateNetworkPayload) GetAddressFamily() (res PartialUpdateNetworkPayloadGetAddressFamilyRetType) { - res, _ = o.GetAddressFamilyOk() - return -} - -// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PartialUpdateNetworkPayload) GetAddressFamilyOk() (ret PartialUpdateNetworkPayloadGetAddressFamilyRetType, ok bool) { - return getPartialUpdateNetworkPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily) -} - -// HasAddressFamily returns a boolean if a field has been set. -func (o *PartialUpdateNetworkPayload) HasAddressFamily() bool { - _, ok := o.GetAddressFamilyOk() - return ok -} - -// SetAddressFamily gets a reference to the given UpdateNetworkAddressFamily and assigns it to the AddressFamily field. -func (o *PartialUpdateNetworkPayload) SetAddressFamily(v PartialUpdateNetworkPayloadGetAddressFamilyRetType) { - setPartialUpdateNetworkPayloadGetAddressFamilyAttributeType(&o.AddressFamily, v) -} - // GetDhcp returns the Dhcp field value if set, zero value otherwise. func (o *PartialUpdateNetworkPayload) GetDhcp() (res PartialUpdateNetworkPayloadgetDhcpRetType) { res, _ = o.GetDhcpOk() @@ -194,6 +215,52 @@ func (o *PartialUpdateNetworkPayload) SetDhcp(v PartialUpdateNetworkPayloadgetDh setPartialUpdateNetworkPayloadgetDhcpAttributeType(&o.Dhcp, v) } +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetIpv4() (res PartialUpdateNetworkPayloadGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetIpv4Ok() (ret PartialUpdateNetworkPayloadGetIpv4RetType, ok bool) { + return getPartialUpdateNetworkPayloadGetIpv4AttributeTypeOk(o.Ipv4) +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasIpv4() bool { + _, ok := o.GetIpv4Ok() + return ok +} + +// SetIpv4 gets a reference to the given UpdateNetworkIPv4Body and assigns it to the Ipv4 field. +func (o *PartialUpdateNetworkPayload) SetIpv4(v PartialUpdateNetworkPayloadGetIpv4RetType) { + setPartialUpdateNetworkPayloadGetIpv4AttributeType(&o.Ipv4, v) +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetIpv6() (res PartialUpdateNetworkPayloadGetIpv6RetType) { + res, _ = o.GetIpv6Ok() + return +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetIpv6Ok() (ret PartialUpdateNetworkPayloadGetIpv6RetType, ok bool) { + return getPartialUpdateNetworkPayloadGetIpv6AttributeTypeOk(o.Ipv6) +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasIpv6() bool { + _, ok := o.GetIpv6Ok() + return ok +} + +// SetIpv6 gets a reference to the given UpdateNetworkIPv6Body and assigns it to the Ipv6 field. +func (o *PartialUpdateNetworkPayload) SetIpv6(v PartialUpdateNetworkPayloadGetIpv6RetType) { + setPartialUpdateNetworkPayloadGetIpv6AttributeType(&o.Ipv6, v) +} + // GetLabels returns the Labels field value if set, zero value otherwise. func (o *PartialUpdateNetworkPayload) GetLabels() (res PartialUpdateNetworkPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() @@ -263,14 +330,40 @@ func (o *PartialUpdateNetworkPayload) SetRouted(v PartialUpdateNetworkPayloadget setPartialUpdateNetworkPayloadgetRoutedAttributeType(&o.Routed, v) } +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetRoutingTableId() (res PartialUpdateNetworkPayloadGetRoutingTableIdRetType) { + res, _ = o.GetRoutingTableIdOk() + return +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetRoutingTableIdOk() (ret PartialUpdateNetworkPayloadGetRoutingTableIdRetType, ok bool) { + return getPartialUpdateNetworkPayloadGetRoutingTableIdAttributeTypeOk(o.RoutingTableId) +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasRoutingTableId() bool { + _, ok := o.GetRoutingTableIdOk() + return ok +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *PartialUpdateNetworkPayload) SetRoutingTableId(v PartialUpdateNetworkPayloadGetRoutingTableIdRetType) { + setPartialUpdateNetworkPayloadGetRoutingTableIdAttributeType(&o.RoutingTableId, v) +} + func (o PartialUpdateNetworkPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getPartialUpdateNetworkPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily); ok { - toSerialize["AddressFamily"] = val - } if val, ok := getPartialUpdateNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp); ok { toSerialize["Dhcp"] = val } + if val, ok := getPartialUpdateNetworkPayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val + } + if val, ok := getPartialUpdateNetworkPayloadGetIpv6AttributeTypeOk(o.Ipv6); ok { + toSerialize["Ipv6"] = val + } if val, ok := getPartialUpdateNetworkPayloadGetLabelsAttributeTypeOk(o.Labels); ok { toSerialize["Labels"] = val } @@ -280,6 +373,9 @@ func (o PartialUpdateNetworkPayload) ToMap() (map[string]interface{}, error) { if val, ok := getPartialUpdateNetworkPayloadgetRoutedAttributeTypeOk(o.Routed); ok { toSerialize["Routed"] = val } + if val, ok := getPartialUpdateNetworkPayloadGetRoutingTableIdAttributeTypeOk(o.RoutingTableId); ok { + toSerialize["RoutingTableId"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_partial_update_network_payload_test.go b/services/iaas/model_partial_update_network_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_partial_update_network_payload_test.go +++ b/services/iaas/model_partial_update_network_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_port_range.go b/services/iaas/model_port_range.go index fdcf357a6..ad4f233ee 100644 --- a/services/iaas/model_port_range.go +++ b/services/iaas/model_port_range.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_port_range_test.go b/services/iaas/model_port_range_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_port_range_test.go +++ b/services/iaas/model_port_range_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_project.go b/services/iaas/model_project.go index 4964e1b93..e4e428702 100644 --- a/services/iaas/model_project.go +++ b/services/iaas/model_project.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -59,87 +59,66 @@ func setProjectGetCreatedAtAttributeType(arg *ProjectGetCreatedAtAttributeType, } /* - types and functions for internetAccess -*/ - -// isBoolean -type ProjectgetInternetAccessAttributeType = *bool -type ProjectgetInternetAccessArgType = bool -type ProjectgetInternetAccessRetType = bool - -func getProjectgetInternetAccessAttributeTypeOk(arg ProjectgetInternetAccessAttributeType) (ret ProjectgetInternetAccessRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setProjectgetInternetAccessAttributeType(arg *ProjectgetInternetAccessAttributeType, val ProjectgetInternetAccessRetType) { - *arg = &val -} - -/* - types and functions for openstackProjectId + types and functions for id */ // isNotNullableString -type ProjectGetOpenstackProjectIdAttributeType = *string +type ProjectGetIdAttributeType = *string -func getProjectGetOpenstackProjectIdAttributeTypeOk(arg ProjectGetOpenstackProjectIdAttributeType) (ret ProjectGetOpenstackProjectIdRetType, ok bool) { +func getProjectGetIdAttributeTypeOk(arg ProjectGetIdAttributeType) (ret ProjectGetIdRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setProjectGetOpenstackProjectIdAttributeType(arg *ProjectGetOpenstackProjectIdAttributeType, val ProjectGetOpenstackProjectIdRetType) { +func setProjectGetIdAttributeType(arg *ProjectGetIdAttributeType, val ProjectGetIdRetType) { *arg = &val } -type ProjectGetOpenstackProjectIdArgType = string -type ProjectGetOpenstackProjectIdRetType = string +type ProjectGetIdArgType = string +type ProjectGetIdRetType = string /* - types and functions for projectId + types and functions for internetAccess */ -// isNotNullableString -type ProjectGetProjectIdAttributeType = *string +// isBoolean +type ProjectgetInternetAccessAttributeType = *bool +type ProjectgetInternetAccessArgType = bool +type ProjectgetInternetAccessRetType = bool -func getProjectGetProjectIdAttributeTypeOk(arg ProjectGetProjectIdAttributeType) (ret ProjectGetProjectIdRetType, ok bool) { +func getProjectgetInternetAccessAttributeTypeOk(arg ProjectgetInternetAccessAttributeType) (ret ProjectgetInternetAccessRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setProjectGetProjectIdAttributeType(arg *ProjectGetProjectIdAttributeType, val ProjectGetProjectIdRetType) { +func setProjectgetInternetAccessAttributeType(arg *ProjectgetInternetAccessAttributeType, val ProjectgetInternetAccessRetType) { *arg = &val } -type ProjectGetProjectIdArgType = string -type ProjectGetProjectIdRetType = string - /* - types and functions for state + types and functions for status */ // isNotNullableString -type ProjectGetStateAttributeType = *string +type ProjectGetStatusAttributeType = *string -func getProjectGetStateAttributeTypeOk(arg ProjectGetStateAttributeType) (ret ProjectGetStateRetType, ok bool) { +func getProjectGetStatusAttributeTypeOk(arg ProjectGetStatusAttributeType) (ret ProjectGetStatusRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setProjectGetStateAttributeType(arg *ProjectGetStateAttributeType, val ProjectGetStateRetType) { +func setProjectGetStatusAttributeType(arg *ProjectGetStatusAttributeType, val ProjectGetStatusRetType) { *arg = &val } -type ProjectGetStateArgType = string -type ProjectGetStateRetType = string +type ProjectGetStatusArgType = string +type ProjectGetStatusRetType = string /* types and functions for updatedAt @@ -166,16 +145,14 @@ type Project struct { // REQUIRED AreaId ProjectGetAreaIdAttributeType `json:"areaId" required:"true"` // Date-time when resource was created. - CreatedAt ProjectGetCreatedAtAttributeType `json:"createdAt,omitempty"` - InternetAccess ProjectgetInternetAccessAttributeType `json:"internetAccess,omitempty"` - // The identifier (ID) of an OpenStack project. - OpenstackProjectId ProjectGetOpenstackProjectIdAttributeType `json:"openstackProjectId,omitempty"` + CreatedAt ProjectGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Universally Unique Identifier (UUID). // REQUIRED - ProjectId ProjectGetProjectIdAttributeType `json:"projectId" required:"true"` + Id ProjectGetIdAttributeType `json:"id" required:"true"` + InternetAccess ProjectgetInternetAccessAttributeType `json:"internetAccess,omitempty"` // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. // REQUIRED - State ProjectGetStateAttributeType `json:"state" required:"true"` + Status ProjectGetStatusAttributeType `json:"status" required:"true"` // Date-time when resource was last updated. UpdatedAt ProjectGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } @@ -186,11 +163,11 @@ type _Project Project // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewProject(areaId ProjectGetAreaIdArgType, projectId ProjectGetProjectIdArgType, state ProjectGetStateArgType) *Project { +func NewProject(areaId ProjectGetAreaIdArgType, id ProjectGetIdArgType, status ProjectGetStatusArgType) *Project { this := Project{} setProjectGetAreaIdAttributeType(&this.AreaId, areaId) - setProjectGetProjectIdAttributeType(&this.ProjectId, projectId) - setProjectGetStateAttributeType(&this.State, state) + setProjectGetIdAttributeType(&this.Id, id) + setProjectGetStatusAttributeType(&this.Status, status) return &this } @@ -242,6 +219,23 @@ func (o *Project) SetCreatedAt(v ProjectGetCreatedAtRetType) { setProjectGetCreatedAtAttributeType(&o.CreatedAt, v) } +// GetId returns the Id field value +func (o *Project) GetId() (ret ProjectGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Project) GetIdOk() (ret ProjectGetIdRetType, ok bool) { + return getProjectGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +func (o *Project) SetId(v ProjectGetIdRetType) { + setProjectGetIdAttributeType(&o.Id, v) +} + // GetInternetAccess returns the InternetAccess field value if set, zero value otherwise. func (o *Project) GetInternetAccess() (res ProjectgetInternetAccessRetType) { res, _ = o.GetInternetAccessOk() @@ -265,61 +259,21 @@ func (o *Project) SetInternetAccess(v ProjectgetInternetAccessRetType) { setProjectgetInternetAccessAttributeType(&o.InternetAccess, v) } -// GetOpenstackProjectId returns the OpenstackProjectId field value if set, zero value otherwise. -func (o *Project) GetOpenstackProjectId() (res ProjectGetOpenstackProjectIdRetType) { - res, _ = o.GetOpenstackProjectIdOk() - return -} - -// GetOpenstackProjectIdOk returns a tuple with the OpenstackProjectId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Project) GetOpenstackProjectIdOk() (ret ProjectGetOpenstackProjectIdRetType, ok bool) { - return getProjectGetOpenstackProjectIdAttributeTypeOk(o.OpenstackProjectId) -} - -// HasOpenstackProjectId returns a boolean if a field has been set. -func (o *Project) HasOpenstackProjectId() bool { - _, ok := o.GetOpenstackProjectIdOk() - return ok -} - -// SetOpenstackProjectId gets a reference to the given string and assigns it to the OpenstackProjectId field. -func (o *Project) SetOpenstackProjectId(v ProjectGetOpenstackProjectIdRetType) { - setProjectGetOpenstackProjectIdAttributeType(&o.OpenstackProjectId, v) -} - -// GetProjectId returns the ProjectId field value -func (o *Project) GetProjectId() (ret ProjectGetProjectIdRetType) { - ret, _ = o.GetProjectIdOk() +// GetStatus returns the Status field value +func (o *Project) GetStatus() (ret ProjectGetStatusRetType) { + ret, _ = o.GetStatusOk() return ret } -// GetProjectIdOk returns a tuple with the ProjectId field value +// GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *Project) GetProjectIdOk() (ret ProjectGetProjectIdRetType, ok bool) { - return getProjectGetProjectIdAttributeTypeOk(o.ProjectId) +func (o *Project) GetStatusOk() (ret ProjectGetStatusRetType, ok bool) { + return getProjectGetStatusAttributeTypeOk(o.Status) } -// SetProjectId sets field value -func (o *Project) SetProjectId(v ProjectGetProjectIdRetType) { - setProjectGetProjectIdAttributeType(&o.ProjectId, v) -} - -// GetState returns the State field value -func (o *Project) GetState() (ret ProjectGetStateRetType) { - ret, _ = o.GetStateOk() - return ret -} - -// GetStateOk returns a tuple with the State field value -// and a boolean to check if the value has been set. -func (o *Project) GetStateOk() (ret ProjectGetStateRetType, ok bool) { - return getProjectGetStateAttributeTypeOk(o.State) -} - -// SetState sets field value -func (o *Project) SetState(v ProjectGetStateRetType) { - setProjectGetStateAttributeType(&o.State, v) +// SetStatus sets field value +func (o *Project) SetStatus(v ProjectGetStatusRetType) { + setProjectGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. @@ -353,17 +307,14 @@ func (o Project) ToMap() (map[string]interface{}, error) { if val, ok := getProjectGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { toSerialize["CreatedAt"] = val } + if val, ok := getProjectGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } if val, ok := getProjectgetInternetAccessAttributeTypeOk(o.InternetAccess); ok { toSerialize["InternetAccess"] = val } - if val, ok := getProjectGetOpenstackProjectIdAttributeTypeOk(o.OpenstackProjectId); ok { - toSerialize["OpenstackProjectId"] = val - } - if val, ok := getProjectGetProjectIdAttributeTypeOk(o.ProjectId); ok { - toSerialize["ProjectId"] = val - } - if val, ok := getProjectGetStateAttributeTypeOk(o.State); ok { - toSerialize["State"] = val + if val, ok := getProjectGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } if val, ok := getProjectGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { toSerialize["UpdatedAt"] = val diff --git a/services/iaas/model_project_list_response.go b/services/iaas/model_project_list_response.go index 33dae4416..d4192ec02 100644 --- a/services/iaas/model_project_list_response.go +++ b/services/iaas/model_project_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_project_list_response_test.go b/services/iaas/model_project_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_project_list_response_test.go +++ b/services/iaas/model_project_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_project_test.go b/services/iaas/model_project_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_project_test.go +++ b/services/iaas/model_project_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_protocol.go b/services/iaas/model_protocol.go index fc448f247..ee516de57 100644 --- a/services/iaas/model_protocol.go +++ b/services/iaas/model_protocol.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_protocol_test.go b/services/iaas/model_protocol_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_protocol_test.go +++ b/services/iaas/model_protocol_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_public_ip.go b/services/iaas/model_public_ip.go index e0ea851aa..023387e5e 100644 --- a/services/iaas/model_public_ip.go +++ b/services/iaas/model_public_ip.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -108,7 +108,7 @@ type PublicIpGetNetworkInterfaceRetType = *string type PublicIp struct { // Universally Unique Identifier (UUID). Id PublicIpGetIdAttributeType `json:"id,omitempty"` - // Object that represents an IP address. + // String that represents an IPv4 address. Ip PublicIpGetIpAttributeType `json:"ip,omitempty"` // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Labels PublicIpGetLabelsAttributeType `json:"labels,omitempty"` diff --git a/services/iaas/model_public_ip_list_response.go b/services/iaas/model_public_ip_list_response.go index c1da58df5..f0624192f 100644 --- a/services/iaas/model_public_ip_list_response.go +++ b/services/iaas/model_public_ip_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_public_ip_list_response_test.go b/services/iaas/model_public_ip_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_public_ip_list_response_test.go +++ b/services/iaas/model_public_ip_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_public_ip_test.go b/services/iaas/model_public_ip_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_public_ip_test.go +++ b/services/iaas/model_public_ip_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_public_network.go b/services/iaas/model_public_network.go index 449717818..c84b840e4 100644 --- a/services/iaas/model_public_network.go +++ b/services/iaas/model_public_network.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -38,11 +38,35 @@ func setPublicNetworkGetCidrAttributeType(arg *PublicNetworkGetCidrAttributeType type PublicNetworkGetCidrArgType = string type PublicNetworkGetCidrRetType = string +/* + types and functions for region +*/ + +// isNotNullableString +type PublicNetworkGetRegionAttributeType = *string + +func getPublicNetworkGetRegionAttributeTypeOk(arg PublicNetworkGetRegionAttributeType) (ret PublicNetworkGetRegionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPublicNetworkGetRegionAttributeType(arg *PublicNetworkGetRegionAttributeType, val PublicNetworkGetRegionRetType) { + *arg = &val +} + +type PublicNetworkGetRegionArgType = string +type PublicNetworkGetRegionRetType = string + // PublicNetwork Public network. type PublicNetwork struct { // Classless Inter-Domain Routing (CIDR). // REQUIRED Cidr PublicNetworkGetCidrAttributeType `json:"cidr" required:"true"` + // Name of the region. + // REQUIRED + Region PublicNetworkGetRegionAttributeType `json:"region" required:"true"` } type _PublicNetwork PublicNetwork @@ -51,9 +75,10 @@ type _PublicNetwork PublicNetwork // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPublicNetwork(cidr PublicNetworkGetCidrArgType) *PublicNetwork { +func NewPublicNetwork(cidr PublicNetworkGetCidrArgType, region PublicNetworkGetRegionArgType) *PublicNetwork { this := PublicNetwork{} setPublicNetworkGetCidrAttributeType(&this.Cidr, cidr) + setPublicNetworkGetRegionAttributeType(&this.Region, region) return &this } @@ -82,11 +107,31 @@ func (o *PublicNetwork) SetCidr(v PublicNetworkGetCidrRetType) { setPublicNetworkGetCidrAttributeType(&o.Cidr, v) } +// GetRegion returns the Region field value +func (o *PublicNetwork) GetRegion() (ret PublicNetworkGetRegionRetType) { + ret, _ = o.GetRegionOk() + return ret +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *PublicNetwork) GetRegionOk() (ret PublicNetworkGetRegionRetType, ok bool) { + return getPublicNetworkGetRegionAttributeTypeOk(o.Region) +} + +// SetRegion sets field value +func (o *PublicNetwork) SetRegion(v PublicNetworkGetRegionRetType) { + setPublicNetworkGetRegionAttributeType(&o.Region, v) +} + func (o PublicNetwork) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPublicNetworkGetCidrAttributeTypeOk(o.Cidr); ok { toSerialize["Cidr"] = val } + if val, ok := getPublicNetworkGetRegionAttributeTypeOk(o.Region); ok { + toSerialize["Region"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_public_network_list_response.go b/services/iaas/model_public_network_list_response.go index 2a32fe5c3..db106788f 100644 --- a/services/iaas/model_public_network_list_response.go +++ b/services/iaas/model_public_network_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_public_network_list_response_test.go b/services/iaas/model_public_network_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_public_network_list_response_test.go +++ b/services/iaas/model_public_network_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_public_network_test.go b/services/iaas/model_public_network_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_public_network_test.go +++ b/services/iaas/model_public_network_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota.go b/services/iaas/model_quota.go index 44fb3d316..b1b822584 100644 --- a/services/iaas/model_quota.go +++ b/services/iaas/model_quota.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list.go b/services/iaas/model_quota_list.go index e0f84bf43..571365b7c 100644 --- a/services/iaas/model_quota_list.go +++ b/services/iaas/model_quota_list.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_backup_gigabytes.go b/services/iaas/model_quota_list_backup_gigabytes.go index 248b232f1..724132c78 100644 --- a/services/iaas/model_quota_list_backup_gigabytes.go +++ b/services/iaas/model_quota_list_backup_gigabytes.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_backup_gigabytes_test.go b/services/iaas/model_quota_list_backup_gigabytes_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_backup_gigabytes_test.go +++ b/services/iaas/model_quota_list_backup_gigabytes_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_backups.go b/services/iaas/model_quota_list_backups.go index 8de2de8e9..1b6a19d72 100644 --- a/services/iaas/model_quota_list_backups.go +++ b/services/iaas/model_quota_list_backups.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_backups_test.go b/services/iaas/model_quota_list_backups_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_backups_test.go +++ b/services/iaas/model_quota_list_backups_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_gigabytes.go b/services/iaas/model_quota_list_gigabytes.go index 05b22c50b..0dd6f3807 100644 --- a/services/iaas/model_quota_list_gigabytes.go +++ b/services/iaas/model_quota_list_gigabytes.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_gigabytes_test.go b/services/iaas/model_quota_list_gigabytes_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_gigabytes_test.go +++ b/services/iaas/model_quota_list_gigabytes_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_networks.go b/services/iaas/model_quota_list_networks.go index 9d3de146b..718406a70 100644 --- a/services/iaas/model_quota_list_networks.go +++ b/services/iaas/model_quota_list_networks.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_networks_test.go b/services/iaas/model_quota_list_networks_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_networks_test.go +++ b/services/iaas/model_quota_list_networks_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_nics.go b/services/iaas/model_quota_list_nics.go index 844041bb1..5de358974 100644 --- a/services/iaas/model_quota_list_nics.go +++ b/services/iaas/model_quota_list_nics.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_nics_test.go b/services/iaas/model_quota_list_nics_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_nics_test.go +++ b/services/iaas/model_quota_list_nics_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_public_ips.go b/services/iaas/model_quota_list_public_ips.go index 1260428f0..40667f8b9 100644 --- a/services/iaas/model_quota_list_public_ips.go +++ b/services/iaas/model_quota_list_public_ips.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_public_ips_test.go b/services/iaas/model_quota_list_public_ips_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_public_ips_test.go +++ b/services/iaas/model_quota_list_public_ips_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_ram.go b/services/iaas/model_quota_list_ram.go index 2f7ebedcf..148cb016d 100644 --- a/services/iaas/model_quota_list_ram.go +++ b/services/iaas/model_quota_list_ram.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_ram_test.go b/services/iaas/model_quota_list_ram_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_ram_test.go +++ b/services/iaas/model_quota_list_ram_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_response.go b/services/iaas/model_quota_list_response.go index 85618fa27..75a23f980 100644 --- a/services/iaas/model_quota_list_response.go +++ b/services/iaas/model_quota_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_response_test.go b/services/iaas/model_quota_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_response_test.go +++ b/services/iaas/model_quota_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_security_group_rules.go b/services/iaas/model_quota_list_security_group_rules.go index 7c06a6614..ce9732f59 100644 --- a/services/iaas/model_quota_list_security_group_rules.go +++ b/services/iaas/model_quota_list_security_group_rules.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_security_group_rules_test.go b/services/iaas/model_quota_list_security_group_rules_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_security_group_rules_test.go +++ b/services/iaas/model_quota_list_security_group_rules_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_security_groups.go b/services/iaas/model_quota_list_security_groups.go index 9f149a31f..f2f0c324c 100644 --- a/services/iaas/model_quota_list_security_groups.go +++ b/services/iaas/model_quota_list_security_groups.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_security_groups_test.go b/services/iaas/model_quota_list_security_groups_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_security_groups_test.go +++ b/services/iaas/model_quota_list_security_groups_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_snapshots.go b/services/iaas/model_quota_list_snapshots.go index 1cd138aea..a31f0c1ab 100644 --- a/services/iaas/model_quota_list_snapshots.go +++ b/services/iaas/model_quota_list_snapshots.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_snapshots_test.go b/services/iaas/model_quota_list_snapshots_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_snapshots_test.go +++ b/services/iaas/model_quota_list_snapshots_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_test.go b/services/iaas/model_quota_list_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_test.go +++ b/services/iaas/model_quota_list_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_vcpu.go b/services/iaas/model_quota_list_vcpu.go index 1a8764cbd..62a869cc5 100644 --- a/services/iaas/model_quota_list_vcpu.go +++ b/services/iaas/model_quota_list_vcpu.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_vcpu_test.go b/services/iaas/model_quota_list_vcpu_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_vcpu_test.go +++ b/services/iaas/model_quota_list_vcpu_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_volumes.go b/services/iaas/model_quota_list_volumes.go index fe97aa541..4c5d37414 100644 --- a/services/iaas/model_quota_list_volumes.go +++ b/services/iaas/model_quota_list_volumes.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_list_volumes_test.go b/services/iaas/model_quota_list_volumes_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_list_volumes_test.go +++ b/services/iaas/model_quota_list_volumes_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_quota_test.go b/services/iaas/model_quota_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_quota_test.go +++ b/services/iaas/model_quota_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_regional_area.go b/services/iaas/model_regional_area.go new file mode 100644 index 000000000..9877fcd0d --- /dev/null +++ b/services/iaas/model_regional_area.go @@ -0,0 +1,176 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the RegionalArea type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegionalArea{} + +/* + types and functions for ipv4 +*/ + +// isModel +type RegionalAreaGetIpv4AttributeType = *RegionalAreaIPv4 +type RegionalAreaGetIpv4ArgType = RegionalAreaIPv4 +type RegionalAreaGetIpv4RetType = RegionalAreaIPv4 + +func getRegionalAreaGetIpv4AttributeTypeOk(arg RegionalAreaGetIpv4AttributeType) (ret RegionalAreaGetIpv4RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRegionalAreaGetIpv4AttributeType(arg *RegionalAreaGetIpv4AttributeType, val RegionalAreaGetIpv4RetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type RegionalAreaGetStatusAttributeType = *string + +func getRegionalAreaGetStatusAttributeTypeOk(arg RegionalAreaGetStatusAttributeType) (ret RegionalAreaGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRegionalAreaGetStatusAttributeType(arg *RegionalAreaGetStatusAttributeType, val RegionalAreaGetStatusRetType) { + *arg = &val +} + +type RegionalAreaGetStatusArgType = string +type RegionalAreaGetStatusRetType = string + +// RegionalArea The basic properties of a regional network area. +type RegionalArea struct { + Ipv4 RegionalAreaGetIpv4AttributeType `json:"ipv4,omitempty"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status RegionalAreaGetStatusAttributeType `json:"status,omitempty"` +} + +// NewRegionalArea instantiates a new RegionalArea object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegionalArea() *RegionalArea { + this := RegionalArea{} + return &this +} + +// NewRegionalAreaWithDefaults instantiates a new RegionalArea object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegionalAreaWithDefaults() *RegionalArea { + this := RegionalArea{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *RegionalArea) GetIpv4() (res RegionalAreaGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegionalArea) GetIpv4Ok() (ret RegionalAreaGetIpv4RetType, ok bool) { + return getRegionalAreaGetIpv4AttributeTypeOk(o.Ipv4) +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *RegionalArea) HasIpv4() bool { + _, ok := o.GetIpv4Ok() + return ok +} + +// SetIpv4 gets a reference to the given RegionalAreaIPv4 and assigns it to the Ipv4 field. +func (o *RegionalArea) SetIpv4(v RegionalAreaGetIpv4RetType) { + setRegionalAreaGetIpv4AttributeType(&o.Ipv4, v) +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *RegionalArea) GetStatus() (res RegionalAreaGetStatusRetType) { + res, _ = o.GetStatusOk() + return +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegionalArea) GetStatusOk() (ret RegionalAreaGetStatusRetType, ok bool) { + return getRegionalAreaGetStatusAttributeTypeOk(o.Status) +} + +// HasStatus returns a boolean if a field has been set. +func (o *RegionalArea) HasStatus() bool { + _, ok := o.GetStatusOk() + return ok +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *RegionalArea) SetStatus(v RegionalAreaGetStatusRetType) { + setRegionalAreaGetStatusAttributeType(&o.Status, v) +} + +func (o RegionalArea) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getRegionalAreaGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val + } + if val, ok := getRegionalAreaGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val + } + return toSerialize, nil +} + +type NullableRegionalArea struct { + value *RegionalArea + isSet bool +} + +func (v NullableRegionalArea) Get() *RegionalArea { + return v.value +} + +func (v *NullableRegionalArea) Set(val *RegionalArea) { + v.value = val + v.isSet = true +} + +func (v NullableRegionalArea) IsSet() bool { + return v.isSet +} + +func (v *NullableRegionalArea) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegionalArea(val *RegionalArea) *NullableRegionalArea { + return &NullableRegionalArea{value: val, isSet: true} +} + +func (v NullableRegionalArea) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegionalArea) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_regional_area_ipv4.go b/services/iaas/model_regional_area_ipv4.go new file mode 100644 index 000000000..2c57d0536 --- /dev/null +++ b/services/iaas/model_regional_area_ipv4.go @@ -0,0 +1,356 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the RegionalAreaIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegionalAreaIPv4{} + +/* + types and functions for defaultNameservers +*/ + +// isArray +type RegionalAreaIPv4GetDefaultNameserversAttributeType = *[]string +type RegionalAreaIPv4GetDefaultNameserversArgType = []string +type RegionalAreaIPv4GetDefaultNameserversRetType = []string + +func getRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(arg RegionalAreaIPv4GetDefaultNameserversAttributeType) (ret RegionalAreaIPv4GetDefaultNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRegionalAreaIPv4GetDefaultNameserversAttributeType(arg *RegionalAreaIPv4GetDefaultNameserversAttributeType, val RegionalAreaIPv4GetDefaultNameserversRetType) { + *arg = &val +} + +/* + types and functions for defaultPrefixLen +*/ + +// isLong +type RegionalAreaIPv4GetDefaultPrefixLenAttributeType = *int64 +type RegionalAreaIPv4GetDefaultPrefixLenArgType = int64 +type RegionalAreaIPv4GetDefaultPrefixLenRetType = int64 + +func getRegionalAreaIPv4GetDefaultPrefixLenAttributeTypeOk(arg RegionalAreaIPv4GetDefaultPrefixLenAttributeType) (ret RegionalAreaIPv4GetDefaultPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRegionalAreaIPv4GetDefaultPrefixLenAttributeType(arg *RegionalAreaIPv4GetDefaultPrefixLenAttributeType, val RegionalAreaIPv4GetDefaultPrefixLenRetType) { + *arg = &val +} + +/* + types and functions for maxPrefixLen +*/ + +// isLong +type RegionalAreaIPv4GetMaxPrefixLenAttributeType = *int64 +type RegionalAreaIPv4GetMaxPrefixLenArgType = int64 +type RegionalAreaIPv4GetMaxPrefixLenRetType = int64 + +func getRegionalAreaIPv4GetMaxPrefixLenAttributeTypeOk(arg RegionalAreaIPv4GetMaxPrefixLenAttributeType) (ret RegionalAreaIPv4GetMaxPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRegionalAreaIPv4GetMaxPrefixLenAttributeType(arg *RegionalAreaIPv4GetMaxPrefixLenAttributeType, val RegionalAreaIPv4GetMaxPrefixLenRetType) { + *arg = &val +} + +/* + types and functions for minPrefixLen +*/ + +// isLong +type RegionalAreaIPv4GetMinPrefixLenAttributeType = *int64 +type RegionalAreaIPv4GetMinPrefixLenArgType = int64 +type RegionalAreaIPv4GetMinPrefixLenRetType = int64 + +func getRegionalAreaIPv4GetMinPrefixLenAttributeTypeOk(arg RegionalAreaIPv4GetMinPrefixLenAttributeType) (ret RegionalAreaIPv4GetMinPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRegionalAreaIPv4GetMinPrefixLenAttributeType(arg *RegionalAreaIPv4GetMinPrefixLenAttributeType, val RegionalAreaIPv4GetMinPrefixLenRetType) { + *arg = &val +} + +/* + types and functions for networkRanges +*/ + +// isArray +type RegionalAreaIPv4GetNetworkRangesAttributeType = *[]NetworkRange +type RegionalAreaIPv4GetNetworkRangesArgType = []NetworkRange +type RegionalAreaIPv4GetNetworkRangesRetType = []NetworkRange + +func getRegionalAreaIPv4GetNetworkRangesAttributeTypeOk(arg RegionalAreaIPv4GetNetworkRangesAttributeType) (ret RegionalAreaIPv4GetNetworkRangesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRegionalAreaIPv4GetNetworkRangesAttributeType(arg *RegionalAreaIPv4GetNetworkRangesAttributeType, val RegionalAreaIPv4GetNetworkRangesRetType) { + *arg = &val +} + +/* + types and functions for transferNetwork +*/ + +// isNotNullableString +type RegionalAreaIPv4GetTransferNetworkAttributeType = *string + +func getRegionalAreaIPv4GetTransferNetworkAttributeTypeOk(arg RegionalAreaIPv4GetTransferNetworkAttributeType) (ret RegionalAreaIPv4GetTransferNetworkRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRegionalAreaIPv4GetTransferNetworkAttributeType(arg *RegionalAreaIPv4GetTransferNetworkAttributeType, val RegionalAreaIPv4GetTransferNetworkRetType) { + *arg = &val +} + +type RegionalAreaIPv4GetTransferNetworkArgType = string +type RegionalAreaIPv4GetTransferNetworkRetType = string + +// RegionalAreaIPv4 The regional IPv4 config of a network area. +type RegionalAreaIPv4 struct { + DefaultNameservers RegionalAreaIPv4GetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` + // The default prefix length for networks in the network area. + // REQUIRED + DefaultPrefixLen RegionalAreaIPv4GetDefaultPrefixLenAttributeType `json:"defaultPrefixLen" required:"true"` + // The maximal prefix length for networks in the network area. + // REQUIRED + MaxPrefixLen RegionalAreaIPv4GetMaxPrefixLenAttributeType `json:"maxPrefixLen" required:"true"` + // The minimal prefix length for networks in the network area. + // REQUIRED + MinPrefixLen RegionalAreaIPv4GetMinPrefixLenAttributeType `json:"minPrefixLen" required:"true"` + // A list of network ranges. + // REQUIRED + NetworkRanges RegionalAreaIPv4GetNetworkRangesAttributeType `json:"networkRanges" required:"true"` + // IPv4 Classless Inter-Domain Routing (CIDR). + // REQUIRED + TransferNetwork RegionalAreaIPv4GetTransferNetworkAttributeType `json:"transferNetwork" required:"true"` +} + +type _RegionalAreaIPv4 RegionalAreaIPv4 + +// NewRegionalAreaIPv4 instantiates a new RegionalAreaIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegionalAreaIPv4(defaultPrefixLen RegionalAreaIPv4GetDefaultPrefixLenArgType, maxPrefixLen RegionalAreaIPv4GetMaxPrefixLenArgType, minPrefixLen RegionalAreaIPv4GetMinPrefixLenArgType, networkRanges RegionalAreaIPv4GetNetworkRangesArgType, transferNetwork RegionalAreaIPv4GetTransferNetworkArgType) *RegionalAreaIPv4 { + this := RegionalAreaIPv4{} + setRegionalAreaIPv4GetDefaultPrefixLenAttributeType(&this.DefaultPrefixLen, defaultPrefixLen) + setRegionalAreaIPv4GetMaxPrefixLenAttributeType(&this.MaxPrefixLen, maxPrefixLen) + setRegionalAreaIPv4GetMinPrefixLenAttributeType(&this.MinPrefixLen, minPrefixLen) + setRegionalAreaIPv4GetNetworkRangesAttributeType(&this.NetworkRanges, networkRanges) + setRegionalAreaIPv4GetTransferNetworkAttributeType(&this.TransferNetwork, transferNetwork) + return &this +} + +// NewRegionalAreaIPv4WithDefaults instantiates a new RegionalAreaIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegionalAreaIPv4WithDefaults() *RegionalAreaIPv4 { + this := RegionalAreaIPv4{} + var defaultPrefixLen int64 = 25 + this.DefaultPrefixLen = &defaultPrefixLen + var maxPrefixLen int64 = 29 + this.MaxPrefixLen = &maxPrefixLen + var minPrefixLen int64 = 24 + this.MinPrefixLen = &minPrefixLen + return &this +} + +// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. +func (o *RegionalAreaIPv4) GetDefaultNameservers() (res RegionalAreaIPv4GetDefaultNameserversRetType) { + res, _ = o.GetDefaultNameserversOk() + return +} + +// GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetDefaultNameserversOk() (ret RegionalAreaIPv4GetDefaultNameserversRetType, ok bool) { + return getRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) +} + +// HasDefaultNameservers returns a boolean if a field has been set. +func (o *RegionalAreaIPv4) HasDefaultNameservers() bool { + _, ok := o.GetDefaultNameserversOk() + return ok +} + +// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. +func (o *RegionalAreaIPv4) SetDefaultNameservers(v RegionalAreaIPv4GetDefaultNameserversRetType) { + setRegionalAreaIPv4GetDefaultNameserversAttributeType(&o.DefaultNameservers, v) +} + +// GetDefaultPrefixLen returns the DefaultPrefixLen field value +func (o *RegionalAreaIPv4) GetDefaultPrefixLen() (ret RegionalAreaIPv4GetDefaultPrefixLenRetType) { + ret, _ = o.GetDefaultPrefixLenOk() + return ret +} + +// GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetDefaultPrefixLenOk() (ret RegionalAreaIPv4GetDefaultPrefixLenRetType, ok bool) { + return getRegionalAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen) +} + +// SetDefaultPrefixLen sets field value +func (o *RegionalAreaIPv4) SetDefaultPrefixLen(v RegionalAreaIPv4GetDefaultPrefixLenRetType) { + setRegionalAreaIPv4GetDefaultPrefixLenAttributeType(&o.DefaultPrefixLen, v) +} + +// GetMaxPrefixLen returns the MaxPrefixLen field value +func (o *RegionalAreaIPv4) GetMaxPrefixLen() (ret RegionalAreaIPv4GetMaxPrefixLenRetType) { + ret, _ = o.GetMaxPrefixLenOk() + return ret +} + +// GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetMaxPrefixLenOk() (ret RegionalAreaIPv4GetMaxPrefixLenRetType, ok bool) { + return getRegionalAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen) +} + +// SetMaxPrefixLen sets field value +func (o *RegionalAreaIPv4) SetMaxPrefixLen(v RegionalAreaIPv4GetMaxPrefixLenRetType) { + setRegionalAreaIPv4GetMaxPrefixLenAttributeType(&o.MaxPrefixLen, v) +} + +// GetMinPrefixLen returns the MinPrefixLen field value +func (o *RegionalAreaIPv4) GetMinPrefixLen() (ret RegionalAreaIPv4GetMinPrefixLenRetType) { + ret, _ = o.GetMinPrefixLenOk() + return ret +} + +// GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetMinPrefixLenOk() (ret RegionalAreaIPv4GetMinPrefixLenRetType, ok bool) { + return getRegionalAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen) +} + +// SetMinPrefixLen sets field value +func (o *RegionalAreaIPv4) SetMinPrefixLen(v RegionalAreaIPv4GetMinPrefixLenRetType) { + setRegionalAreaIPv4GetMinPrefixLenAttributeType(&o.MinPrefixLen, v) +} + +// GetNetworkRanges returns the NetworkRanges field value +func (o *RegionalAreaIPv4) GetNetworkRanges() (ret RegionalAreaIPv4GetNetworkRangesRetType) { + ret, _ = o.GetNetworkRangesOk() + return ret +} + +// GetNetworkRangesOk returns a tuple with the NetworkRanges field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetNetworkRangesOk() (ret RegionalAreaIPv4GetNetworkRangesRetType, ok bool) { + return getRegionalAreaIPv4GetNetworkRangesAttributeTypeOk(o.NetworkRanges) +} + +// SetNetworkRanges sets field value +func (o *RegionalAreaIPv4) SetNetworkRanges(v RegionalAreaIPv4GetNetworkRangesRetType) { + setRegionalAreaIPv4GetNetworkRangesAttributeType(&o.NetworkRanges, v) +} + +// GetTransferNetwork returns the TransferNetwork field value +func (o *RegionalAreaIPv4) GetTransferNetwork() (ret RegionalAreaIPv4GetTransferNetworkRetType) { + ret, _ = o.GetTransferNetworkOk() + return ret +} + +// GetTransferNetworkOk returns a tuple with the TransferNetwork field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetTransferNetworkOk() (ret RegionalAreaIPv4GetTransferNetworkRetType, ok bool) { + return getRegionalAreaIPv4GetTransferNetworkAttributeTypeOk(o.TransferNetwork) +} + +// SetTransferNetwork sets field value +func (o *RegionalAreaIPv4) SetTransferNetwork(v RegionalAreaIPv4GetTransferNetworkRetType) { + setRegionalAreaIPv4GetTransferNetworkAttributeType(&o.TransferNetwork, v) +} + +func (o RegionalAreaIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { + toSerialize["DefaultNameservers"] = val + } + if val, ok := getRegionalAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen); ok { + toSerialize["DefaultPrefixLen"] = val + } + if val, ok := getRegionalAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen); ok { + toSerialize["MaxPrefixLen"] = val + } + if val, ok := getRegionalAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen); ok { + toSerialize["MinPrefixLen"] = val + } + if val, ok := getRegionalAreaIPv4GetNetworkRangesAttributeTypeOk(o.NetworkRanges); ok { + toSerialize["NetworkRanges"] = val + } + if val, ok := getRegionalAreaIPv4GetTransferNetworkAttributeTypeOk(o.TransferNetwork); ok { + toSerialize["TransferNetwork"] = val + } + return toSerialize, nil +} + +type NullableRegionalAreaIPv4 struct { + value *RegionalAreaIPv4 + isSet bool +} + +func (v NullableRegionalAreaIPv4) Get() *RegionalAreaIPv4 { + return v.value +} + +func (v *NullableRegionalAreaIPv4) Set(val *RegionalAreaIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableRegionalAreaIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableRegionalAreaIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegionalAreaIPv4(val *RegionalAreaIPv4) *NullableRegionalAreaIPv4 { + return &NullableRegionalAreaIPv4{value: val, isSet: true} +} + +func (v NullableRegionalAreaIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegionalAreaIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_regional_area_ipv4_test.go b/services/iaas/model_regional_area_ipv4_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_regional_area_ipv4_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_regional_area_list_response.go b/services/iaas/model_regional_area_list_response.go new file mode 100644 index 000000000..1c0121cea --- /dev/null +++ b/services/iaas/model_regional_area_list_response.go @@ -0,0 +1,125 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the RegionalAreaListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegionalAreaListResponse{} + +/* + types and functions for regions +*/ + +// isContainer +type RegionalAreaListResponseGetRegionsAttributeType = *map[string]RegionalArea +type RegionalAreaListResponseGetRegionsArgType = map[string]RegionalArea +type RegionalAreaListResponseGetRegionsRetType = map[string]RegionalArea + +func getRegionalAreaListResponseGetRegionsAttributeTypeOk(arg RegionalAreaListResponseGetRegionsAttributeType) (ret RegionalAreaListResponseGetRegionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRegionalAreaListResponseGetRegionsAttributeType(arg *RegionalAreaListResponseGetRegionsAttributeType, val RegionalAreaListResponseGetRegionsRetType) { + *arg = &val +} + +// RegionalAreaListResponse Regional area list response. +type RegionalAreaListResponse struct { + // REQUIRED + Regions RegionalAreaListResponseGetRegionsAttributeType `json:"regions" required:"true"` +} + +type _RegionalAreaListResponse RegionalAreaListResponse + +// NewRegionalAreaListResponse instantiates a new RegionalAreaListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegionalAreaListResponse(regions RegionalAreaListResponseGetRegionsArgType) *RegionalAreaListResponse { + this := RegionalAreaListResponse{} + setRegionalAreaListResponseGetRegionsAttributeType(&this.Regions, regions) + return &this +} + +// NewRegionalAreaListResponseWithDefaults instantiates a new RegionalAreaListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegionalAreaListResponseWithDefaults() *RegionalAreaListResponse { + this := RegionalAreaListResponse{} + return &this +} + +// GetRegions returns the Regions field value +func (o *RegionalAreaListResponse) GetRegions() (ret RegionalAreaListResponseGetRegionsRetType) { + ret, _ = o.GetRegionsOk() + return ret +} + +// GetRegionsOk returns a tuple with the Regions field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaListResponse) GetRegionsOk() (ret RegionalAreaListResponseGetRegionsRetType, ok bool) { + return getRegionalAreaListResponseGetRegionsAttributeTypeOk(o.Regions) +} + +// SetRegions sets field value +func (o *RegionalAreaListResponse) SetRegions(v RegionalAreaListResponseGetRegionsRetType) { + setRegionalAreaListResponseGetRegionsAttributeType(&o.Regions, v) +} + +func (o RegionalAreaListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getRegionalAreaListResponseGetRegionsAttributeTypeOk(o.Regions); ok { + toSerialize["Regions"] = val + } + return toSerialize, nil +} + +type NullableRegionalAreaListResponse struct { + value *RegionalAreaListResponse + isSet bool +} + +func (v NullableRegionalAreaListResponse) Get() *RegionalAreaListResponse { + return v.value +} + +func (v *NullableRegionalAreaListResponse) Set(val *RegionalAreaListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRegionalAreaListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRegionalAreaListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegionalAreaListResponse(val *RegionalAreaListResponse) *NullableRegionalAreaListResponse { + return &NullableRegionalAreaListResponse{value: val, isSet: true} +} + +func (v NullableRegionalAreaListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegionalAreaListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_regional_area_list_response_test.go b/services/iaas/model_regional_area_list_response_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_regional_area_list_response_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_regional_area_test.go b/services/iaas/model_regional_area_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_regional_area_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_request.go b/services/iaas/model_request.go index 50e4807cb..f3ef9c0e6 100644 --- a/services/iaas/model_request.go +++ b/services/iaas/model_request.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_request_resource.go b/services/iaas/model_request_resource.go index 63861c33b..585ce7933 100644 --- a/services/iaas/model_request_resource.go +++ b/services/iaas/model_request_resource.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_request_resource_test.go b/services/iaas/model_request_resource_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_request_resource_test.go +++ b/services/iaas/model_request_resource_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_request_test.go b/services/iaas/model_request_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_request_test.go +++ b/services/iaas/model_request_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_rescue_server_payload.go b/services/iaas/model_rescue_server_payload.go index ceb1d9298..973b22711 100644 --- a/services/iaas/model_rescue_server_payload.go +++ b/services/iaas/model_rescue_server_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_rescue_server_payload_test.go b/services/iaas/model_rescue_server_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_rescue_server_payload_test.go +++ b/services/iaas/model_rescue_server_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_resize_server_payload.go b/services/iaas/model_resize_server_payload.go index 706183868..de2742b35 100644 --- a/services/iaas/model_resize_server_payload.go +++ b/services/iaas/model_resize_server_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_resize_server_payload_test.go b/services/iaas/model_resize_server_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_resize_server_payload_test.go +++ b/services/iaas/model_resize_server_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_resize_volume_payload.go b/services/iaas/model_resize_volume_payload.go index 20dbe29e1..1e5e604ad 100644 --- a/services/iaas/model_resize_volume_payload.go +++ b/services/iaas/model_resize_volume_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_resize_volume_payload_test.go b/services/iaas/model_resize_volume_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_resize_volume_payload_test.go +++ b/services/iaas/model_resize_volume_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_route.go b/services/iaas/model_route.go index e25af0b95..76af10580 100644 --- a/services/iaas/model_route.go +++ b/services/iaas/model_route.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -39,88 +39,86 @@ func setRouteGetCreatedAtAttributeType(arg *RouteGetCreatedAtAttributeType, val } /* - types and functions for labels + types and functions for destination */ -// isFreeform -type RouteGetLabelsAttributeType = *map[string]interface{} -type RouteGetLabelsArgType = map[string]interface{} -type RouteGetLabelsRetType = map[string]interface{} +// isModel +type RouteGetDestinationAttributeType = *RouteDestination +type RouteGetDestinationArgType = RouteDestination +type RouteGetDestinationRetType = RouteDestination -func getRouteGetLabelsAttributeTypeOk(arg RouteGetLabelsAttributeType) (ret RouteGetLabelsRetType, ok bool) { +func getRouteGetDestinationAttributeTypeOk(arg RouteGetDestinationAttributeType) (ret RouteGetDestinationRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setRouteGetLabelsAttributeType(arg *RouteGetLabelsAttributeType, val RouteGetLabelsRetType) { +func setRouteGetDestinationAttributeType(arg *RouteGetDestinationAttributeType, val RouteGetDestinationRetType) { *arg = &val } /* - types and functions for nexthop + types and functions for id */ // isNotNullableString -type RouteGetNexthopAttributeType = *string +type RouteGetIdAttributeType = *string -func getRouteGetNexthopAttributeTypeOk(arg RouteGetNexthopAttributeType) (ret RouteGetNexthopRetType, ok bool) { +func getRouteGetIdAttributeTypeOk(arg RouteGetIdAttributeType) (ret RouteGetIdRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setRouteGetNexthopAttributeType(arg *RouteGetNexthopAttributeType, val RouteGetNexthopRetType) { +func setRouteGetIdAttributeType(arg *RouteGetIdAttributeType, val RouteGetIdRetType) { *arg = &val } -type RouteGetNexthopArgType = string -type RouteGetNexthopRetType = string +type RouteGetIdArgType = string +type RouteGetIdRetType = string /* - types and functions for prefix + types and functions for labels */ -// isNotNullableString -type RouteGetPrefixAttributeType = *string +// isFreeform +type RouteGetLabelsAttributeType = *map[string]interface{} +type RouteGetLabelsArgType = map[string]interface{} +type RouteGetLabelsRetType = map[string]interface{} -func getRouteGetPrefixAttributeTypeOk(arg RouteGetPrefixAttributeType) (ret RouteGetPrefixRetType, ok bool) { +func getRouteGetLabelsAttributeTypeOk(arg RouteGetLabelsAttributeType) (ret RouteGetLabelsRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setRouteGetPrefixAttributeType(arg *RouteGetPrefixAttributeType, val RouteGetPrefixRetType) { +func setRouteGetLabelsAttributeType(arg *RouteGetLabelsAttributeType, val RouteGetLabelsRetType) { *arg = &val } -type RouteGetPrefixArgType = string -type RouteGetPrefixRetType = string - /* - types and functions for routeId + types and functions for nexthop */ -// isNotNullableString -type RouteGetRouteIdAttributeType = *string +// isModel +type RouteGetNexthopAttributeType = *RouteNexthop +type RouteGetNexthopArgType = RouteNexthop +type RouteGetNexthopRetType = RouteNexthop -func getRouteGetRouteIdAttributeTypeOk(arg RouteGetRouteIdAttributeType) (ret RouteGetRouteIdRetType, ok bool) { +func getRouteGetNexthopAttributeTypeOk(arg RouteGetNexthopAttributeType) (ret RouteGetNexthopRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setRouteGetRouteIdAttributeType(arg *RouteGetRouteIdAttributeType, val RouteGetRouteIdRetType) { +func setRouteGetNexthopAttributeType(arg *RouteGetNexthopAttributeType, val RouteGetNexthopRetType) { *arg = &val } -type RouteGetRouteIdArgType = string -type RouteGetRouteIdRetType = string - /* types and functions for updatedAt */ @@ -145,16 +143,14 @@ func setRouteGetUpdatedAtAttributeType(arg *RouteGetUpdatedAtAttributeType, val type Route struct { // Date-time when resource was created. CreatedAt RouteGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // REQUIRED + Destination RouteGetDestinationAttributeType `json:"destination" required:"true"` + // Universally Unique Identifier (UUID). + Id RouteGetIdAttributeType `json:"id,omitempty"` // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Labels RouteGetLabelsAttributeType `json:"labels,omitempty"` - // Object that represents an IP address. // REQUIRED Nexthop RouteGetNexthopAttributeType `json:"nexthop" required:"true"` - // Classless Inter-Domain Routing (CIDR). - // REQUIRED - Prefix RouteGetPrefixAttributeType `json:"prefix" required:"true"` - // Universally Unique Identifier (UUID). - RouteId RouteGetRouteIdAttributeType `json:"routeId,omitempty"` // Date-time when resource was last updated. UpdatedAt RouteGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } @@ -165,10 +161,10 @@ type _Route Route // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRoute(nexthop RouteGetNexthopArgType, prefix RouteGetPrefixArgType) *Route { +func NewRoute(destination RouteGetDestinationArgType, nexthop RouteGetNexthopArgType) *Route { this := Route{} + setRouteGetDestinationAttributeType(&this.Destination, destination) setRouteGetNexthopAttributeType(&this.Nexthop, nexthop) - setRouteGetPrefixAttributeType(&this.Prefix, prefix) return &this } @@ -203,6 +199,46 @@ func (o *Route) SetCreatedAt(v RouteGetCreatedAtRetType) { setRouteGetCreatedAtAttributeType(&o.CreatedAt, v) } +// GetDestination returns the Destination field value +func (o *Route) GetDestination() (ret RouteGetDestinationRetType) { + ret, _ = o.GetDestinationOk() + return ret +} + +// GetDestinationOk returns a tuple with the Destination field value +// and a boolean to check if the value has been set. +func (o *Route) GetDestinationOk() (ret RouteGetDestinationRetType, ok bool) { + return getRouteGetDestinationAttributeTypeOk(o.Destination) +} + +// SetDestination sets field value +func (o *Route) SetDestination(v RouteGetDestinationRetType) { + setRouteGetDestinationAttributeType(&o.Destination, v) +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Route) GetId() (res RouteGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetIdOk() (ret RouteGetIdRetType, ok bool) { + return getRouteGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *Route) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Route) SetId(v RouteGetIdRetType) { + setRouteGetIdAttributeType(&o.Id, v) +} + // GetLabels returns the Labels field value if set, zero value otherwise. func (o *Route) GetLabels() (res RouteGetLabelsRetType) { res, _ = o.GetLabelsOk() @@ -243,46 +279,6 @@ func (o *Route) SetNexthop(v RouteGetNexthopRetType) { setRouteGetNexthopAttributeType(&o.Nexthop, v) } -// GetPrefix returns the Prefix field value -func (o *Route) GetPrefix() (ret RouteGetPrefixRetType) { - ret, _ = o.GetPrefixOk() - return ret -} - -// GetPrefixOk returns a tuple with the Prefix field value -// and a boolean to check if the value has been set. -func (o *Route) GetPrefixOk() (ret RouteGetPrefixRetType, ok bool) { - return getRouteGetPrefixAttributeTypeOk(o.Prefix) -} - -// SetPrefix sets field value -func (o *Route) SetPrefix(v RouteGetPrefixRetType) { - setRouteGetPrefixAttributeType(&o.Prefix, v) -} - -// GetRouteId returns the RouteId field value if set, zero value otherwise. -func (o *Route) GetRouteId() (res RouteGetRouteIdRetType) { - res, _ = o.GetRouteIdOk() - return -} - -// GetRouteIdOk returns a tuple with the RouteId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Route) GetRouteIdOk() (ret RouteGetRouteIdRetType, ok bool) { - return getRouteGetRouteIdAttributeTypeOk(o.RouteId) -} - -// HasRouteId returns a boolean if a field has been set. -func (o *Route) HasRouteId() bool { - _, ok := o.GetRouteIdOk() - return ok -} - -// SetRouteId gets a reference to the given string and assigns it to the RouteId field. -func (o *Route) SetRouteId(v RouteGetRouteIdRetType) { - setRouteGetRouteIdAttributeType(&o.RouteId, v) -} - // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *Route) GetUpdatedAt() (res RouteGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() @@ -311,18 +307,18 @@ func (o Route) ToMap() (map[string]interface{}, error) { if val, ok := getRouteGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { toSerialize["CreatedAt"] = val } + if val, ok := getRouteGetDestinationAttributeTypeOk(o.Destination); ok { + toSerialize["Destination"] = val + } + if val, ok := getRouteGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } if val, ok := getRouteGetLabelsAttributeTypeOk(o.Labels); ok { toSerialize["Labels"] = val } if val, ok := getRouteGetNexthopAttributeTypeOk(o.Nexthop); ok { toSerialize["Nexthop"] = val } - if val, ok := getRouteGetPrefixAttributeTypeOk(o.Prefix); ok { - toSerialize["Prefix"] = val - } - if val, ok := getRouteGetRouteIdAttributeTypeOk(o.RouteId); ok { - toSerialize["RouteId"] = val - } if val, ok := getRouteGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { toSerialize["UpdatedAt"] = val } diff --git a/services/iaas/model_route_destination.go b/services/iaas/model_route_destination.go new file mode 100644 index 000000000..2411d3a33 --- /dev/null +++ b/services/iaas/model_route_destination.go @@ -0,0 +1,163 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" + "fmt" +) + +// RouteDestination - struct for RouteDestination +type RouteDestination struct { + DestinationCIDRv4 *DestinationCIDRv4 + DestinationCIDRv6 *DestinationCIDRv6 +} + +// DestinationCIDRv4AsRouteDestination is a convenience function that returns DestinationCIDRv4 wrapped in RouteDestination +func DestinationCIDRv4AsRouteDestination(v *DestinationCIDRv4) RouteDestination { + return RouteDestination{ + DestinationCIDRv4: v, + } +} + +// DestinationCIDRv6AsRouteDestination is a convenience function that returns DestinationCIDRv6 wrapped in RouteDestination +func DestinationCIDRv6AsRouteDestination(v *DestinationCIDRv6) RouteDestination { + return RouteDestination{ + DestinationCIDRv6: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RouteDestination) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'DestinationCIDRv4' + if jsonDict["type"] == "DestinationCIDRv4" { + // try to unmarshal JSON data into DestinationCIDRv4 + err = json.Unmarshal(data, &dst.DestinationCIDRv4) + if err == nil { + return nil // data stored in dst.DestinationCIDRv4, return on the first match + } else { + dst.DestinationCIDRv4 = nil + return fmt.Errorf("failed to unmarshal RouteDestination as DestinationCIDRv4: %s", err.Error()) + } + } + + // check if the discriminator value is 'DestinationCIDRv6' + if jsonDict["type"] == "DestinationCIDRv6" { + // try to unmarshal JSON data into DestinationCIDRv6 + err = json.Unmarshal(data, &dst.DestinationCIDRv6) + if err == nil { + return nil // data stored in dst.DestinationCIDRv6, return on the first match + } else { + dst.DestinationCIDRv6 = nil + return fmt.Errorf("failed to unmarshal RouteDestination as DestinationCIDRv6: %s", err.Error()) + } + } + + // check if the discriminator value is 'cidrv4' + if jsonDict["type"] == "cidrv4" { + // try to unmarshal JSON data into DestinationCIDRv4 + err = json.Unmarshal(data, &dst.DestinationCIDRv4) + if err == nil { + return nil // data stored in dst.DestinationCIDRv4, return on the first match + } else { + dst.DestinationCIDRv4 = nil + return fmt.Errorf("failed to unmarshal RouteDestination as DestinationCIDRv4: %s", err.Error()) + } + } + + // check if the discriminator value is 'cidrv6' + if jsonDict["type"] == "cidrv6" { + // try to unmarshal JSON data into DestinationCIDRv6 + err = json.Unmarshal(data, &dst.DestinationCIDRv6) + if err == nil { + return nil // data stored in dst.DestinationCIDRv6, return on the first match + } else { + dst.DestinationCIDRv6 = nil + return fmt.Errorf("failed to unmarshal RouteDestination as DestinationCIDRv6: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RouteDestination) MarshalJSON() ([]byte, error) { + if src.DestinationCIDRv4 != nil { + return json.Marshal(&src.DestinationCIDRv4) + } + + if src.DestinationCIDRv6 != nil { + return json.Marshal(&src.DestinationCIDRv6) + } + + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object +} + +// Get the actual instance +func (obj *RouteDestination) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.DestinationCIDRv4 != nil { + return obj.DestinationCIDRv4 + } + + if obj.DestinationCIDRv6 != nil { + return obj.DestinationCIDRv6 + } + + // all schemas are nil + return nil +} + +type NullableRouteDestination struct { + value *RouteDestination + isSet bool +} + +func (v NullableRouteDestination) Get() *RouteDestination { + return v.value +} + +func (v *NullableRouteDestination) Set(val *RouteDestination) { + v.value = val + v.isSet = true +} + +func (v NullableRouteDestination) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteDestination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteDestination(val *RouteDestination) *NullableRouteDestination { + return &NullableRouteDestination{value: val, isSet: true} +} + +func (v NullableRouteDestination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteDestination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_route_destination_test.go b/services/iaas/model_route_destination_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_route_destination_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_route_list_response.go b/services/iaas/model_route_list_response.go index 72d2c7abd..abcafabc3 100644 --- a/services/iaas/model_route_list_response.go +++ b/services/iaas/model_route_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_route_list_response_test.go b/services/iaas/model_route_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_route_list_response_test.go +++ b/services/iaas/model_route_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_route_nexthop.go b/services/iaas/model_route_nexthop.go new file mode 100644 index 000000000..9eaab5df5 --- /dev/null +++ b/services/iaas/model_route_nexthop.go @@ -0,0 +1,243 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" + "fmt" +) + +// RouteNexthop - struct for RouteNexthop +type RouteNexthop struct { + NexthopBlackhole *NexthopBlackhole + NexthopIPv4 *NexthopIPv4 + NexthopIPv6 *NexthopIPv6 + NexthopInternet *NexthopInternet +} + +// NexthopBlackholeAsRouteNexthop is a convenience function that returns NexthopBlackhole wrapped in RouteNexthop +func NexthopBlackholeAsRouteNexthop(v *NexthopBlackhole) RouteNexthop { + return RouteNexthop{ + NexthopBlackhole: v, + } +} + +// NexthopIPv4AsRouteNexthop is a convenience function that returns NexthopIPv4 wrapped in RouteNexthop +func NexthopIPv4AsRouteNexthop(v *NexthopIPv4) RouteNexthop { + return RouteNexthop{ + NexthopIPv4: v, + } +} + +// NexthopIPv6AsRouteNexthop is a convenience function that returns NexthopIPv6 wrapped in RouteNexthop +func NexthopIPv6AsRouteNexthop(v *NexthopIPv6) RouteNexthop { + return RouteNexthop{ + NexthopIPv6: v, + } +} + +// NexthopInternetAsRouteNexthop is a convenience function that returns NexthopInternet wrapped in RouteNexthop +func NexthopInternetAsRouteNexthop(v *NexthopInternet) RouteNexthop { + return RouteNexthop{ + NexthopInternet: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RouteNexthop) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'NexthopBlackhole' + if jsonDict["type"] == "NexthopBlackhole" { + // try to unmarshal JSON data into NexthopBlackhole + err = json.Unmarshal(data, &dst.NexthopBlackhole) + if err == nil { + return nil // data stored in dst.NexthopBlackhole, return on the first match + } else { + dst.NexthopBlackhole = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopBlackhole: %s", err.Error()) + } + } + + // check if the discriminator value is 'NexthopIPv4' + if jsonDict["type"] == "NexthopIPv4" { + // try to unmarshal JSON data into NexthopIPv4 + err = json.Unmarshal(data, &dst.NexthopIPv4) + if err == nil { + return nil // data stored in dst.NexthopIPv4, return on the first match + } else { + dst.NexthopIPv4 = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopIPv4: %s", err.Error()) + } + } + + // check if the discriminator value is 'NexthopIPv6' + if jsonDict["type"] == "NexthopIPv6" { + // try to unmarshal JSON data into NexthopIPv6 + err = json.Unmarshal(data, &dst.NexthopIPv6) + if err == nil { + return nil // data stored in dst.NexthopIPv6, return on the first match + } else { + dst.NexthopIPv6 = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopIPv6: %s", err.Error()) + } + } + + // check if the discriminator value is 'NexthopInternet' + if jsonDict["type"] == "NexthopInternet" { + // try to unmarshal JSON data into NexthopInternet + err = json.Unmarshal(data, &dst.NexthopInternet) + if err == nil { + return nil // data stored in dst.NexthopInternet, return on the first match + } else { + dst.NexthopInternet = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopInternet: %s", err.Error()) + } + } + + // check if the discriminator value is 'blackhole' + if jsonDict["type"] == "blackhole" { + // try to unmarshal JSON data into NexthopBlackhole + err = json.Unmarshal(data, &dst.NexthopBlackhole) + if err == nil { + return nil // data stored in dst.NexthopBlackhole, return on the first match + } else { + dst.NexthopBlackhole = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopBlackhole: %s", err.Error()) + } + } + + // check if the discriminator value is 'internet' + if jsonDict["type"] == "internet" { + // try to unmarshal JSON data into NexthopInternet + err = json.Unmarshal(data, &dst.NexthopInternet) + if err == nil { + return nil // data stored in dst.NexthopInternet, return on the first match + } else { + dst.NexthopInternet = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopInternet: %s", err.Error()) + } + } + + // check if the discriminator value is 'ipv4' + if jsonDict["type"] == "ipv4" { + // try to unmarshal JSON data into NexthopIPv4 + err = json.Unmarshal(data, &dst.NexthopIPv4) + if err == nil { + return nil // data stored in dst.NexthopIPv4, return on the first match + } else { + dst.NexthopIPv4 = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopIPv4: %s", err.Error()) + } + } + + // check if the discriminator value is 'ipv6' + if jsonDict["type"] == "ipv6" { + // try to unmarshal JSON data into NexthopIPv6 + err = json.Unmarshal(data, &dst.NexthopIPv6) + if err == nil { + return nil // data stored in dst.NexthopIPv6, return on the first match + } else { + dst.NexthopIPv6 = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopIPv6: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RouteNexthop) MarshalJSON() ([]byte, error) { + if src.NexthopBlackhole != nil { + return json.Marshal(&src.NexthopBlackhole) + } + + if src.NexthopIPv4 != nil { + return json.Marshal(&src.NexthopIPv4) + } + + if src.NexthopIPv6 != nil { + return json.Marshal(&src.NexthopIPv6) + } + + if src.NexthopInternet != nil { + return json.Marshal(&src.NexthopInternet) + } + + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object +} + +// Get the actual instance +func (obj *RouteNexthop) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.NexthopBlackhole != nil { + return obj.NexthopBlackhole + } + + if obj.NexthopIPv4 != nil { + return obj.NexthopIPv4 + } + + if obj.NexthopIPv6 != nil { + return obj.NexthopIPv6 + } + + if obj.NexthopInternet != nil { + return obj.NexthopInternet + } + + // all schemas are nil + return nil +} + +type NullableRouteNexthop struct { + value *RouteNexthop + isSet bool +} + +func (v NullableRouteNexthop) Get() *RouteNexthop { + return v.value +} + +func (v *NullableRouteNexthop) Set(val *RouteNexthop) { + v.value = val + v.isSet = true +} + +func (v NullableRouteNexthop) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteNexthop) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteNexthop(val *RouteNexthop) *NullableRouteNexthop { + return &NullableRouteNexthop{value: val, isSet: true} +} + +func (v NullableRouteNexthop) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteNexthop) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_route_nexthop_test.go b/services/iaas/model_route_nexthop_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_route_nexthop_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_route_test.go b/services/iaas/model_route_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_route_test.go +++ b/services/iaas/model_route_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_routing_table.go b/services/iaas/model_routing_table.go new file mode 100644 index 000000000..db4983a01 --- /dev/null +++ b/services/iaas/model_routing_table.go @@ -0,0 +1,517 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" + "time" +) + +// checks if the RoutingTable type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoutingTable{} + +/* + types and functions for createdAt +*/ + +// isDateTime +type RoutingTableGetCreatedAtAttributeType = *time.Time +type RoutingTableGetCreatedAtArgType = time.Time +type RoutingTableGetCreatedAtRetType = time.Time + +func getRoutingTableGetCreatedAtAttributeTypeOk(arg RoutingTableGetCreatedAtAttributeType) (ret RoutingTableGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRoutingTableGetCreatedAtAttributeType(arg *RoutingTableGetCreatedAtAttributeType, val RoutingTableGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for default +*/ + +// isBoolean +type RoutingTablegetDefaultAttributeType = *bool +type RoutingTablegetDefaultArgType = bool +type RoutingTablegetDefaultRetType = bool + +func getRoutingTablegetDefaultAttributeTypeOk(arg RoutingTablegetDefaultAttributeType) (ret RoutingTablegetDefaultRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRoutingTablegetDefaultAttributeType(arg *RoutingTablegetDefaultAttributeType, val RoutingTablegetDefaultRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type RoutingTableGetDescriptionAttributeType = *string + +func getRoutingTableGetDescriptionAttributeTypeOk(arg RoutingTableGetDescriptionAttributeType) (ret RoutingTableGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRoutingTableGetDescriptionAttributeType(arg *RoutingTableGetDescriptionAttributeType, val RoutingTableGetDescriptionRetType) { + *arg = &val +} + +type RoutingTableGetDescriptionArgType = string +type RoutingTableGetDescriptionRetType = string + +/* + types and functions for dynamicRoutes +*/ + +// isBoolean +type RoutingTablegetDynamicRoutesAttributeType = *bool +type RoutingTablegetDynamicRoutesArgType = bool +type RoutingTablegetDynamicRoutesRetType = bool + +func getRoutingTablegetDynamicRoutesAttributeTypeOk(arg RoutingTablegetDynamicRoutesAttributeType) (ret RoutingTablegetDynamicRoutesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRoutingTablegetDynamicRoutesAttributeType(arg *RoutingTablegetDynamicRoutesAttributeType, val RoutingTablegetDynamicRoutesRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type RoutingTableGetIdAttributeType = *string + +func getRoutingTableGetIdAttributeTypeOk(arg RoutingTableGetIdAttributeType) (ret RoutingTableGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRoutingTableGetIdAttributeType(arg *RoutingTableGetIdAttributeType, val RoutingTableGetIdRetType) { + *arg = &val +} + +type RoutingTableGetIdArgType = string +type RoutingTableGetIdRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type RoutingTableGetLabelsAttributeType = *map[string]interface{} +type RoutingTableGetLabelsArgType = map[string]interface{} +type RoutingTableGetLabelsRetType = map[string]interface{} + +func getRoutingTableGetLabelsAttributeTypeOk(arg RoutingTableGetLabelsAttributeType) (ret RoutingTableGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRoutingTableGetLabelsAttributeType(arg *RoutingTableGetLabelsAttributeType, val RoutingTableGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type RoutingTableGetNameAttributeType = *string + +func getRoutingTableGetNameAttributeTypeOk(arg RoutingTableGetNameAttributeType) (ret RoutingTableGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRoutingTableGetNameAttributeType(arg *RoutingTableGetNameAttributeType, val RoutingTableGetNameRetType) { + *arg = &val +} + +type RoutingTableGetNameArgType = string +type RoutingTableGetNameRetType = string + +/* + types and functions for systemRoutes +*/ + +// isBoolean +type RoutingTablegetSystemRoutesAttributeType = *bool +type RoutingTablegetSystemRoutesArgType = bool +type RoutingTablegetSystemRoutesRetType = bool + +func getRoutingTablegetSystemRoutesAttributeTypeOk(arg RoutingTablegetSystemRoutesAttributeType) (ret RoutingTablegetSystemRoutesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRoutingTablegetSystemRoutesAttributeType(arg *RoutingTablegetSystemRoutesAttributeType, val RoutingTablegetSystemRoutesRetType) { + *arg = &val +} + +/* + types and functions for updatedAt +*/ + +// isDateTime +type RoutingTableGetUpdatedAtAttributeType = *time.Time +type RoutingTableGetUpdatedAtArgType = time.Time +type RoutingTableGetUpdatedAtRetType = time.Time + +func getRoutingTableGetUpdatedAtAttributeTypeOk(arg RoutingTableGetUpdatedAtAttributeType) (ret RoutingTableGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRoutingTableGetUpdatedAtAttributeType(arg *RoutingTableGetUpdatedAtAttributeType, val RoutingTableGetUpdatedAtRetType) { + *arg = &val +} + +// RoutingTable An object representing a routing table. +type RoutingTable struct { + // Date-time when resource was created. + CreatedAt RoutingTableGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // This is the default routing table. It can't be deleted and is used if the user does not specify it otherwise. + Default RoutingTablegetDefaultAttributeType `json:"default,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description RoutingTableGetDescriptionAttributeType `json:"description,omitempty"` + // A config setting for a routing table which allows propagation of dynamic routes to this routing table. + DynamicRoutes RoutingTablegetDynamicRoutesAttributeType `json:"dynamicRoutes,omitempty"` + // Universally Unique Identifier (UUID). + Id RoutingTableGetIdAttributeType `json:"id,omitempty"` + // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. + Labels RoutingTableGetLabelsAttributeType `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + // REQUIRED + Name RoutingTableGetNameAttributeType `json:"name" required:"true"` + SystemRoutes RoutingTablegetSystemRoutesAttributeType `json:"systemRoutes,omitempty"` + // Date-time when resource was last updated. + UpdatedAt RoutingTableGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` +} + +type _RoutingTable RoutingTable + +// NewRoutingTable instantiates a new RoutingTable object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoutingTable(name RoutingTableGetNameArgType) *RoutingTable { + this := RoutingTable{} + setRoutingTableGetNameAttributeType(&this.Name, name) + return &this +} + +// NewRoutingTableWithDefaults instantiates a new RoutingTable object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoutingTableWithDefaults() *RoutingTable { + this := RoutingTable{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *RoutingTable) GetCreatedAt() (res RoutingTableGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetCreatedAtOk() (ret RoutingTableGetCreatedAtRetType, ok bool) { + return getRoutingTableGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *RoutingTable) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *RoutingTable) SetCreatedAt(v RoutingTableGetCreatedAtRetType) { + setRoutingTableGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *RoutingTable) GetDefault() (res RoutingTablegetDefaultRetType) { + res, _ = o.GetDefaultOk() + return +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetDefaultOk() (ret RoutingTablegetDefaultRetType, ok bool) { + return getRoutingTablegetDefaultAttributeTypeOk(o.Default) +} + +// HasDefault returns a boolean if a field has been set. +func (o *RoutingTable) HasDefault() bool { + _, ok := o.GetDefaultOk() + return ok +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *RoutingTable) SetDefault(v RoutingTablegetDefaultRetType) { + setRoutingTablegetDefaultAttributeType(&o.Default, v) +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RoutingTable) GetDescription() (res RoutingTableGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetDescriptionOk() (ret RoutingTableGetDescriptionRetType, ok bool) { + return getRoutingTableGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *RoutingTable) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RoutingTable) SetDescription(v RoutingTableGetDescriptionRetType) { + setRoutingTableGetDescriptionAttributeType(&o.Description, v) +} + +// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +func (o *RoutingTable) GetDynamicRoutes() (res RoutingTablegetDynamicRoutesRetType) { + res, _ = o.GetDynamicRoutesOk() + return +} + +// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetDynamicRoutesOk() (ret RoutingTablegetDynamicRoutesRetType, ok bool) { + return getRoutingTablegetDynamicRoutesAttributeTypeOk(o.DynamicRoutes) +} + +// HasDynamicRoutes returns a boolean if a field has been set. +func (o *RoutingTable) HasDynamicRoutes() bool { + _, ok := o.GetDynamicRoutesOk() + return ok +} + +// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +func (o *RoutingTable) SetDynamicRoutes(v RoutingTablegetDynamicRoutesRetType) { + setRoutingTablegetDynamicRoutesAttributeType(&o.DynamicRoutes, v) +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *RoutingTable) GetId() (res RoutingTableGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetIdOk() (ret RoutingTableGetIdRetType, ok bool) { + return getRoutingTableGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *RoutingTable) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *RoutingTable) SetId(v RoutingTableGetIdRetType) { + setRoutingTableGetIdAttributeType(&o.Id, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *RoutingTable) GetLabels() (res RoutingTableGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetLabelsOk() (ret RoutingTableGetLabelsRetType, ok bool) { + return getRoutingTableGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *RoutingTable) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *RoutingTable) SetLabels(v RoutingTableGetLabelsRetType) { + setRoutingTableGetLabelsAttributeType(&o.Labels, v) +} + +// GetName returns the Name field value +func (o *RoutingTable) GetName() (ret RoutingTableGetNameRetType) { + ret, _ = o.GetNameOk() + return ret +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetNameOk() (ret RoutingTableGetNameRetType, ok bool) { + return getRoutingTableGetNameAttributeTypeOk(o.Name) +} + +// SetName sets field value +func (o *RoutingTable) SetName(v RoutingTableGetNameRetType) { + setRoutingTableGetNameAttributeType(&o.Name, v) +} + +// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +func (o *RoutingTable) GetSystemRoutes() (res RoutingTablegetSystemRoutesRetType) { + res, _ = o.GetSystemRoutesOk() + return +} + +// GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetSystemRoutesOk() (ret RoutingTablegetSystemRoutesRetType, ok bool) { + return getRoutingTablegetSystemRoutesAttributeTypeOk(o.SystemRoutes) +} + +// HasSystemRoutes returns a boolean if a field has been set. +func (o *RoutingTable) HasSystemRoutes() bool { + _, ok := o.GetSystemRoutesOk() + return ok +} + +// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +func (o *RoutingTable) SetSystemRoutes(v RoutingTablegetSystemRoutesRetType) { + setRoutingTablegetSystemRoutesAttributeType(&o.SystemRoutes, v) +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *RoutingTable) GetUpdatedAt() (res RoutingTableGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetUpdatedAtOk() (ret RoutingTableGetUpdatedAtRetType, ok bool) { + return getRoutingTableGetUpdatedAtAttributeTypeOk(o.UpdatedAt) +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *RoutingTable) HasUpdatedAt() bool { + _, ok := o.GetUpdatedAtOk() + return ok +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *RoutingTable) SetUpdatedAt(v RoutingTableGetUpdatedAtRetType) { + setRoutingTableGetUpdatedAtAttributeType(&o.UpdatedAt, v) +} + +func (o RoutingTable) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getRoutingTableGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getRoutingTablegetDefaultAttributeTypeOk(o.Default); ok { + toSerialize["Default"] = val + } + if val, ok := getRoutingTableGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getRoutingTablegetDynamicRoutesAttributeTypeOk(o.DynamicRoutes); ok { + toSerialize["DynamicRoutes"] = val + } + if val, ok := getRoutingTableGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getRoutingTableGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getRoutingTableGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getRoutingTablegetSystemRoutesAttributeTypeOk(o.SystemRoutes); ok { + toSerialize["SystemRoutes"] = val + } + if val, ok := getRoutingTableGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val + } + return toSerialize, nil +} + +type NullableRoutingTable struct { + value *RoutingTable + isSet bool +} + +func (v NullableRoutingTable) Get() *RoutingTable { + return v.value +} + +func (v *NullableRoutingTable) Set(val *RoutingTable) { + v.value = val + v.isSet = true +} + +func (v NullableRoutingTable) IsSet() bool { + return v.isSet +} + +func (v *NullableRoutingTable) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoutingTable(val *RoutingTable) *NullableRoutingTable { + return &NullableRoutingTable{value: val, isSet: true} +} + +func (v NullableRoutingTable) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoutingTable) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_routing_table_list_response.go b/services/iaas/model_routing_table_list_response.go new file mode 100644 index 000000000..802c8b8c0 --- /dev/null +++ b/services/iaas/model_routing_table_list_response.go @@ -0,0 +1,126 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the RoutingTableListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoutingTableListResponse{} + +/* + types and functions for items +*/ + +// isArray +type RoutingTableListResponseGetItemsAttributeType = *[]RoutingTable +type RoutingTableListResponseGetItemsArgType = []RoutingTable +type RoutingTableListResponseGetItemsRetType = []RoutingTable + +func getRoutingTableListResponseGetItemsAttributeTypeOk(arg RoutingTableListResponseGetItemsAttributeType) (ret RoutingTableListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRoutingTableListResponseGetItemsAttributeType(arg *RoutingTableListResponseGetItemsAttributeType, val RoutingTableListResponseGetItemsRetType) { + *arg = &val +} + +// RoutingTableListResponse Routing table response. +type RoutingTableListResponse struct { + // A list of routing tables. + // REQUIRED + Items RoutingTableListResponseGetItemsAttributeType `json:"items" required:"true"` +} + +type _RoutingTableListResponse RoutingTableListResponse + +// NewRoutingTableListResponse instantiates a new RoutingTableListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoutingTableListResponse(items RoutingTableListResponseGetItemsArgType) *RoutingTableListResponse { + this := RoutingTableListResponse{} + setRoutingTableListResponseGetItemsAttributeType(&this.Items, items) + return &this +} + +// NewRoutingTableListResponseWithDefaults instantiates a new RoutingTableListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoutingTableListResponseWithDefaults() *RoutingTableListResponse { + this := RoutingTableListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *RoutingTableListResponse) GetItems() (ret RoutingTableListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *RoutingTableListResponse) GetItemsOk() (ret RoutingTableListResponseGetItemsRetType, ok bool) { + return getRoutingTableListResponseGetItemsAttributeTypeOk(o.Items) +} + +// SetItems sets field value +func (o *RoutingTableListResponse) SetItems(v RoutingTableListResponseGetItemsRetType) { + setRoutingTableListResponseGetItemsAttributeType(&o.Items, v) +} + +func (o RoutingTableListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getRoutingTableListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } + return toSerialize, nil +} + +type NullableRoutingTableListResponse struct { + value *RoutingTableListResponse + isSet bool +} + +func (v NullableRoutingTableListResponse) Get() *RoutingTableListResponse { + return v.value +} + +func (v *NullableRoutingTableListResponse) Set(val *RoutingTableListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRoutingTableListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRoutingTableListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoutingTableListResponse(val *RoutingTableListResponse) *NullableRoutingTableListResponse { + return &NullableRoutingTableListResponse{value: val, isSet: true} +} + +func (v NullableRoutingTableListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoutingTableListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_routing_table_list_response_test.go b/services/iaas/model_routing_table_list_response_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_routing_table_list_response_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_routing_table_test.go b/services/iaas/model_routing_table_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_routing_table_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_security_group.go b/services/iaas/model_security_group.go index f7800cf34..62fe69b8b 100644 --- a/services/iaas/model_security_group.go +++ b/services/iaas/model_security_group.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_security_group_list_response.go b/services/iaas/model_security_group_list_response.go index 81e62180e..b7875d576 100644 --- a/services/iaas/model_security_group_list_response.go +++ b/services/iaas/model_security_group_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_security_group_list_response_test.go b/services/iaas/model_security_group_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_security_group_list_response_test.go +++ b/services/iaas/model_security_group_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_security_group_rule.go b/services/iaas/model_security_group_rule.go index 54d98eaa3..ac143ec47 100644 --- a/services/iaas/model_security_group_rule.go +++ b/services/iaas/model_security_group_rule.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_security_group_rule_list_response.go b/services/iaas/model_security_group_rule_list_response.go index c3481488b..b8647242c 100644 --- a/services/iaas/model_security_group_rule_list_response.go +++ b/services/iaas/model_security_group_rule_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_security_group_rule_list_response_test.go b/services/iaas/model_security_group_rule_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_security_group_rule_list_response_test.go +++ b/services/iaas/model_security_group_rule_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_security_group_rule_protocol.go b/services/iaas/model_security_group_rule_protocol.go index 585ef2dc4..f2d88d02f 100644 --- a/services/iaas/model_security_group_rule_protocol.go +++ b/services/iaas/model_security_group_rule_protocol.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_security_group_rule_protocol_test.go b/services/iaas/model_security_group_rule_protocol_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_security_group_rule_protocol_test.go +++ b/services/iaas/model_security_group_rule_protocol_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_security_group_rule_test.go b/services/iaas/model_security_group_rule_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_security_group_rule_test.go +++ b/services/iaas/model_security_group_rule_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_security_group_test.go b/services/iaas/model_security_group_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_security_group_test.go +++ b/services/iaas/model_security_group_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_server.go b/services/iaas/model_server.go index 76e22cb33..2fe94bf4f 100644 --- a/services/iaas/model_server.go +++ b/services/iaas/model_server.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -85,9 +85,9 @@ type ServerGetAvailabilityZoneRetType = string */ // isModel -type ServerGetBootVolumeAttributeType = *CreateServerPayloadBootVolume -type ServerGetBootVolumeArgType = CreateServerPayloadBootVolume -type ServerGetBootVolumeRetType = CreateServerPayloadBootVolume +type ServerGetBootVolumeAttributeType = *ServerBootVolume +type ServerGetBootVolumeArgType = ServerBootVolume +type ServerGetBootVolumeRetType = ServerBootVolume func getServerGetBootVolumeAttributeTypeOk(arg ServerGetBootVolumeAttributeType) (ret ServerGetBootVolumeRetType, ok bool) { if arg == nil { @@ -331,9 +331,9 @@ type ServerGetNameRetType = string */ // isModel -type ServerGetNetworkingAttributeType = *CreateServerPayloadNetworking -type ServerGetNetworkingArgType = CreateServerPayloadNetworking -type ServerGetNetworkingRetType = CreateServerPayloadNetworking +type ServerGetNetworkingAttributeType = *ServerNetworking +type ServerGetNetworkingArgType = ServerNetworking +type ServerGetNetworkingRetType = ServerNetworking func getServerGetNetworkingAttributeTypeOk(arg ServerGetNetworkingAttributeType) (ret ServerGetNetworkingRetType, ok bool) { if arg == nil { @@ -666,7 +666,7 @@ func (o *Server) HasBootVolume() bool { return ok } -// SetBootVolume gets a reference to the given CreateServerPayloadBootVolume and assigns it to the BootVolume field. +// SetBootVolume gets a reference to the given ServerBootVolume and assigns it to the BootVolume field. func (o *Server) SetBootVolume(v ServerGetBootVolumeRetType) { setServerGetBootVolumeAttributeType(&o.BootVolume, v) } @@ -930,7 +930,7 @@ func (o *Server) HasNetworking() bool { return ok } -// SetNetworking gets a reference to the given CreateServerPayloadNetworking and assigns it to the Networking field. +// SetNetworking gets a reference to the given ServerNetworking and assigns it to the Networking field. func (o *Server) SetNetworking(v ServerGetNetworkingRetType) { setServerGetNetworkingAttributeType(&o.Networking, v) } diff --git a/services/iaas/model_server_agent.go b/services/iaas/model_server_agent.go index 6503dfaaf..163ed849a 100644 --- a/services/iaas/model_server_agent.go +++ b/services/iaas/model_server_agent.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_server_agent_test.go b/services/iaas/model_server_agent_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_server_agent_test.go +++ b/services/iaas/model_server_agent_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_server_boot_volume.go b/services/iaas/model_server_boot_volume.go new file mode 100644 index 000000000..138cfbfcc --- /dev/null +++ b/services/iaas/model_server_boot_volume.go @@ -0,0 +1,321 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the ServerBootVolume type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerBootVolume{} + +/* + types and functions for deleteOnTermination +*/ + +// isBoolean +type ServerBootVolumegetDeleteOnTerminationAttributeType = *bool +type ServerBootVolumegetDeleteOnTerminationArgType = bool +type ServerBootVolumegetDeleteOnTerminationRetType = bool + +func getServerBootVolumegetDeleteOnTerminationAttributeTypeOk(arg ServerBootVolumegetDeleteOnTerminationAttributeType) (ret ServerBootVolumegetDeleteOnTerminationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerBootVolumegetDeleteOnTerminationAttributeType(arg *ServerBootVolumegetDeleteOnTerminationAttributeType, val ServerBootVolumegetDeleteOnTerminationRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type ServerBootVolumeGetIdAttributeType = *string + +func getServerBootVolumeGetIdAttributeTypeOk(arg ServerBootVolumeGetIdAttributeType) (ret ServerBootVolumeGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerBootVolumeGetIdAttributeType(arg *ServerBootVolumeGetIdAttributeType, val ServerBootVolumeGetIdRetType) { + *arg = &val +} + +type ServerBootVolumeGetIdArgType = string +type ServerBootVolumeGetIdRetType = string + +/* + types and functions for performanceClass +*/ + +// isNotNullableString +type ServerBootVolumeGetPerformanceClassAttributeType = *string + +func getServerBootVolumeGetPerformanceClassAttributeTypeOk(arg ServerBootVolumeGetPerformanceClassAttributeType) (ret ServerBootVolumeGetPerformanceClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerBootVolumeGetPerformanceClassAttributeType(arg *ServerBootVolumeGetPerformanceClassAttributeType, val ServerBootVolumeGetPerformanceClassRetType) { + *arg = &val +} + +type ServerBootVolumeGetPerformanceClassArgType = string +type ServerBootVolumeGetPerformanceClassRetType = string + +/* + types and functions for size +*/ + +// isLong +type ServerBootVolumeGetSizeAttributeType = *int64 +type ServerBootVolumeGetSizeArgType = int64 +type ServerBootVolumeGetSizeRetType = int64 + +func getServerBootVolumeGetSizeAttributeTypeOk(arg ServerBootVolumeGetSizeAttributeType) (ret ServerBootVolumeGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerBootVolumeGetSizeAttributeType(arg *ServerBootVolumeGetSizeAttributeType, val ServerBootVolumeGetSizeRetType) { + *arg = &val +} + +/* + types and functions for source +*/ + +// isModel +type ServerBootVolumeGetSourceAttributeType = *BootVolumeSource +type ServerBootVolumeGetSourceArgType = BootVolumeSource +type ServerBootVolumeGetSourceRetType = BootVolumeSource + +func getServerBootVolumeGetSourceAttributeTypeOk(arg ServerBootVolumeGetSourceAttributeType) (ret ServerBootVolumeGetSourceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerBootVolumeGetSourceAttributeType(arg *ServerBootVolumeGetSourceAttributeType, val ServerBootVolumeGetSourceRetType) { + *arg = &val +} + +// ServerBootVolume struct for ServerBootVolume +type ServerBootVolume struct { + // Delete the volume during the termination of the server. Defaults to false. + DeleteOnTermination ServerBootVolumegetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` + // Universally Unique Identifier (UUID). + Id ServerBootVolumeGetIdAttributeType `json:"id,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + PerformanceClass ServerBootVolumeGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` + // Size in Gigabyte. + Size ServerBootVolumeGetSizeAttributeType `json:"size,omitempty"` + Source ServerBootVolumeGetSourceAttributeType `json:"source,omitempty"` +} + +// NewServerBootVolume instantiates a new ServerBootVolume object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerBootVolume() *ServerBootVolume { + this := ServerBootVolume{} + return &this +} + +// NewServerBootVolumeWithDefaults instantiates a new ServerBootVolume object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerBootVolumeWithDefaults() *ServerBootVolume { + this := ServerBootVolume{} + return &this +} + +// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +func (o *ServerBootVolume) GetDeleteOnTermination() (res ServerBootVolumegetDeleteOnTerminationRetType) { + res, _ = o.GetDeleteOnTerminationOk() + return +} + +// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerBootVolume) GetDeleteOnTerminationOk() (ret ServerBootVolumegetDeleteOnTerminationRetType, ok bool) { + return getServerBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) +} + +// HasDeleteOnTermination returns a boolean if a field has been set. +func (o *ServerBootVolume) HasDeleteOnTermination() bool { + _, ok := o.GetDeleteOnTerminationOk() + return ok +} + +// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +func (o *ServerBootVolume) SetDeleteOnTermination(v ServerBootVolumegetDeleteOnTerminationRetType) { + setServerBootVolumegetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ServerBootVolume) GetId() (res ServerBootVolumeGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerBootVolume) GetIdOk() (ret ServerBootVolumeGetIdRetType, ok bool) { + return getServerBootVolumeGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +func (o *ServerBootVolume) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ServerBootVolume) SetId(v ServerBootVolumeGetIdRetType) { + setServerBootVolumeGetIdAttributeType(&o.Id, v) +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *ServerBootVolume) GetPerformanceClass() (res ServerBootVolumeGetPerformanceClassRetType) { + res, _ = o.GetPerformanceClassOk() + return +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerBootVolume) GetPerformanceClassOk() (ret ServerBootVolumeGetPerformanceClassRetType, ok bool) { + return getServerBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass) +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *ServerBootVolume) HasPerformanceClass() bool { + _, ok := o.GetPerformanceClassOk() + return ok +} + +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +func (o *ServerBootVolume) SetPerformanceClass(v ServerBootVolumeGetPerformanceClassRetType) { + setServerBootVolumeGetPerformanceClassAttributeType(&o.PerformanceClass, v) +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *ServerBootVolume) GetSize() (res ServerBootVolumeGetSizeRetType) { + res, _ = o.GetSizeOk() + return +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerBootVolume) GetSizeOk() (ret ServerBootVolumeGetSizeRetType, ok bool) { + return getServerBootVolumeGetSizeAttributeTypeOk(o.Size) +} + +// HasSize returns a boolean if a field has been set. +func (o *ServerBootVolume) HasSize() bool { + _, ok := o.GetSizeOk() + return ok +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *ServerBootVolume) SetSize(v ServerBootVolumeGetSizeRetType) { + setServerBootVolumeGetSizeAttributeType(&o.Size, v) +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *ServerBootVolume) GetSource() (res ServerBootVolumeGetSourceRetType) { + res, _ = o.GetSourceOk() + return +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerBootVolume) GetSourceOk() (ret ServerBootVolumeGetSourceRetType, ok bool) { + return getServerBootVolumeGetSourceAttributeTypeOk(o.Source) +} + +// HasSource returns a boolean if a field has been set. +func (o *ServerBootVolume) HasSource() bool { + _, ok := o.GetSourceOk() + return ok +} + +// SetSource gets a reference to the given BootVolumeSource and assigns it to the Source field. +func (o *ServerBootVolume) SetSource(v ServerBootVolumeGetSourceRetType) { + setServerBootVolumeGetSourceAttributeType(&o.Source, v) +} + +func (o ServerBootVolume) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getServerBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { + toSerialize["DeleteOnTermination"] = val + } + if val, ok := getServerBootVolumeGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getServerBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { + toSerialize["PerformanceClass"] = val + } + if val, ok := getServerBootVolumeGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val + } + if val, ok := getServerBootVolumeGetSourceAttributeTypeOk(o.Source); ok { + toSerialize["Source"] = val + } + return toSerialize, nil +} + +type NullableServerBootVolume struct { + value *ServerBootVolume + isSet bool +} + +func (v NullableServerBootVolume) Get() *ServerBootVolume { + return v.value +} + +func (v *NullableServerBootVolume) Set(val *ServerBootVolume) { + v.value = val + v.isSet = true +} + +func (v NullableServerBootVolume) IsSet() bool { + return v.isSet +} + +func (v *NullableServerBootVolume) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerBootVolume(val *ServerBootVolume) *NullableServerBootVolume { + return &NullableServerBootVolume{value: val, isSet: true} +} + +func (v NullableServerBootVolume) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerBootVolume) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_server_boot_volume_test.go b/services/iaas/model_server_boot_volume_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_server_boot_volume_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_server_console_url.go b/services/iaas/model_server_console_url.go index e83c16e9f..2e0021af2 100644 --- a/services/iaas/model_server_console_url.go +++ b/services/iaas/model_server_console_url.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_server_console_url_test.go b/services/iaas/model_server_console_url_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_server_console_url_test.go +++ b/services/iaas/model_server_console_url_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_server_list_response.go b/services/iaas/model_server_list_response.go index 52dca8c01..1f2009fca 100644 --- a/services/iaas/model_server_list_response.go +++ b/services/iaas/model_server_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_server_list_response_test.go b/services/iaas/model_server_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_server_list_response_test.go +++ b/services/iaas/model_server_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_server_maintenance.go b/services/iaas/model_server_maintenance.go index 85be214be..fb47dc2ed 100644 --- a/services/iaas/model_server_maintenance.go +++ b/services/iaas/model_server_maintenance.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_server_maintenance_test.go b/services/iaas/model_server_maintenance_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_server_maintenance_test.go +++ b/services/iaas/model_server_maintenance_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_server_network.go b/services/iaas/model_server_network.go index 96d9a3f9c..ddf221393 100644 --- a/services/iaas/model_server_network.go +++ b/services/iaas/model_server_network.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_server_network_test.go b/services/iaas/model_server_network_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_server_network_test.go +++ b/services/iaas/model_server_network_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_server_networking.go b/services/iaas/model_server_networking.go new file mode 100644 index 000000000..358eb5969 --- /dev/null +++ b/services/iaas/model_server_networking.go @@ -0,0 +1,144 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" + "fmt" +) + +// ServerNetworking - The initial networking setup for the server creation. A network, a nic or nothing can be given. +type ServerNetworking struct { + CreateServerNetworking *CreateServerNetworking + CreateServerNetworkingWithNics *CreateServerNetworkingWithNics +} + +// CreateServerNetworkingAsServerNetworking is a convenience function that returns CreateServerNetworking wrapped in ServerNetworking +func CreateServerNetworkingAsServerNetworking(v *CreateServerNetworking) ServerNetworking { + return ServerNetworking{ + CreateServerNetworking: v, + } +} + +// CreateServerNetworkingWithNicsAsServerNetworking is a convenience function that returns CreateServerNetworkingWithNics wrapped in ServerNetworking +func CreateServerNetworkingWithNicsAsServerNetworking(v *CreateServerNetworkingWithNics) ServerNetworking { + return ServerNetworking{ + CreateServerNetworkingWithNics: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ServerNetworking) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // Workaround until upstream issue is fixed: + // https://github.com/OpenAPITools/openapi-generator/issues/21751 + // Tracking issue on our side: https://jira.schwarz/browse/STACKITSDK-226 + // try to unmarshal data into CreateServerNetworking + dstServerNetworking1 := &ServerNetworking{} + err = json.Unmarshal(data, &dstServerNetworking1.CreateServerNetworking) + if err == nil { + jsonCreateServerNetworking, _ := json.Marshal(&dstServerNetworking1.CreateServerNetworking) + if string(jsonCreateServerNetworking) != "{}" { // empty struct + dst.CreateServerNetworking = dstServerNetworking1.CreateServerNetworking + match++ + } + } + + // try to unmarshal data into CreateServerNetworkingWithNics + dstServerNetworking2 := &ServerNetworking{} + err = json.Unmarshal(data, &dstServerNetworking2.CreateServerNetworkingWithNics) + if err == nil { + jsonCreateServerNetworkingWithNics, _ := json.Marshal(&dstServerNetworking2.CreateServerNetworkingWithNics) + if string(jsonCreateServerNetworkingWithNics) != "{}" { // empty struct + dst.CreateServerNetworkingWithNics = dstServerNetworking2.CreateServerNetworkingWithNics + match++ + } + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateServerNetworking = nil + dst.CreateServerNetworkingWithNics = nil + + return fmt.Errorf("data matches more than one schema in oneOf(ServerNetworking)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(ServerNetworking)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ServerNetworking) MarshalJSON() ([]byte, error) { + if src.CreateServerNetworking != nil { + return json.Marshal(&src.CreateServerNetworking) + } + + if src.CreateServerNetworkingWithNics != nil { + return json.Marshal(&src.CreateServerNetworkingWithNics) + } + + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object +} + +// Get the actual instance +func (obj *ServerNetworking) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateServerNetworking != nil { + return obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +type NullableServerNetworking struct { + value *ServerNetworking + isSet bool +} + +func (v NullableServerNetworking) Get() *ServerNetworking { + return v.value +} + +func (v *NullableServerNetworking) Set(val *ServerNetworking) { + v.value = val + v.isSet = true +} + +func (v NullableServerNetworking) IsSet() bool { + return v.isSet +} + +func (v *NullableServerNetworking) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerNetworking(val *ServerNetworking) *NullableServerNetworking { + return &NullableServerNetworking{value: val, isSet: true} +} + +func (v NullableServerNetworking) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerNetworking) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_server_networking_test.go b/services/iaas/model_server_networking_test.go new file mode 100644 index 000000000..bd8a787ef --- /dev/null +++ b/services/iaas/model_server_networking_test.go @@ -0,0 +1,43 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "testing" +) + +// isOneOf + +func TestServerNetworking_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{} + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := &ServerNetworking{} + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + marshalJson, err := v.MarshalJSON() + if err != nil { + t.Fatalf("failed marshalling ServerNetworking: %v", err) + } + if string(marshalJson) != string(tt.args.src) { + t.Fatalf("wanted %s, get %s", tt.args.src, marshalJson) + } + }) + } +} diff --git a/services/iaas/model_server_test.go b/services/iaas/model_server_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_server_test.go +++ b/services/iaas/model_server_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_service_account_mail_list_response.go b/services/iaas/model_service_account_mail_list_response.go index 41526cb04..d22791fdb 100644 --- a/services/iaas/model_service_account_mail_list_response.go +++ b/services/iaas/model_service_account_mail_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_service_account_mail_list_response_test.go b/services/iaas/model_service_account_mail_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_service_account_mail_list_response_test.go +++ b/services/iaas/model_service_account_mail_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_set_image_share_payload.go b/services/iaas/model_set_image_share_payload.go index f2ec6196a..ee7fc82e4 100644 --- a/services/iaas/model_set_image_share_payload.go +++ b/services/iaas/model_set_image_share_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_set_image_share_payload_test.go b/services/iaas/model_set_image_share_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_set_image_share_payload_test.go +++ b/services/iaas/model_set_image_share_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_snapshot.go b/services/iaas/model_snapshot.go index 5ec17e33a..29057c6cc 100644 --- a/services/iaas/model_snapshot.go +++ b/services/iaas/model_snapshot.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_snapshot_list_response.go b/services/iaas/model_snapshot_list_response.go index bcf539f7f..53fa85e0a 100644 --- a/services/iaas/model_snapshot_list_response.go +++ b/services/iaas/model_snapshot_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_snapshot_list_response_test.go b/services/iaas/model_snapshot_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_snapshot_list_response_test.go +++ b/services/iaas/model_snapshot_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_snapshot_test.go b/services/iaas/model_snapshot_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_snapshot_test.go +++ b/services/iaas/model_snapshot_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_static_area_id.go b/services/iaas/model_static_area_id.go index f2a0af07e..9960b3d3b 100644 --- a/services/iaas/model_static_area_id.go +++ b/services/iaas/model_static_area_id.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_static_area_id_test.go b/services/iaas/model_static_area_id_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_static_area_id_test.go +++ b/services/iaas/model_static_area_id_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_attached_volume_payload.go b/services/iaas/model_update_attached_volume_payload.go index d30bf2583..5254e10af 100644 --- a/services/iaas/model_update_attached_volume_payload.go +++ b/services/iaas/model_update_attached_volume_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_attached_volume_payload_test.go b/services/iaas/model_update_attached_volume_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_attached_volume_payload_test.go +++ b/services/iaas/model_update_attached_volume_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_backup_payload.go b/services/iaas/model_update_backup_payload.go index 56453f0a0..8d62403f0 100644 --- a/services/iaas/model_update_backup_payload.go +++ b/services/iaas/model_update_backup_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_backup_payload_test.go b/services/iaas/model_update_backup_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_backup_payload_test.go +++ b/services/iaas/model_update_backup_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_image_payload.go b/services/iaas/model_update_image_payload.go index b9d1af0c3..482038237 100644 --- a/services/iaas/model_update_image_payload.go +++ b/services/iaas/model_update_image_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_image_payload_test.go b/services/iaas/model_update_image_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_image_payload_test.go +++ b/services/iaas/model_update_image_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_image_share_payload.go b/services/iaas/model_update_image_share_payload.go index 1df4019da..50947eb1f 100644 --- a/services/iaas/model_update_image_share_payload.go +++ b/services/iaas/model_update_image_share_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_image_share_payload_test.go b/services/iaas/model_update_image_share_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_image_share_payload_test.go +++ b/services/iaas/model_update_image_share_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_key_pair_payload.go b/services/iaas/model_update_key_pair_payload.go index dd9651bf2..92bf21c12 100644 --- a/services/iaas/model_update_key_pair_payload.go +++ b/services/iaas/model_update_key_pair_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_key_pair_payload_test.go b/services/iaas/model_update_key_pair_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_key_pair_payload_test.go +++ b/services/iaas/model_update_key_pair_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_network_area_region_payload.go b/services/iaas/model_update_network_area_region_payload.go new file mode 100644 index 000000000..a019ccf31 --- /dev/null +++ b/services/iaas/model_update_network_area_region_payload.go @@ -0,0 +1,127 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the UpdateNetworkAreaRegionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkAreaRegionPayload{} + +/* + types and functions for ipv4 +*/ + +// isModel +type UpdateNetworkAreaRegionPayloadGetIpv4AttributeType = *UpdateRegionalAreaIPv4 +type UpdateNetworkAreaRegionPayloadGetIpv4ArgType = UpdateRegionalAreaIPv4 +type UpdateNetworkAreaRegionPayloadGetIpv4RetType = UpdateRegionalAreaIPv4 + +func getUpdateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(arg UpdateNetworkAreaRegionPayloadGetIpv4AttributeType) (ret UpdateNetworkAreaRegionPayloadGetIpv4RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateNetworkAreaRegionPayloadGetIpv4AttributeType(arg *UpdateNetworkAreaRegionPayloadGetIpv4AttributeType, val UpdateNetworkAreaRegionPayloadGetIpv4RetType) { + *arg = &val +} + +// UpdateNetworkAreaRegionPayload Object that represents the request body for a regional network area update. +type UpdateNetworkAreaRegionPayload struct { + Ipv4 UpdateNetworkAreaRegionPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` +} + +// NewUpdateNetworkAreaRegionPayload instantiates a new UpdateNetworkAreaRegionPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNetworkAreaRegionPayload() *UpdateNetworkAreaRegionPayload { + this := UpdateNetworkAreaRegionPayload{} + return &this +} + +// NewUpdateNetworkAreaRegionPayloadWithDefaults instantiates a new UpdateNetworkAreaRegionPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNetworkAreaRegionPayloadWithDefaults() *UpdateNetworkAreaRegionPayload { + this := UpdateNetworkAreaRegionPayload{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *UpdateNetworkAreaRegionPayload) GetIpv4() (res UpdateNetworkAreaRegionPayloadGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkAreaRegionPayload) GetIpv4Ok() (ret UpdateNetworkAreaRegionPayloadGetIpv4RetType, ok bool) { + return getUpdateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(o.Ipv4) +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *UpdateNetworkAreaRegionPayload) HasIpv4() bool { + _, ok := o.GetIpv4Ok() + return ok +} + +// SetIpv4 gets a reference to the given UpdateRegionalAreaIPv4 and assigns it to the Ipv4 field. +func (o *UpdateNetworkAreaRegionPayload) SetIpv4(v UpdateNetworkAreaRegionPayloadGetIpv4RetType) { + setUpdateNetworkAreaRegionPayloadGetIpv4AttributeType(&o.Ipv4, v) +} + +func (o UpdateNetworkAreaRegionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val + } + return toSerialize, nil +} + +type NullableUpdateNetworkAreaRegionPayload struct { + value *UpdateNetworkAreaRegionPayload + isSet bool +} + +func (v NullableUpdateNetworkAreaRegionPayload) Get() *UpdateNetworkAreaRegionPayload { + return v.value +} + +func (v *NullableUpdateNetworkAreaRegionPayload) Set(val *UpdateNetworkAreaRegionPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkAreaRegionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkAreaRegionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkAreaRegionPayload(val *UpdateNetworkAreaRegionPayload) *NullableUpdateNetworkAreaRegionPayload { + return &NullableUpdateNetworkAreaRegionPayload{value: val, isSet: true} +} + +func (v NullableUpdateNetworkAreaRegionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkAreaRegionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_update_network_area_region_payload_test.go b/services/iaas/model_update_network_area_region_payload_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_update_network_area_region_payload_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_update_network_area_route_payload.go b/services/iaas/model_update_network_area_route_payload.go index a7b4b7535..0629a15ab 100644 --- a/services/iaas/model_update_network_area_route_payload.go +++ b/services/iaas/model_update_network_area_route_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_network_area_route_payload_test.go b/services/iaas/model_update_network_area_route_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_network_area_route_payload_test.go +++ b/services/iaas/model_update_network_area_route_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_network_ipv4_body.go b/services/iaas/model_update_network_ipv4_body.go index 982807977..1687f535a 100644 --- a/services/iaas/model_update_network_ipv4_body.go +++ b/services/iaas/model_update_network_ipv4_body.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -64,7 +64,7 @@ func setUpdateNetworkIPv4BodyGetNameserversAttributeType(arg *UpdateNetworkIPv4B // UpdateNetworkIPv4Body The config object for a IPv4 network update. type UpdateNetworkIPv4Body struct { - // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. Gateway UpdateNetworkIPv4BodyGetGatewayAttributeType `json:"gateway,omitempty"` // A list containing DNS Servers/Nameservers for IPv4. Nameservers UpdateNetworkIPv4BodyGetNameserversAttributeType `json:"nameservers,omitempty"` diff --git a/services/iaas/model_update_network_ipv4_body_test.go b/services/iaas/model_update_network_ipv4_body_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_network_ipv4_body_test.go +++ b/services/iaas/model_update_network_ipv4_body_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_network_ipv6_body.go b/services/iaas/model_update_network_ipv6_body.go index 618baa9b4..59d0d8052 100644 --- a/services/iaas/model_update_network_ipv6_body.go +++ b/services/iaas/model_update_network_ipv6_body.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -64,7 +64,7 @@ func setUpdateNetworkIPv6BodyGetNameserversAttributeType(arg *UpdateNetworkIPv6B // UpdateNetworkIPv6Body The config object for a IPv6 network update. type UpdateNetworkIPv6Body struct { - // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. Gateway UpdateNetworkIPv6BodyGetGatewayAttributeType `json:"gateway,omitempty"` // A list containing DNS Servers/Nameservers for IPv6. Nameservers UpdateNetworkIPv6BodyGetNameserversAttributeType `json:"nameservers,omitempty"` diff --git a/services/iaas/model_update_network_ipv6_body_test.go b/services/iaas/model_update_network_ipv6_body_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_network_ipv6_body_test.go +++ b/services/iaas/model_update_network_ipv6_body_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_nic_payload.go b/services/iaas/model_update_nic_payload.go index 07933fe42..4de966179 100644 --- a/services/iaas/model_update_nic_payload.go +++ b/services/iaas/model_update_nic_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_nic_payload_test.go b/services/iaas/model_update_nic_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_nic_payload_test.go +++ b/services/iaas/model_update_nic_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_public_ip_payload.go b/services/iaas/model_update_public_ip_payload.go index 39da8a737..afe67b7fe 100644 --- a/services/iaas/model_update_public_ip_payload.go +++ b/services/iaas/model_update_public_ip_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -108,7 +108,7 @@ type UpdatePublicIPPayloadGetNetworkInterfaceRetType = *string type UpdatePublicIPPayload struct { // Universally Unique Identifier (UUID). Id UpdatePublicIPPayloadGetIdAttributeType `json:"id,omitempty"` - // Object that represents an IP address. + // String that represents an IPv4 address. Ip UpdatePublicIPPayloadGetIpAttributeType `json:"ip,omitempty"` // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Labels UpdatePublicIPPayloadGetLabelsAttributeType `json:"labels,omitempty"` diff --git a/services/iaas/model_update_public_ip_payload_test.go b/services/iaas/model_update_public_ip_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_public_ip_payload_test.go +++ b/services/iaas/model_update_public_ip_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_regional_area_ipv4.go b/services/iaas/model_update_regional_area_ipv4.go new file mode 100644 index 000000000..e4437a5d9 --- /dev/null +++ b/services/iaas/model_update_regional_area_ipv4.go @@ -0,0 +1,271 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the UpdateRegionalAreaIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRegionalAreaIPv4{} + +/* + types and functions for defaultNameservers +*/ + +// isArray +type UpdateRegionalAreaIPv4GetDefaultNameserversAttributeType = *[]string +type UpdateRegionalAreaIPv4GetDefaultNameserversArgType = []string +type UpdateRegionalAreaIPv4GetDefaultNameserversRetType = []string + +func getUpdateRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(arg UpdateRegionalAreaIPv4GetDefaultNameserversAttributeType) (ret UpdateRegionalAreaIPv4GetDefaultNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateRegionalAreaIPv4GetDefaultNameserversAttributeType(arg *UpdateRegionalAreaIPv4GetDefaultNameserversAttributeType, val UpdateRegionalAreaIPv4GetDefaultNameserversRetType) { + *arg = &val +} + +/* + types and functions for defaultPrefixLen +*/ + +// isLong +type UpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeType = *int64 +type UpdateRegionalAreaIPv4GetDefaultPrefixLenArgType = int64 +type UpdateRegionalAreaIPv4GetDefaultPrefixLenRetType = int64 + +func getUpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeTypeOk(arg UpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeType) (ret UpdateRegionalAreaIPv4GetDefaultPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeType(arg *UpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeType, val UpdateRegionalAreaIPv4GetDefaultPrefixLenRetType) { + *arg = &val +} + +/* + types and functions for maxPrefixLen +*/ + +// isLong +type UpdateRegionalAreaIPv4GetMaxPrefixLenAttributeType = *int64 +type UpdateRegionalAreaIPv4GetMaxPrefixLenArgType = int64 +type UpdateRegionalAreaIPv4GetMaxPrefixLenRetType = int64 + +func getUpdateRegionalAreaIPv4GetMaxPrefixLenAttributeTypeOk(arg UpdateRegionalAreaIPv4GetMaxPrefixLenAttributeType) (ret UpdateRegionalAreaIPv4GetMaxPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateRegionalAreaIPv4GetMaxPrefixLenAttributeType(arg *UpdateRegionalAreaIPv4GetMaxPrefixLenAttributeType, val UpdateRegionalAreaIPv4GetMaxPrefixLenRetType) { + *arg = &val +} + +/* + types and functions for minPrefixLen +*/ + +// isLong +type UpdateRegionalAreaIPv4GetMinPrefixLenAttributeType = *int64 +type UpdateRegionalAreaIPv4GetMinPrefixLenArgType = int64 +type UpdateRegionalAreaIPv4GetMinPrefixLenRetType = int64 + +func getUpdateRegionalAreaIPv4GetMinPrefixLenAttributeTypeOk(arg UpdateRegionalAreaIPv4GetMinPrefixLenAttributeType) (ret UpdateRegionalAreaIPv4GetMinPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateRegionalAreaIPv4GetMinPrefixLenAttributeType(arg *UpdateRegionalAreaIPv4GetMinPrefixLenAttributeType, val UpdateRegionalAreaIPv4GetMinPrefixLenRetType) { + *arg = &val +} + +// UpdateRegionalAreaIPv4 Object that represents the request body for a regional network area IPv4 configuration update. +type UpdateRegionalAreaIPv4 struct { + DefaultNameservers UpdateRegionalAreaIPv4GetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` + // The default prefix length for networks in the network area. + DefaultPrefixLen UpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeType `json:"defaultPrefixLen,omitempty"` + // The maximal prefix length for networks in the network area. + MaxPrefixLen UpdateRegionalAreaIPv4GetMaxPrefixLenAttributeType `json:"maxPrefixLen,omitempty"` + // The minimal prefix length for networks in the network area. + MinPrefixLen UpdateRegionalAreaIPv4GetMinPrefixLenAttributeType `json:"minPrefixLen,omitempty"` +} + +// NewUpdateRegionalAreaIPv4 instantiates a new UpdateRegionalAreaIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRegionalAreaIPv4() *UpdateRegionalAreaIPv4 { + this := UpdateRegionalAreaIPv4{} + return &this +} + +// NewUpdateRegionalAreaIPv4WithDefaults instantiates a new UpdateRegionalAreaIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRegionalAreaIPv4WithDefaults() *UpdateRegionalAreaIPv4 { + this := UpdateRegionalAreaIPv4{} + return &this +} + +// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. +func (o *UpdateRegionalAreaIPv4) GetDefaultNameservers() (res UpdateRegionalAreaIPv4GetDefaultNameserversRetType) { + res, _ = o.GetDefaultNameserversOk() + return +} + +// GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRegionalAreaIPv4) GetDefaultNameserversOk() (ret UpdateRegionalAreaIPv4GetDefaultNameserversRetType, ok bool) { + return getUpdateRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) +} + +// HasDefaultNameservers returns a boolean if a field has been set. +func (o *UpdateRegionalAreaIPv4) HasDefaultNameservers() bool { + _, ok := o.GetDefaultNameserversOk() + return ok +} + +// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. +func (o *UpdateRegionalAreaIPv4) SetDefaultNameservers(v UpdateRegionalAreaIPv4GetDefaultNameserversRetType) { + setUpdateRegionalAreaIPv4GetDefaultNameserversAttributeType(&o.DefaultNameservers, v) +} + +// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. +func (o *UpdateRegionalAreaIPv4) GetDefaultPrefixLen() (res UpdateRegionalAreaIPv4GetDefaultPrefixLenRetType) { + res, _ = o.GetDefaultPrefixLenOk() + return +} + +// GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRegionalAreaIPv4) GetDefaultPrefixLenOk() (ret UpdateRegionalAreaIPv4GetDefaultPrefixLenRetType, ok bool) { + return getUpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen) +} + +// HasDefaultPrefixLen returns a boolean if a field has been set. +func (o *UpdateRegionalAreaIPv4) HasDefaultPrefixLen() bool { + _, ok := o.GetDefaultPrefixLenOk() + return ok +} + +// SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. +func (o *UpdateRegionalAreaIPv4) SetDefaultPrefixLen(v UpdateRegionalAreaIPv4GetDefaultPrefixLenRetType) { + setUpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeType(&o.DefaultPrefixLen, v) +} + +// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. +func (o *UpdateRegionalAreaIPv4) GetMaxPrefixLen() (res UpdateRegionalAreaIPv4GetMaxPrefixLenRetType) { + res, _ = o.GetMaxPrefixLenOk() + return +} + +// GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRegionalAreaIPv4) GetMaxPrefixLenOk() (ret UpdateRegionalAreaIPv4GetMaxPrefixLenRetType, ok bool) { + return getUpdateRegionalAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen) +} + +// HasMaxPrefixLen returns a boolean if a field has been set. +func (o *UpdateRegionalAreaIPv4) HasMaxPrefixLen() bool { + _, ok := o.GetMaxPrefixLenOk() + return ok +} + +// SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. +func (o *UpdateRegionalAreaIPv4) SetMaxPrefixLen(v UpdateRegionalAreaIPv4GetMaxPrefixLenRetType) { + setUpdateRegionalAreaIPv4GetMaxPrefixLenAttributeType(&o.MaxPrefixLen, v) +} + +// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. +func (o *UpdateRegionalAreaIPv4) GetMinPrefixLen() (res UpdateRegionalAreaIPv4GetMinPrefixLenRetType) { + res, _ = o.GetMinPrefixLenOk() + return +} + +// GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRegionalAreaIPv4) GetMinPrefixLenOk() (ret UpdateRegionalAreaIPv4GetMinPrefixLenRetType, ok bool) { + return getUpdateRegionalAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen) +} + +// HasMinPrefixLen returns a boolean if a field has been set. +func (o *UpdateRegionalAreaIPv4) HasMinPrefixLen() bool { + _, ok := o.GetMinPrefixLenOk() + return ok +} + +// SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. +func (o *UpdateRegionalAreaIPv4) SetMinPrefixLen(v UpdateRegionalAreaIPv4GetMinPrefixLenRetType) { + setUpdateRegionalAreaIPv4GetMinPrefixLenAttributeType(&o.MinPrefixLen, v) +} + +func (o UpdateRegionalAreaIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { + toSerialize["DefaultNameservers"] = val + } + if val, ok := getUpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen); ok { + toSerialize["DefaultPrefixLen"] = val + } + if val, ok := getUpdateRegionalAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen); ok { + toSerialize["MaxPrefixLen"] = val + } + if val, ok := getUpdateRegionalAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen); ok { + toSerialize["MinPrefixLen"] = val + } + return toSerialize, nil +} + +type NullableUpdateRegionalAreaIPv4 struct { + value *UpdateRegionalAreaIPv4 + isSet bool +} + +func (v NullableUpdateRegionalAreaIPv4) Get() *UpdateRegionalAreaIPv4 { + return v.value +} + +func (v *NullableUpdateRegionalAreaIPv4) Set(val *UpdateRegionalAreaIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRegionalAreaIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRegionalAreaIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRegionalAreaIPv4(val *UpdateRegionalAreaIPv4) *NullableUpdateRegionalAreaIPv4 { + return &NullableUpdateRegionalAreaIPv4{value: val, isSet: true} +} + +func (v NullableUpdateRegionalAreaIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRegionalAreaIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_update_regional_area_ipv4_test.go b/services/iaas/model_update_regional_area_ipv4_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_update_regional_area_ipv4_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_update_route_of_routing_table_payload.go b/services/iaas/model_update_route_of_routing_table_payload.go new file mode 100644 index 000000000..9d7431571 --- /dev/null +++ b/services/iaas/model_update_route_of_routing_table_payload.go @@ -0,0 +1,128 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the UpdateRouteOfRoutingTablePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRouteOfRoutingTablePayload{} + +/* + types and functions for labels +*/ + +// isFreeform +type UpdateRouteOfRoutingTablePayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateRouteOfRoutingTablePayloadGetLabelsArgType = map[string]interface{} +type UpdateRouteOfRoutingTablePayloadGetLabelsRetType = map[string]interface{} + +func getUpdateRouteOfRoutingTablePayloadGetLabelsAttributeTypeOk(arg UpdateRouteOfRoutingTablePayloadGetLabelsAttributeType) (ret UpdateRouteOfRoutingTablePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateRouteOfRoutingTablePayloadGetLabelsAttributeType(arg *UpdateRouteOfRoutingTablePayloadGetLabelsAttributeType, val UpdateRouteOfRoutingTablePayloadGetLabelsRetType) { + *arg = &val +} + +// UpdateRouteOfRoutingTablePayload Object that represents the request body for a route update. +type UpdateRouteOfRoutingTablePayload struct { + // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. + Labels UpdateRouteOfRoutingTablePayloadGetLabelsAttributeType `json:"labels,omitempty"` +} + +// NewUpdateRouteOfRoutingTablePayload instantiates a new UpdateRouteOfRoutingTablePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRouteOfRoutingTablePayload() *UpdateRouteOfRoutingTablePayload { + this := UpdateRouteOfRoutingTablePayload{} + return &this +} + +// NewUpdateRouteOfRoutingTablePayloadWithDefaults instantiates a new UpdateRouteOfRoutingTablePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRouteOfRoutingTablePayloadWithDefaults() *UpdateRouteOfRoutingTablePayload { + this := UpdateRouteOfRoutingTablePayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateRouteOfRoutingTablePayload) GetLabels() (res UpdateRouteOfRoutingTablePayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRouteOfRoutingTablePayload) GetLabelsOk() (ret UpdateRouteOfRoutingTablePayloadGetLabelsRetType, ok bool) { + return getUpdateRouteOfRoutingTablePayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateRouteOfRoutingTablePayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateRouteOfRoutingTablePayload) SetLabels(v UpdateRouteOfRoutingTablePayloadGetLabelsRetType) { + setUpdateRouteOfRoutingTablePayloadGetLabelsAttributeType(&o.Labels, v) +} + +func (o UpdateRouteOfRoutingTablePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateRouteOfRoutingTablePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + return toSerialize, nil +} + +type NullableUpdateRouteOfRoutingTablePayload struct { + value *UpdateRouteOfRoutingTablePayload + isSet bool +} + +func (v NullableUpdateRouteOfRoutingTablePayload) Get() *UpdateRouteOfRoutingTablePayload { + return v.value +} + +func (v *NullableUpdateRouteOfRoutingTablePayload) Set(val *UpdateRouteOfRoutingTablePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRouteOfRoutingTablePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRouteOfRoutingTablePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRouteOfRoutingTablePayload(val *UpdateRouteOfRoutingTablePayload) *NullableUpdateRouteOfRoutingTablePayload { + return &NullableUpdateRouteOfRoutingTablePayload{value: val, isSet: true} +} + +func (v NullableUpdateRouteOfRoutingTablePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRouteOfRoutingTablePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_update_route_of_routing_table_payload_test.go b/services/iaas/model_update_route_of_routing_table_payload_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_update_route_of_routing_table_payload_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_update_routing_table_of_area_payload.go b/services/iaas/model_update_routing_table_of_area_payload.go new file mode 100644 index 000000000..8ef54bd19 --- /dev/null +++ b/services/iaas/model_update_routing_table_of_area_payload.go @@ -0,0 +1,276 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas + +import ( + "encoding/json" +) + +// checks if the UpdateRoutingTableOfAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRoutingTableOfAreaPayload{} + +/* + types and functions for description +*/ + +// isNotNullableString +type UpdateRoutingTableOfAreaPayloadGetDescriptionAttributeType = *string + +func getUpdateRoutingTableOfAreaPayloadGetDescriptionAttributeTypeOk(arg UpdateRoutingTableOfAreaPayloadGetDescriptionAttributeType) (ret UpdateRoutingTableOfAreaPayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateRoutingTableOfAreaPayloadGetDescriptionAttributeType(arg *UpdateRoutingTableOfAreaPayloadGetDescriptionAttributeType, val UpdateRoutingTableOfAreaPayloadGetDescriptionRetType) { + *arg = &val +} + +type UpdateRoutingTableOfAreaPayloadGetDescriptionArgType = string +type UpdateRoutingTableOfAreaPayloadGetDescriptionRetType = string + +/* + types and functions for dynamicRoutes +*/ + +// isBoolean +type UpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeType = *bool +type UpdateRoutingTableOfAreaPayloadgetDynamicRoutesArgType = bool +type UpdateRoutingTableOfAreaPayloadgetDynamicRoutesRetType = bool + +func getUpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeTypeOk(arg UpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeType) (ret UpdateRoutingTableOfAreaPayloadgetDynamicRoutesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeType(arg *UpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeType, val UpdateRoutingTableOfAreaPayloadgetDynamicRoutesRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isFreeform +type UpdateRoutingTableOfAreaPayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateRoutingTableOfAreaPayloadGetLabelsArgType = map[string]interface{} +type UpdateRoutingTableOfAreaPayloadGetLabelsRetType = map[string]interface{} + +func getUpdateRoutingTableOfAreaPayloadGetLabelsAttributeTypeOk(arg UpdateRoutingTableOfAreaPayloadGetLabelsAttributeType) (ret UpdateRoutingTableOfAreaPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateRoutingTableOfAreaPayloadGetLabelsAttributeType(arg *UpdateRoutingTableOfAreaPayloadGetLabelsAttributeType, val UpdateRoutingTableOfAreaPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateRoutingTableOfAreaPayloadGetNameAttributeType = *string + +func getUpdateRoutingTableOfAreaPayloadGetNameAttributeTypeOk(arg UpdateRoutingTableOfAreaPayloadGetNameAttributeType) (ret UpdateRoutingTableOfAreaPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateRoutingTableOfAreaPayloadGetNameAttributeType(arg *UpdateRoutingTableOfAreaPayloadGetNameAttributeType, val UpdateRoutingTableOfAreaPayloadGetNameRetType) { + *arg = &val +} + +type UpdateRoutingTableOfAreaPayloadGetNameArgType = string +type UpdateRoutingTableOfAreaPayloadGetNameRetType = string + +// UpdateRoutingTableOfAreaPayload Object that represents the request body for a routing table update. +type UpdateRoutingTableOfAreaPayload struct { + // Description Object. Allows string up to 255 Characters. + Description UpdateRoutingTableOfAreaPayloadGetDescriptionAttributeType `json:"description,omitempty"` + // A config setting for a routing table which allows propagation of dynamic routes to this routing table. + DynamicRoutes UpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeType `json:"dynamicRoutes,omitempty"` + // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. + Labels UpdateRoutingTableOfAreaPayloadGetLabelsAttributeType `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name UpdateRoutingTableOfAreaPayloadGetNameAttributeType `json:"name,omitempty"` +} + +// NewUpdateRoutingTableOfAreaPayload instantiates a new UpdateRoutingTableOfAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRoutingTableOfAreaPayload() *UpdateRoutingTableOfAreaPayload { + this := UpdateRoutingTableOfAreaPayload{} + return &this +} + +// NewUpdateRoutingTableOfAreaPayloadWithDefaults instantiates a new UpdateRoutingTableOfAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRoutingTableOfAreaPayloadWithDefaults() *UpdateRoutingTableOfAreaPayload { + this := UpdateRoutingTableOfAreaPayload{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetDescription() (res UpdateRoutingTableOfAreaPayloadGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetDescriptionOk() (ret UpdateRoutingTableOfAreaPayloadGetDescriptionRetType, ok bool) { + return getUpdateRoutingTableOfAreaPayloadGetDescriptionAttributeTypeOk(o.Description) +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasDescription() bool { + _, ok := o.GetDescriptionOk() + return ok +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateRoutingTableOfAreaPayload) SetDescription(v UpdateRoutingTableOfAreaPayloadGetDescriptionRetType) { + setUpdateRoutingTableOfAreaPayloadGetDescriptionAttributeType(&o.Description, v) +} + +// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetDynamicRoutes() (res UpdateRoutingTableOfAreaPayloadgetDynamicRoutesRetType) { + res, _ = o.GetDynamicRoutesOk() + return +} + +// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetDynamicRoutesOk() (ret UpdateRoutingTableOfAreaPayloadgetDynamicRoutesRetType, ok bool) { + return getUpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeTypeOk(o.DynamicRoutes) +} + +// HasDynamicRoutes returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasDynamicRoutes() bool { + _, ok := o.GetDynamicRoutesOk() + return ok +} + +// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +func (o *UpdateRoutingTableOfAreaPayload) SetDynamicRoutes(v UpdateRoutingTableOfAreaPayloadgetDynamicRoutesRetType) { + setUpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeType(&o.DynamicRoutes, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetLabels() (res UpdateRoutingTableOfAreaPayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetLabelsOk() (ret UpdateRoutingTableOfAreaPayloadGetLabelsRetType, ok bool) { + return getUpdateRoutingTableOfAreaPayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateRoutingTableOfAreaPayload) SetLabels(v UpdateRoutingTableOfAreaPayloadGetLabelsRetType) { + setUpdateRoutingTableOfAreaPayloadGetLabelsAttributeType(&o.Labels, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetName() (res UpdateRoutingTableOfAreaPayloadGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetNameOk() (ret UpdateRoutingTableOfAreaPayloadGetNameRetType, ok bool) { + return getUpdateRoutingTableOfAreaPayloadGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateRoutingTableOfAreaPayload) SetName(v UpdateRoutingTableOfAreaPayloadGetNameRetType) { + setUpdateRoutingTableOfAreaPayloadGetNameAttributeType(&o.Name, v) +} + +func (o UpdateRoutingTableOfAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateRoutingTableOfAreaPayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getUpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeTypeOk(o.DynamicRoutes); ok { + toSerialize["DynamicRoutes"] = val + } + if val, ok := getUpdateRoutingTableOfAreaPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getUpdateRoutingTableOfAreaPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + return toSerialize, nil +} + +type NullableUpdateRoutingTableOfAreaPayload struct { + value *UpdateRoutingTableOfAreaPayload + isSet bool +} + +func (v NullableUpdateRoutingTableOfAreaPayload) Get() *UpdateRoutingTableOfAreaPayload { + return v.value +} + +func (v *NullableUpdateRoutingTableOfAreaPayload) Set(val *UpdateRoutingTableOfAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRoutingTableOfAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRoutingTableOfAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRoutingTableOfAreaPayload(val *UpdateRoutingTableOfAreaPayload) *NullableUpdateRoutingTableOfAreaPayload { + return &NullableUpdateRoutingTableOfAreaPayload{value: val, isSet: true} +} + +func (v NullableUpdateRoutingTableOfAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRoutingTableOfAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/model_update_routing_table_of_area_payload_test.go b/services/iaas/model_update_routing_table_of_area_payload_test.go new file mode 100644 index 000000000..d0aed2f37 --- /dev/null +++ b/services/iaas/model_update_routing_table_of_area_payload_test.go @@ -0,0 +1,11 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaas diff --git a/services/iaas/model_update_security_group_payload.go b/services/iaas/model_update_security_group_payload.go index 94bfb1f35..8bc1db9e9 100644 --- a/services/iaas/model_update_security_group_payload.go +++ b/services/iaas/model_update_security_group_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_security_group_payload_test.go b/services/iaas/model_update_security_group_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_security_group_payload_test.go +++ b/services/iaas/model_update_security_group_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_server_payload.go b/services/iaas/model_update_server_payload.go index 8022915ab..9362cbcec 100644 --- a/services/iaas/model_update_server_payload.go +++ b/services/iaas/model_update_server_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_server_payload_test.go b/services/iaas/model_update_server_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_server_payload_test.go +++ b/services/iaas/model_update_server_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_snapshot_payload.go b/services/iaas/model_update_snapshot_payload.go index b4261ea11..d758b4dd0 100644 --- a/services/iaas/model_update_snapshot_payload.go +++ b/services/iaas/model_update_snapshot_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_snapshot_payload_test.go b/services/iaas/model_update_snapshot_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_snapshot_payload_test.go +++ b/services/iaas/model_update_snapshot_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_volume_payload.go b/services/iaas/model_update_volume_payload.go index 0f53088e9..cdd6183f5 100644 --- a/services/iaas/model_update_volume_payload.go +++ b/services/iaas/model_update_volume_payload.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_update_volume_payload_test.go b/services/iaas/model_update_volume_payload_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_update_volume_payload_test.go +++ b/services/iaas/model_update_volume_payload_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume.go b/services/iaas/model_volume.go index eecc77104..db82e0648 100644 --- a/services/iaas/model_volume.go +++ b/services/iaas/model_volume.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_attachment.go b/services/iaas/model_volume_attachment.go index b7fd4f4a1..85a5881a3 100644 --- a/services/iaas/model_volume_attachment.go +++ b/services/iaas/model_volume_attachment.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_attachment_list_response.go b/services/iaas/model_volume_attachment_list_response.go index a84087e22..43cd0a0a2 100644 --- a/services/iaas/model_volume_attachment_list_response.go +++ b/services/iaas/model_volume_attachment_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_attachment_list_response_test.go b/services/iaas/model_volume_attachment_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_volume_attachment_list_response_test.go +++ b/services/iaas/model_volume_attachment_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_attachment_test.go b/services/iaas/model_volume_attachment_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_volume_attachment_test.go +++ b/services/iaas/model_volume_attachment_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_encryption_parameter.go b/services/iaas/model_volume_encryption_parameter.go index f0671b880..c927a707f 100644 --- a/services/iaas/model_volume_encryption_parameter.go +++ b/services/iaas/model_volume_encryption_parameter.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_encryption_parameter_test.go b/services/iaas/model_volume_encryption_parameter_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_volume_encryption_parameter_test.go +++ b/services/iaas/model_volume_encryption_parameter_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_list_response.go b/services/iaas/model_volume_list_response.go index 83cd3521a..7a34e7078 100644 --- a/services/iaas/model_volume_list_response.go +++ b/services/iaas/model_volume_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_list_response_test.go b/services/iaas/model_volume_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_volume_list_response_test.go +++ b/services/iaas/model_volume_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_performance_class.go b/services/iaas/model_volume_performance_class.go index 3d809fed4..2e9b2f8c3 100644 --- a/services/iaas/model_volume_performance_class.go +++ b/services/iaas/model_volume_performance_class.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_performance_class_list_response.go b/services/iaas/model_volume_performance_class_list_response.go index 28712b919..99832f5c2 100644 --- a/services/iaas/model_volume_performance_class_list_response.go +++ b/services/iaas/model_volume_performance_class_list_response.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_performance_class_list_response_test.go b/services/iaas/model_volume_performance_class_list_response_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_volume_performance_class_list_response_test.go +++ b/services/iaas/model_volume_performance_class_list_response_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_performance_class_test.go b/services/iaas/model_volume_performance_class_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_volume_performance_class_test.go +++ b/services/iaas/model_volume_performance_class_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_source.go b/services/iaas/model_volume_source.go index 3da88567c..ff9c0b5f6 100644 --- a/services/iaas/model_volume_source.go +++ b/services/iaas/model_volume_source.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_source_test.go b/services/iaas/model_volume_source_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_volume_source_test.go +++ b/services/iaas/model_volume_source_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/model_volume_test.go b/services/iaas/model_volume_test.go index 69a4aa858..d0aed2f37 100644 --- a/services/iaas/model_volume_test.go +++ b/services/iaas/model_volume_test.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/utils.go b/services/iaas/utils.go index 48e758344..eabdf254c 100644 --- a/services/iaas/utils.go +++ b/services/iaas/utils.go @@ -3,7 +3,7 @@ IaaS-API This API allows you to create and modify IaaS resources. -API version: 1 +API version: 2 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/iaas/wait/wait.go b/services/iaas/wait/wait.go index 15cdb854e..95c3060a4 100644 --- a/services/iaas/wait/wait.go +++ b/services/iaas/wait/wait.go @@ -49,32 +49,33 @@ const ( // Interfaces needed for tests type APIClientInterface interface { GetNetworkAreaExecute(ctx context.Context, organizationId, areaId string) (*iaas.NetworkArea, error) + GetNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) (*iaas.RegionalArea, error) ListNetworkAreaProjectsExecute(ctx context.Context, organizationId, areaId string) (*iaas.ProjectListResponse, error) - GetProjectRequestExecute(ctx context.Context, projectId string, requestId string) (*iaas.Request, error) - GetNetworkExecute(ctx context.Context, projectId, networkId string) (*iaas.Network, error) - GetVolumeExecute(ctx context.Context, projectId string, volumeId string) (*iaas.Volume, error) - GetServerExecute(ctx context.Context, projectId string, serverId string) (*iaas.Server, error) - GetAttachedVolumeExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*iaas.VolumeAttachment, error) - GetImageExecute(ctx context.Context, projectId string, imageId string) (*iaas.Image, error) - GetBackupExecute(ctx context.Context, projectId string, backupId string) (*iaas.Backup, error) - GetSnapshotExecute(ctx context.Context, projectId string, snapshotId string) (*iaas.Snapshot, error) + GetProjectRequestExecute(ctx context.Context, projectId, region, requestId string) (*iaas.Request, error) + GetNetworkExecute(ctx context.Context, projectId, region, networkId string) (*iaas.Network, error) + GetVolumeExecute(ctx context.Context, projectId, region, volumeId string) (*iaas.Volume, error) + GetServerExecute(ctx context.Context, projectId, region, serverId string) (*iaas.Server, error) + GetAttachedVolumeExecute(ctx context.Context, projectId, region, serverId, volumeId string) (*iaas.VolumeAttachment, error) + GetImageExecute(ctx context.Context, projectId, region, imageId string) (*iaas.Image, error) + GetBackupExecute(ctx context.Context, projectId, region, backupId string) (*iaas.Backup, error) + GetSnapshotExecute(ctx context.Context, projectId, region, snapshotId string) (*iaas.Snapshot, error) } type ResourceManagerAPIClientInterface interface { GetProjectExecute(ctx context.Context, id string) (*resourcemanager.GetProjectResponse, error) } -// CreateNetworkAreaWaitHandler will wait for network area creation +// Deprecated: CreateNetworkAreaWaitHandler is no longer required and will be removed in April 2026. CreateNetworkAreaWaitHandler will wait for network area creation func CreateNetworkAreaWaitHandler(ctx context.Context, a APIClientInterface, organizationId, areaId string) *wait.AsyncActionHandler[iaas.NetworkArea] { handler := wait.New(func() (waitFinished bool, response *iaas.NetworkArea, err error) { area, err := a.GetNetworkAreaExecute(ctx, organizationId, areaId) if err != nil { return false, area, err } - if area.AreaId == nil || area.State == nil { - return false, area, fmt.Errorf("create failed for network area with id %s, the response is not valid: the id or the state are missing", areaId) + if area.Id == nil { + return false, area, fmt.Errorf("create failed for network area with id %s, the response is not valid: the id is missing", areaId) } - if *area.AreaId == areaId && *area.State == CreateSuccess { + if *area.Id == areaId { return true, area, nil } return false, area, nil @@ -83,18 +84,18 @@ func CreateNetworkAreaWaitHandler(ctx context.Context, a APIClientInterface, org return handler } -// UpdateNetworkAreaWaitHandler will wait for network area update +// Deprecated: UpdateNetworkAreaWaitHandler is no longer required and will be removed in April 2026. UpdateNetworkAreaWaitHandler will wait for network area update func UpdateNetworkAreaWaitHandler(ctx context.Context, a APIClientInterface, organizationId, areaId string) *wait.AsyncActionHandler[iaas.NetworkArea] { handler := wait.New(func() (waitFinished bool, response *iaas.NetworkArea, err error) { area, err := a.GetNetworkAreaExecute(ctx, organizationId, areaId) if err != nil { return false, area, err } - if area.AreaId == nil || area.State == nil { - return false, nil, fmt.Errorf("update failed for network area with id %s, the response is not valid: the id or the state are missing", areaId) + if area.Id == nil { + return false, nil, fmt.Errorf("update failed for network area with id %s, the response is not valid: the id is missing", areaId) } // The state returns to "CREATED" after a successful update is completed - if *area.AreaId == areaId && *area.State == CreateSuccess { + if *area.Id == areaId { return true, area, nil } return false, area, nil @@ -104,6 +105,51 @@ func UpdateNetworkAreaWaitHandler(ctx context.Context, a APIClientInterface, org return handler } +// CreateNetworkAreaRegionWaitHandler will wait for network area region creation +func CreateNetworkAreaRegionWaitHandler(ctx context.Context, a APIClientInterface, organizationId, areaId, region string) *wait.AsyncActionHandler[iaas.RegionalArea] { + handler := wait.New(func() (waitFinished bool, response *iaas.RegionalArea, err error) { + area, err := a.GetNetworkAreaRegionExecute(ctx, organizationId, areaId, region) + if err != nil { + return false, area, err + } + if area.Status == nil { + return false, nil, fmt.Errorf("configuring failed for network area with id %s, the response is not valid: the status are missing", areaId) + } + // The state returns to "CREATED" after a successful update is completed + if *area.Status == CreateSuccess { + return true, area, nil + } + return false, area, nil + }) + handler.SetSleepBeforeWait(2 * time.Second) + handler.SetTimeout(30 * time.Minute) + return handler +} + +// DeleteNetworkAreaRegionWaitHandler will wait for network area region deletion +func DeleteNetworkAreaRegionWaitHandler(ctx context.Context, a APIClientInterface, organizationId, areaId, region string) *wait.AsyncActionHandler[iaas.RegionalArea] { + handler := wait.New(func() (waitFinished bool, response *iaas.RegionalArea, err error) { + area, err := a.GetNetworkAreaRegionExecute(ctx, organizationId, areaId, region) + if err == nil { + return false, nil, nil + } + var oapiErr *oapierror.GenericOpenAPIError + ok := errors.As(err, &oapiErr) + if !ok { + return false, area, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError: %w", err) + } + // The IaaS API response with a 400 if the regional network area configuration doesn't exist because of some compatible + // issue to v1. When v1 is deleted, they may, will respond with 404. + if oapiErr.StatusCode == http.StatusBadRequest || oapiErr.StatusCode == http.StatusNotFound { + return true, area, nil + } + return false, nil, err + }) + handler.SetSleepBeforeWait(2 * time.Second) + handler.SetTimeout(30 * time.Minute) + return handler +} + // ReadyForNetworkAreaDeletionWaitHandler will wait until a deletion of network area is possible // Workaround for https://github.com/stackitcloud/terraform-provider-stackit/issues/907. // When the deletion for a project is triggered, the backend starts a workflow in the background which cleans up all resources @@ -150,14 +196,15 @@ func ReadyForNetworkAreaDeletionWaitHandler(ctx context.Context, a APIClientInte return handler } -// DeleteNetworkAreaWaitHandler will wait for network area deletion +// Deprecated: DeleteNetworkAreaWaitHandler is no longer required and will be removed in April 2026. DeleteNetworkAreaWaitHandler will wait for network area deletion func DeleteNetworkAreaWaitHandler(ctx context.Context, a APIClientInterface, organizationId, areaId string) *wait.AsyncActionHandler[iaas.NetworkArea] { handler := wait.New(func() (waitFinished bool, response *iaas.NetworkArea, err error) { area, err := a.GetNetworkAreaExecute(ctx, organizationId, areaId) if err == nil { return false, nil, nil } - oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + var oapiErr *oapierror.GenericOpenAPIError + ok := errors.As(err, &oapiErr) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { return false, area, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError: %w", err) } @@ -171,17 +218,17 @@ func DeleteNetworkAreaWaitHandler(ctx context.Context, a APIClientInterface, org } // CreateNetworkWaitHandler will wait for network creation using network id -func CreateNetworkWaitHandler(ctx context.Context, a APIClientInterface, projectId, networkId string) *wait.AsyncActionHandler[iaas.Network] { +func CreateNetworkWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, networkId string) *wait.AsyncActionHandler[iaas.Network] { handler := wait.New(func() (waitFinished bool, response *iaas.Network, err error) { - network, err := a.GetNetworkExecute(ctx, projectId, networkId) + network, err := a.GetNetworkExecute(ctx, projectId, region, networkId) if err != nil { return false, network, err } - if network.NetworkId == nil || network.State == nil { + if network.Id == nil || network.Status == nil { return false, network, fmt.Errorf("crate failed for network with id %s, the response is not valid: the id or the state are missing", networkId) } // The state returns to "CREATED" after a successful creation is completed - if *network.NetworkId == networkId && *network.State == CreateSuccess { + if *network.Id == networkId && *network.Status == CreateSuccess { return true, network, nil } return false, network, nil @@ -192,17 +239,17 @@ func CreateNetworkWaitHandler(ctx context.Context, a APIClientInterface, project } // UpdateNetworkWaitHandler will wait for network update -func UpdateNetworkWaitHandler(ctx context.Context, a APIClientInterface, projectId, networkId string) *wait.AsyncActionHandler[iaas.Network] { +func UpdateNetworkWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, networkId string) *wait.AsyncActionHandler[iaas.Network] { handler := wait.New(func() (waitFinished bool, response *iaas.Network, err error) { - network, err := a.GetNetworkExecute(ctx, projectId, networkId) + network, err := a.GetNetworkExecute(ctx, projectId, region, networkId) if err != nil { return false, network, err } - if network.NetworkId == nil || network.State == nil { + if network.Id == nil || network.Status == nil { return false, network, fmt.Errorf("update failed for network with id %s, the response is not valid: the id or the state are missing", networkId) } // The state returns to "CREATED" after a successful update is completed - if *network.NetworkId == networkId && *network.State == CreateSuccess { + if *network.Id == networkId && *network.Status == CreateSuccess { return true, network, nil } return false, network, nil @@ -213,9 +260,9 @@ func UpdateNetworkWaitHandler(ctx context.Context, a APIClientInterface, project } // DeleteNetworkWaitHandler will wait for network deletion -func DeleteNetworkWaitHandler(ctx context.Context, a APIClientInterface, projectId, networkId string) *wait.AsyncActionHandler[iaas.Network] { +func DeleteNetworkWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, networkId string) *wait.AsyncActionHandler[iaas.Network] { handler := wait.New(func() (waitFinished bool, response *iaas.Network, err error) { - network, err := a.GetNetworkExecute(ctx, projectId, networkId) + network, err := a.GetNetworkExecute(ctx, projectId, region, networkId) if err == nil { return false, nil, nil } @@ -233,9 +280,9 @@ func DeleteNetworkWaitHandler(ctx context.Context, a APIClientInterface, project } // CreateVolumeWaitHandler will wait for volume creation -func CreateVolumeWaitHandler(ctx context.Context, a APIClientInterface, projectId, volumeId string) *wait.AsyncActionHandler[iaas.Volume] { +func CreateVolumeWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, volumeId string) *wait.AsyncActionHandler[iaas.Volume] { handler := wait.New(func() (waitFinished bool, response *iaas.Volume, err error) { - volume, err := a.GetVolumeExecute(ctx, projectId, volumeId) + volume, err := a.GetVolumeExecute(ctx, projectId, region, volumeId) if err != nil { return false, volume, err } @@ -255,9 +302,9 @@ func CreateVolumeWaitHandler(ctx context.Context, a APIClientInterface, projectI } // DeleteVolumeWaitHandler will wait for volume deletion -func DeleteVolumeWaitHandler(ctx context.Context, a APIClientInterface, projectId, volumeId string) *wait.AsyncActionHandler[iaas.Volume] { +func DeleteVolumeWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, volumeId string) *wait.AsyncActionHandler[iaas.Volume] { handler := wait.New(func() (waitFinished bool, response *iaas.Volume, err error) { - volume, err := a.GetVolumeExecute(ctx, projectId, volumeId) + volume, err := a.GetVolumeExecute(ctx, projectId, region, volumeId) if err == nil { if volume != nil { if volume.Id == nil || volume.Status == nil { @@ -283,9 +330,9 @@ func DeleteVolumeWaitHandler(ctx context.Context, a APIClientInterface, projectI } // CreateServerWaitHandler will wait for server creation -func CreateServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, serverId string) *wait.AsyncActionHandler[iaas.Server] { +func CreateServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, serverId string) *wait.AsyncActionHandler[iaas.Server] { handler := wait.New(func() (waitFinished bool, response *iaas.Server, err error) { - server, err := a.GetServerExecute(ctx, projectId, serverId) + server, err := a.GetServerExecute(ctx, projectId, region, serverId) if err != nil { return false, server, err } @@ -309,9 +356,9 @@ func CreateServerWaitHandler(ctx context.Context, a APIClientInterface, projectI // ResizeServerWaitHandler will wait for server resize // It checks for an intermediate resizing status and only then waits for the server to become active -func ResizeServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, serverId string) (h *wait.AsyncActionHandler[iaas.Server]) { +func ResizeServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, serverId string) (h *wait.AsyncActionHandler[iaas.Server]) { handler := wait.New(func() (waitFinished bool, response *iaas.Server, err error) { - server, err := a.GetServerExecute(ctx, projectId, serverId) + server, err := a.GetServerExecute(ctx, projectId, region, serverId) if err != nil { return false, server, err } @@ -346,9 +393,9 @@ func ResizeServerWaitHandler(ctx context.Context, a APIClientInterface, projectI } // DeleteServerWaitHandler will wait for volume deletion -func DeleteServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, serverId string) *wait.AsyncActionHandler[iaas.Server] { +func DeleteServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, serverId string) *wait.AsyncActionHandler[iaas.Server] { handler := wait.New(func() (waitFinished bool, response *iaas.Server, err error) { - server, err := a.GetServerExecute(ctx, projectId, serverId) + server, err := a.GetServerExecute(ctx, projectId, region, serverId) if err == nil { if server != nil { if server.Id == nil || server.Status == nil { @@ -374,9 +421,9 @@ func DeleteServerWaitHandler(ctx context.Context, a APIClientInterface, projectI } // StartServerWaitHandler will wait for server start -func StartServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, serverId string) *wait.AsyncActionHandler[iaas.Server] { +func StartServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, serverId string) *wait.AsyncActionHandler[iaas.Server] { handler := wait.New(func() (waitFinished bool, response *iaas.Server, err error) { - server, err := a.GetServerExecute(ctx, projectId, serverId) + server, err := a.GetServerExecute(ctx, projectId, region, serverId) if err != nil { return false, server, err } @@ -399,9 +446,9 @@ func StartServerWaitHandler(ctx context.Context, a APIClientInterface, projectId } // StopServerWaitHandler will wait for server stop -func StopServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, serverId string) *wait.AsyncActionHandler[iaas.Server] { +func StopServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, serverId string) *wait.AsyncActionHandler[iaas.Server] { handler := wait.New(func() (waitFinished bool, response *iaas.Server, err error) { - server, err := a.GetServerExecute(ctx, projectId, serverId) + server, err := a.GetServerExecute(ctx, projectId, region, serverId) if err != nil { return false, server, err } @@ -424,9 +471,9 @@ func StopServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, } // DeallocateServerWaitHandler will wait for server deallocation -func DeallocateServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, serverId string) *wait.AsyncActionHandler[iaas.Server] { +func DeallocateServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, serverId string) *wait.AsyncActionHandler[iaas.Server] { handler := wait.New(func() (waitFinished bool, response *iaas.Server, err error) { - server, err := a.GetServerExecute(ctx, projectId, serverId) + server, err := a.GetServerExecute(ctx, projectId, region, serverId) if err != nil { return false, server, err } @@ -449,9 +496,9 @@ func DeallocateServerWaitHandler(ctx context.Context, a APIClientInterface, proj } // RescueServerWaitHandler will wait for server rescue -func RescueServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, serverId string) *wait.AsyncActionHandler[iaas.Server] { +func RescueServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, serverId string) *wait.AsyncActionHandler[iaas.Server] { handler := wait.New(func() (waitFinished bool, response *iaas.Server, err error) { - server, err := a.GetServerExecute(ctx, projectId, serverId) + server, err := a.GetServerExecute(ctx, projectId, region, serverId) if err != nil { return false, server, err } @@ -474,9 +521,9 @@ func RescueServerWaitHandler(ctx context.Context, a APIClientInterface, projectI } // UnrescueServerWaitHandler will wait for server unrescue -func UnrescueServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, serverId string) *wait.AsyncActionHandler[iaas.Server] { +func UnrescueServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, serverId string) *wait.AsyncActionHandler[iaas.Server] { handler := wait.New(func() (waitFinished bool, response *iaas.Server, err error) { - server, err := a.GetServerExecute(ctx, projectId, serverId) + server, err := a.GetServerExecute(ctx, projectId, region, serverId) if err != nil { return false, server, err } @@ -501,7 +548,7 @@ func UnrescueServerWaitHandler(ctx context.Context, a APIClientInterface, projec // ProjectRequestWaitHandler will wait for a request to succeed. // // It receives a request ID that can be obtained from the "X-Request-Id" header in the HTTP response of any operation in the IaaS API. -// To get this response header, use the "runtime.WithCaptureHTTPResponse" method from the "core" packaghe to get the raw HTTP response of an SDK operation. +// To get this response header, use the "runtime.WithCaptureHTTPResponse" method from the "core" package to get the raw HTTP response of an SDK operation. // Then, the value of the request ID can be obtained by accessing the header key which is defined in the constant "XRequestIDHeader" of this package. // // Example usage: @@ -513,9 +560,9 @@ func UnrescueServerWaitHandler(ctx context.Context, a APIClientInterface, projec // // requestId := httpResp.Header[wait.XRequestIDHeader][0] // _, err = wait.ProjectRequestWaitHandler(context.Background(), iaasClient, projectId, requestId).WaitWithContext(context.Background()) -func ProjectRequestWaitHandler(ctx context.Context, a APIClientInterface, projectId, requestId string) *wait.AsyncActionHandler[iaas.Request] { +func ProjectRequestWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, requestId string) *wait.AsyncActionHandler[iaas.Request] { handler := wait.New(func() (waitFinished bool, response *iaas.Request, err error) { - request, err := a.GetProjectRequestExecute(ctx, projectId, requestId) + request, err := a.GetProjectRequestExecute(ctx, projectId, region, requestId) if err != nil { return false, request, err } @@ -560,9 +607,9 @@ func ProjectRequestWaitHandler(ctx context.Context, a APIClientInterface, projec } // AddVolumeToServerWaitHandler will wait for a volume to be attached to a server -func AddVolumeToServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, serverId, volumeId string) *wait.AsyncActionHandler[iaas.VolumeAttachment] { +func AddVolumeToServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, serverId, volumeId string) *wait.AsyncActionHandler[iaas.VolumeAttachment] { handler := wait.New(func() (waitFinished bool, response *iaas.VolumeAttachment, err error) { - volumeAttachment, err := a.GetAttachedVolumeExecute(ctx, projectId, serverId, volumeId) + volumeAttachment, err := a.GetAttachedVolumeExecute(ctx, projectId, region, serverId, volumeId) if err == nil { if volumeAttachment != nil { if volumeAttachment.VolumeId == nil { @@ -588,9 +635,9 @@ func AddVolumeToServerWaitHandler(ctx context.Context, a APIClientInterface, pro } // RemoveVolumeFromServerWaitHandler will wait for a volume to be attached to a server -func RemoveVolumeFromServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, serverId, volumeId string) *wait.AsyncActionHandler[iaas.VolumeAttachment] { +func RemoveVolumeFromServerWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, serverId, volumeId string) *wait.AsyncActionHandler[iaas.VolumeAttachment] { handler := wait.New(func() (waitFinished bool, response *iaas.VolumeAttachment, err error) { - volumeAttachment, err := a.GetAttachedVolumeExecute(ctx, projectId, serverId, volumeId) + volumeAttachment, err := a.GetAttachedVolumeExecute(ctx, projectId, region, serverId, volumeId) if err == nil { if volumeAttachment != nil { if volumeAttachment.VolumeId == nil { @@ -613,9 +660,9 @@ func RemoveVolumeFromServerWaitHandler(ctx context.Context, a APIClientInterface } // UploadImageWaitHandler will wait for the status image to become AVAILABLE, which indicates the upload of the image has been completed successfully -func UploadImageWaitHandler(ctx context.Context, a APIClientInterface, projectId, imageId string) *wait.AsyncActionHandler[iaas.Image] { +func UploadImageWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, imageId string) *wait.AsyncActionHandler[iaas.Image] { handler := wait.New(func() (waitFinished bool, response *iaas.Image, err error) { - image, err := a.GetImageExecute(ctx, projectId, imageId) + image, err := a.GetImageExecute(ctx, projectId, region, imageId) if err != nil { return false, image, err } @@ -635,9 +682,9 @@ func UploadImageWaitHandler(ctx context.Context, a APIClientInterface, projectId } // DeleteImageWaitHandler will wait for image deletion -func DeleteImageWaitHandler(ctx context.Context, a APIClientInterface, projectId, imageId string) *wait.AsyncActionHandler[iaas.Image] { +func DeleteImageWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, imageId string) *wait.AsyncActionHandler[iaas.Image] { handler := wait.New(func() (waitFinished bool, response *iaas.Image, err error) { - image, err := a.GetImageExecute(ctx, projectId, imageId) + image, err := a.GetImageExecute(ctx, projectId, region, imageId) if err == nil { if image != nil { if image.Id == nil || image.Status == nil { @@ -663,9 +710,9 @@ func DeleteImageWaitHandler(ctx context.Context, a APIClientInterface, projectId } // CreateBackupWaitHandler will wait for backup creation -func CreateBackupWaitHandler(ctx context.Context, a APIClientInterface, projectId, backupId string) *wait.AsyncActionHandler[iaas.Backup] { +func CreateBackupWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, backupId string) *wait.AsyncActionHandler[iaas.Backup] { handler := wait.New(func() (waitFinished bool, response *iaas.Backup, err error) { - backup, err := a.GetBackupExecute(ctx, projectId, backupId) + backup, err := a.GetBackupExecute(ctx, projectId, region, backupId) if err == nil { if backup != nil { if backup.Id == nil || backup.Status == nil { @@ -687,9 +734,9 @@ func CreateBackupWaitHandler(ctx context.Context, a APIClientInterface, projectI } // DeleteBackupWaitHandler will wait for backup deletion -func DeleteBackupWaitHandler(ctx context.Context, a APIClientInterface, projectId, backupId string) *wait.AsyncActionHandler[iaas.Backup] { +func DeleteBackupWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, backupId string) *wait.AsyncActionHandler[iaas.Backup] { handler := wait.New(func() (waitFinished bool, response *iaas.Backup, err error) { - backup, err := a.GetBackupExecute(ctx, projectId, backupId) + backup, err := a.GetBackupExecute(ctx, projectId, region, backupId) if err == nil { if backup != nil { if backup.Id == nil || backup.Status == nil { @@ -714,9 +761,9 @@ func DeleteBackupWaitHandler(ctx context.Context, a APIClientInterface, projectI } // RestoreBackupWaitHandler will wait for backup restoration -func RestoreBackupWaitHandler(ctx context.Context, a APIClientInterface, projectId, backupId string) *wait.AsyncActionHandler[iaas.Backup] { +func RestoreBackupWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, backupId string) *wait.AsyncActionHandler[iaas.Backup] { handler := wait.New(func() (waitFinished bool, response *iaas.Backup, err error) { - backup, err := a.GetBackupExecute(ctx, projectId, backupId) + backup, err := a.GetBackupExecute(ctx, projectId, region, backupId) if err == nil { if backup != nil { if backup.Id == nil || backup.Status == nil { @@ -738,9 +785,9 @@ func RestoreBackupWaitHandler(ctx context.Context, a APIClientInterface, project } // CreateSnapshotWaitHandler will wait for snapshot creation -func CreateSnapshotWaitHandler(ctx context.Context, a APIClientInterface, projectId, snapshotId string) *wait.AsyncActionHandler[iaas.Snapshot] { +func CreateSnapshotWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, snapshotId string) *wait.AsyncActionHandler[iaas.Snapshot] { handler := wait.New(func() (waitFinished bool, response *iaas.Snapshot, err error) { - snapshot, err := a.GetSnapshotExecute(ctx, projectId, snapshotId) + snapshot, err := a.GetSnapshotExecute(ctx, projectId, region, snapshotId) if err == nil { if snapshot != nil { if snapshot.Id == nil || snapshot.Status == nil { @@ -762,9 +809,9 @@ func CreateSnapshotWaitHandler(ctx context.Context, a APIClientInterface, projec } // DeleteSnapshotWaitHandler will wait for snapshot deletion -func DeleteSnapshotWaitHandler(ctx context.Context, a APIClientInterface, projectId, snapshotId string) *wait.AsyncActionHandler[iaas.Snapshot] { +func DeleteSnapshotWaitHandler(ctx context.Context, a APIClientInterface, projectId, region, snapshotId string) *wait.AsyncActionHandler[iaas.Snapshot] { handler := wait.New(func() (waitFinished bool, response *iaas.Snapshot, err error) { - snapshot, err := a.GetSnapshotExecute(ctx, projectId, snapshotId) + snapshot, err := a.GetSnapshotExecute(ctx, projectId, region, snapshotId) if err == nil { if snapshot != nil { if snapshot.Id == nil || snapshot.Status == nil { diff --git a/services/iaas/wait/wait_test.go b/services/iaas/wait/wait_test.go index 868efb7ba..1731d843f 100644 --- a/services/iaas/wait/wait_test.go +++ b/services/iaas/wait/wait_test.go @@ -14,22 +14,23 @@ import ( ) type apiClientMocked struct { - getNetworkAreaFails bool - getNetworkFails bool - getProjectRequestFails bool - isDeleted bool - resourceState string - getVolumeFails bool - getServerFails bool - getAttachedVolumeFails bool - getImageFails bool - getBackupFails bool - isAttached bool - requestAction string - returnResizing bool - getSnapshotFails bool - listProjectsResponses []listProjectsResponses - listProjectsResponsesIdx int + getNetworkAreaRegionFails bool + getNetworkAreaFails bool + getNetworkFails bool + getProjectRequestFails bool + isDeleted bool + resourceState string + getVolumeFails bool + getServerFails bool + getAttachedVolumeFails bool + getImageFails bool + getBackupFails bool + isAttached bool + requestAction string + returnResizing bool + getSnapshotFails bool + listProjectsResponses []listProjectsResponses + listProjectsResponsesIdx int } type listProjectsResponses struct { @@ -75,12 +76,29 @@ func (a *apiClientMocked) GetNetworkAreaExecute(_ context.Context, _, _ string) } return &iaas.NetworkArea{ - AreaId: utils.Ptr("naid"), - State: &a.resourceState, + Id: utils.Ptr("naid"), }, nil } -func (a *apiClientMocked) GetNetworkExecute(_ context.Context, _, _ string) (*iaas.Network, error) { +func (a *apiClientMocked) GetNetworkAreaRegionExecute(_ context.Context, _, _, _ string) (*iaas.RegionalArea, error) { + if a.isDeleted { + return nil, &oapierror.GenericOpenAPIError{ + StatusCode: 404, + } + } + + if a.getNetworkAreaRegionFails { + return nil, &oapierror.GenericOpenAPIError{ + StatusCode: 500, + } + } + + return &iaas.RegionalArea{ + Status: &a.resourceState, + }, nil +} + +func (a *apiClientMocked) GetNetworkExecute(_ context.Context, _, _, _ string) (*iaas.Network, error) { if a.isDeleted { return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, @@ -94,12 +112,12 @@ func (a *apiClientMocked) GetNetworkExecute(_ context.Context, _, _ string) (*ia } return &iaas.Network{ - NetworkId: utils.Ptr("nid"), - State: &a.resourceState, + Id: utils.Ptr("nid"), + Status: &a.resourceState, }, nil } -func (a *apiClientMocked) GetProjectRequestExecute(_ context.Context, _, _ string) (*iaas.Request, error) { +func (a *apiClientMocked) GetProjectRequestExecute(_ context.Context, _, _, _ string) (*iaas.Request, error) { if a.getProjectRequestFails { return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, @@ -113,7 +131,7 @@ func (a *apiClientMocked) GetProjectRequestExecute(_ context.Context, _, _ strin }, nil } -func (a *apiClientMocked) GetVolumeExecute(_ context.Context, _, _ string) (*iaas.Volume, error) { +func (a *apiClientMocked) GetVolumeExecute(_ context.Context, _, _, _ string) (*iaas.Volume, error) { if a.isDeleted { return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, @@ -132,7 +150,7 @@ func (a *apiClientMocked) GetVolumeExecute(_ context.Context, _, _ string) (*iaa }, nil } -func (a *apiClientMocked) GetServerExecute(_ context.Context, _, _ string) (*iaas.Server, error) { +func (a *apiClientMocked) GetServerExecute(_ context.Context, _, _, _ string) (*iaas.Server, error) { if a.returnResizing { a.returnResizing = false return &iaas.Server{ @@ -159,7 +177,7 @@ func (a *apiClientMocked) GetServerExecute(_ context.Context, _, _ string) (*iaa }, nil } -func (a *apiClientMocked) GetAttachedVolumeExecute(_ context.Context, _, _, _ string) (*iaas.VolumeAttachment, error) { +func (a *apiClientMocked) GetAttachedVolumeExecute(_ context.Context, _, _, _, _ string) (*iaas.VolumeAttachment, error) { if a.getAttachedVolumeFails { return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, @@ -178,7 +196,7 @@ func (a *apiClientMocked) GetAttachedVolumeExecute(_ context.Context, _, _, _ st }, nil } -func (a *apiClientMocked) GetImageExecute(_ context.Context, _, _ string) (*iaas.Image, error) { +func (a *apiClientMocked) GetImageExecute(_ context.Context, _, _, _ string) (*iaas.Image, error) { if a.getImageFails { return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, @@ -197,7 +215,7 @@ func (a *apiClientMocked) GetImageExecute(_ context.Context, _, _ string) (*iaas }, nil } -func (a *apiClientMocked) GetBackupExecute(_ context.Context, _, _ string) (*iaas.Backup, error) { +func (a *apiClientMocked) GetBackupExecute(_ context.Context, _, _, _ string) (*iaas.Backup, error) { if a.isDeleted { return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, @@ -216,7 +234,7 @@ func (a *apiClientMocked) GetBackupExecute(_ context.Context, _, _ string) (*iaa }, nil } -func (a *apiClientMocked) GetSnapshotExecute(_ context.Context, _, _ string) (*iaas.Snapshot, error) { +func (a *apiClientMocked) GetSnapshotExecute(_ context.Context, _, _, _ string) (*iaas.Snapshot, error) { if a.isDeleted { return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, @@ -235,185 +253,6 @@ func (a *apiClientMocked) GetSnapshotExecute(_ context.Context, _, _ string) (*i }, nil } -func TestCreateNetworkAreaWaitHandler(t *testing.T) { - tests := []struct { - desc string - getFails bool - resourceState string - wantErr bool - wantResp bool - }{ - { - desc: "create_succeeded", - getFails: false, - resourceState: CreateSuccess, - wantErr: false, - wantResp: true, - }, - { - desc: "get_fails", - getFails: true, - resourceState: "", - wantErr: true, - wantResp: false, - }, - { - desc: "timeout", - getFails: false, - resourceState: "ANOTHER STATE", - wantErr: true, - wantResp: true, - }, - } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - apiClient := &apiClientMocked{ - getNetworkAreaFails: tt.getFails, - resourceState: tt.resourceState, - } - - var wantRes *iaas.NetworkArea - if tt.wantResp { - wantRes = &iaas.NetworkArea{ - AreaId: utils.Ptr("naid"), - State: utils.Ptr(tt.resourceState), - } - } - - handler := CreateNetworkAreaWaitHandler(context.Background(), apiClient, "oid", "naid") - - gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) - - if (err != nil) != tt.wantErr { - t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) - } - if !cmp.Equal(gotRes, wantRes) { - t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) - } - }) - } -} - -func TestUpdateNetworkAreaWaitHandler(t *testing.T) { - tests := []struct { - desc string - getFails bool - resourceState string - wantErr bool - wantResp bool - }{ - { - desc: "update_succeeded", - getFails: false, - resourceState: CreateSuccess, - wantErr: false, - wantResp: true, - }, - { - desc: "get_fails", - getFails: true, - resourceState: "", - wantErr: true, - wantResp: false, - }, - { - desc: "timeout", - getFails: false, - resourceState: "ANOTHER STATE", - wantErr: true, - wantResp: true, - }, - } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - apiClient := &apiClientMocked{ - getNetworkAreaFails: tt.getFails, - resourceState: tt.resourceState, - } - - var wantRes *iaas.NetworkArea - if tt.wantResp { - wantRes = &iaas.NetworkArea{ - AreaId: utils.Ptr("naid"), - State: utils.Ptr(tt.resourceState), - } - } - - handler := UpdateNetworkAreaWaitHandler(context.Background(), apiClient, "oid", "naid") - - gotRes, err := handler.SetTimeout(10 * time.Millisecond).SetSleepBeforeWait(1 * time.Millisecond).WaitWithContext(context.Background()) - - if (err != nil) != tt.wantErr { - t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) - } - if !cmp.Equal(gotRes, wantRes) { - t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) - } - }) - } -} - -func TestDeleteNetworkAreaWaitHandler(t *testing.T) { - tests := []struct { - desc string - getFails bool - isDeleted bool - resourceState string - wantErr bool - wantResp bool - }{ - { - desc: "delete_succeeded", - getFails: false, - isDeleted: true, - wantErr: false, - wantResp: false, - }, - { - desc: "get_fails", - getFails: true, - resourceState: "", - wantErr: true, - wantResp: false, - }, - { - desc: "timeout", - getFails: false, - resourceState: "ANOTHER STATE", - wantErr: true, - wantResp: false, - }, - } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - apiClient := &apiClientMocked{ - getNetworkAreaFails: tt.getFails, - isDeleted: tt.isDeleted, - resourceState: tt.resourceState, - } - - var wantRes *iaas.NetworkArea - if tt.wantResp { - wantRes = &iaas.NetworkArea{ - AreaId: utils.Ptr("naid"), - State: utils.Ptr(tt.resourceState), - } - } - - handler := DeleteNetworkAreaWaitHandler(context.Background(), apiClient, "oid", "naid") - - gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) - - if (err != nil) != tt.wantErr { - t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) - } - if !cmp.Equal(gotRes, wantRes) { - t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) - } - }) - } -} - func TestCreateNetworkWaitHandler(t *testing.T) { tests := []struct { desc string @@ -454,12 +293,12 @@ func TestCreateNetworkWaitHandler(t *testing.T) { var wantRes *iaas.Network if tt.wantResp { wantRes = &iaas.Network{ - NetworkId: utils.Ptr("nid"), - State: utils.Ptr(tt.resourceState), + Id: utils.Ptr("nid"), + Status: utils.Ptr(tt.resourceState), } } - handler := CreateNetworkWaitHandler(context.Background(), apiClient, "pid", "nid") + handler := CreateNetworkWaitHandler(context.Background(), apiClient, "pid", "region", "nid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).SetSleepBeforeWait(1 * time.Millisecond).WaitWithContext(context.Background()) @@ -513,12 +352,12 @@ func TestUpdateNetworkWaitHandler(t *testing.T) { var wantRes *iaas.Network if tt.wantResp { wantRes = &iaas.Network{ - NetworkId: utils.Ptr("nid"), - State: utils.Ptr(tt.resourceState), + Id: utils.Ptr("nid"), + Status: utils.Ptr(tt.resourceState), } } - handler := UpdateNetworkWaitHandler(context.Background(), apiClient, "pid", "nid") + handler := UpdateNetworkWaitHandler(context.Background(), apiClient, "pid", "region", "nid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).SetSleepBeforeWait(1 * time.Millisecond).WaitWithContext(context.Background()) @@ -574,12 +413,12 @@ func TestDeleteNetworkWaitHandler(t *testing.T) { var wantRes *iaas.Network if tt.wantResp { wantRes = &iaas.Network{ - NetworkId: utils.Ptr("nid"), - State: utils.Ptr(tt.resourceState), + Id: utils.Ptr("nid"), + Status: utils.Ptr(tt.resourceState), } } - handler := DeleteNetworkWaitHandler(context.Background(), apiClient, "pid", "nid") + handler := DeleteNetworkWaitHandler(context.Background(), apiClient, "pid", "region", "nid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -645,7 +484,7 @@ func TestCreateVolumeWaitHandler(t *testing.T) { } } - handler := CreateVolumeWaitHandler(context.Background(), apiClient, "pid", "vid") + handler := CreateVolumeWaitHandler(context.Background(), apiClient, "pid", "region", "vid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -706,7 +545,7 @@ func TestDeleteVolumeWaitHandler(t *testing.T) { } } - handler := DeleteVolumeWaitHandler(context.Background(), apiClient, "pid", "vid") + handler := DeleteVolumeWaitHandler(context.Background(), apiClient, "pid", "region", "vid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -772,7 +611,7 @@ func TestCreateServerWaitHandler(t *testing.T) { } } - handler := CreateServerWaitHandler(context.Background(), apiClient, "pid", "sid") + handler := CreateServerWaitHandler(context.Background(), apiClient, "pid", "region", "sid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -833,7 +672,7 @@ func TestDeleteServerWaitHandler(t *testing.T) { } } - handler := DeleteServerWaitHandler(context.Background(), apiClient, "pid", "sid") + handler := DeleteServerWaitHandler(context.Background(), apiClient, "pid", "region", "sid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -911,7 +750,7 @@ func TestResizeServerWaitHandler(t *testing.T) { } } - handler := ResizeServerWaitHandler(context.Background(), apiClient, "pid", "sid") + handler := ResizeServerWaitHandler(context.Background(), apiClient, "pid", "region", "sid") gotRes, err := handler.SetThrottle(1 * time.Millisecond).SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -977,7 +816,7 @@ func TestStartServerWaitHandler(t *testing.T) { } } - handler := StartServerWaitHandler(context.Background(), apiClient, "pid", "sid") + handler := StartServerWaitHandler(context.Background(), apiClient, "pid", "region", "sid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -1043,7 +882,7 @@ func TestStopServerWaitHandler(t *testing.T) { } } - handler := StopServerWaitHandler(context.Background(), apiClient, "pid", "sid") + handler := StopServerWaitHandler(context.Background(), apiClient, "pid", "region", "sid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -1109,7 +948,7 @@ func TestDeallocateServerWaitHandler(t *testing.T) { } } - handler := DeallocateServerWaitHandler(context.Background(), apiClient, "pid", "sid") + handler := DeallocateServerWaitHandler(context.Background(), apiClient, "pid", "region", "sid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -1175,7 +1014,7 @@ func TestRescueServerWaitHandler(t *testing.T) { } } - handler := RescueServerWaitHandler(context.Background(), apiClient, "pid", "sid") + handler := RescueServerWaitHandler(context.Background(), apiClient, "pid", "region", "sid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -1241,7 +1080,7 @@ func TestUnrescueServerWaitHandler(t *testing.T) { } } - handler := UnrescueServerWaitHandler(context.Background(), apiClient, "pid", "sid") + handler := UnrescueServerWaitHandler(context.Background(), apiClient, "pid", "region", "sid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -1336,7 +1175,7 @@ func TestProjectRequestWaitHandler(t *testing.T) { } } - handler := ProjectRequestWaitHandler(context.Background(), apiClient, "pid", "rid") + handler := ProjectRequestWaitHandler(context.Background(), apiClient, "pid", "region", "rid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -1394,7 +1233,7 @@ func TestAddVolumeToServerWaitHandler(t *testing.T) { } } - handler := AddVolumeToServerWaitHandler(context.Background(), apiClient, "pid", "sid", "vid") + handler := AddVolumeToServerWaitHandler(context.Background(), apiClient, "pid", "region", "sid", "vid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -1452,7 +1291,7 @@ func TestRemoveVolumeFromServerWaitHandler(t *testing.T) { } } - handler := RemoveVolumeFromServerWaitHandler(context.Background(), apiClient, "pid", "sid", "vid") + handler := RemoveVolumeFromServerWaitHandler(context.Background(), apiClient, "pid", "region", "sid", "vid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -1518,7 +1357,7 @@ func TestUploadImageWaitHandler(t *testing.T) { } } - handler := UploadImageWaitHandler(context.Background(), apiClient, "pid", "iid") + handler := UploadImageWaitHandler(context.Background(), apiClient, "pid", "region", "iid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -1567,7 +1406,7 @@ func TestDeleteImageWaitHandler(t *testing.T) { resourceState: tt.resourceState, } - handler := DeleteImageWaitHandler(context.Background(), apiClient, "pid", "iid") + handler := DeleteImageWaitHandler(context.Background(), apiClient, "pid", "region", "iid") _, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -1630,7 +1469,7 @@ func TestCreateBackupWaitHandler(t *testing.T) { } } - handler := CreateBackupWaitHandler(context.Background(), apiClient, "pid", "bid") + handler := CreateBackupWaitHandler(context.Background(), apiClient, "pid", "region", "bid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) if (err != nil) != tt.wantErr { @@ -1682,7 +1521,7 @@ func TestDeleteBackupWaitHandler(t *testing.T) { resourceState: tt.resourceState, } - handler := DeleteBackupWaitHandler(context.Background(), apiClient, "pid", "bid") + handler := DeleteBackupWaitHandler(context.Background(), apiClient, "pid", "region", "bid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) if (err != nil) != tt.wantErr { @@ -1747,7 +1586,7 @@ func TestRestoreBackupWaitHandler(t *testing.T) { } } - handler := RestoreBackupWaitHandler(context.Background(), apiClient, "pid", "bid") + handler := RestoreBackupWaitHandler(context.Background(), apiClient, "pid", "region", "bid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) if (err != nil) != tt.wantErr { @@ -1812,7 +1651,7 @@ func TestCreateSnapshotWaitHandler(t *testing.T) { } } - handler := CreateSnapshotWaitHandler(context.Background(), apiClient, "pid", "sid") + handler := CreateSnapshotWaitHandler(context.Background(), apiClient, "pid", "region", "sid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) if (err != nil) != tt.wantErr { @@ -1877,7 +1716,7 @@ func TestDeleteSnapshotWaitHandler(t *testing.T) { } } - handler := DeleteSnapshotWaitHandler(context.Background(), apiClient, "pid", "sid") + handler := DeleteSnapshotWaitHandler(context.Background(), apiClient, "pid", "region", "sid") gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) if (err != nil) != tt.wantErr { @@ -2038,3 +1877,121 @@ func TestReadyForNetworkAreaDeletionWaitHandler(t *testing.T) { }) } } + +func TestCreateNetworkAreaRegionWaitHandler(t *testing.T) { + tests := []struct { + desc string + getFails bool + resourceState string + wantErr bool + wantResp bool + }{ + { + desc: "create_succeeded", + getFails: false, + resourceState: CreateSuccess, + wantErr: false, + wantResp: true, + }, + { + desc: "get_fails", + getFails: true, + resourceState: "", + wantErr: true, + wantResp: false, + }, + { + desc: "timeout", + getFails: false, + resourceState: "ANOTHER STATE", + wantErr: true, + wantResp: true, + }, + } + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + apiClient := &apiClientMocked{ + getNetworkAreaRegionFails: tt.getFails, + resourceState: tt.resourceState, + } + + var wantRes *iaas.RegionalArea + if tt.wantResp { + wantRes = &iaas.RegionalArea{ + Status: utils.Ptr(tt.resourceState), + } + } + + handler := CreateNetworkAreaRegionWaitHandler(context.Background(), apiClient, "pid", "aid", "region") + + gotRes, err := handler.SetTimeout(10 * time.Millisecond).SetSleepBeforeWait(1 * time.Millisecond).WaitWithContext(context.Background()) + + if (err != nil) != tt.wantErr { + t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) + } + if !cmp.Equal(gotRes, wantRes) { + t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) + } + }) + } +} + +func TestDeleteNetworkAreaRegionWaitHandler(t *testing.T) { + tests := []struct { + desc string + getFails bool + isDeleted bool + resourceState string + wantErr bool + wantResp bool + }{ + { + desc: "delete_succeeded", + getFails: false, + isDeleted: true, + wantErr: false, + wantResp: false, + }, + { + desc: "get_fails", + getFails: true, + resourceState: "", + wantErr: true, + wantResp: false, + }, + { + desc: "timeout", + getFails: false, + resourceState: "ANOTHER STATE", + wantErr: true, + wantResp: false, + }, + } + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + apiClient := &apiClientMocked{ + getNetworkAreaRegionFails: tt.getFails, + isDeleted: tt.isDeleted, + resourceState: tt.resourceState, + } + + var wantRes *iaas.RegionalArea + if tt.wantResp { + wantRes = &iaas.RegionalArea{ + Status: utils.Ptr(tt.resourceState), + } + } + + handler := DeleteNetworkAreaRegionWaitHandler(context.Background(), apiClient, "pid", "region", "nid") + + gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) + + if (err != nil) != tt.wantErr { + t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) + } + if !cmp.Equal(gotRes, wantRes) { + t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) + } + }) + } +}